Created
March 22, 2023 21:08
-
-
Save Azuxul/4aebfd6eb4e3105233639674f32d9da4 to your computer and use it in GitHub Desktop.
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/bash | |
# credentials | |
username="USERNAME" | |
password="PASSWORD" | |
# settings | |
start_url="http://google.com" | |
login_url_check_sub_str="fgtauth?" | |
echo "[CIUP-NET] Start CIUP network autologin" | |
login_url=$(curl -s $start_url | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*") | |
if [[ "$login_url" == *"$login_url_check_sub_str"* ]]; then | |
magic=$(echo $login_url | grep -oP "(?<=fgtauth\?)[a-fA-F0-9]*") | |
echo "[CIUP-NET] Load login portal" | |
curl -s $login_url > /dev/null | |
echo "[CIUP-NET] Start to connect using credentials" | |
curl $login_url --data '4Tredir='$start_url'&magic='$magic'&username='$username'&password='$password'' --insecure | |
echo "[CIUP-NET] Login complete" | |
fi | |
echo "[CIUP-NET] End of CIUP network autologin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment