Created
May 18, 2016 06:24
-
-
Save ruden/e05d22c1152dc1325236317650deb724 to your computer and use it in GitHub Desktop.
Web authorization for Nodeny billing system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HOST="your host" | |
USERNAME="your login" | |
PASSWORD="your password" | |
URL="https://$HOST/cgi-bin/stat.pl" | |
ses() | |
{ | |
echo `wget --no-check-certificate -qO- $URL | grep -Eo -e '[0-9]{5,7}'` | |
} | |
hex_md5() | |
{ | |
echo -n "$1 $2" | md5sum - | awk '{print $1}' | |
} | |
SES=`ses`; | |
PP=`hex_md5 $SES $PASSWORD` | |
while true; | |
do | |
auth_result=`wget --no-check-certificate -q -O- "$URL?uu=$USERNAME&a=98&pp=$PP"`; | |
echo $auth_result | grep -q 'meta http-equiv="refresh"' | |
if [ 0 -ne $? ]; | |
then | |
SES=`ses`; | |
PP=`hex_md5 $SES $PASSWORD` | |
fi; | |
sleep 40; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment