Created
August 21, 2013 13:49
-
-
Save larrybolt/6294675 to your computer and use it in GitHub Desktop.
Telenet Hotspot/Homespot auto-login
Should be placed at: `/System/Library/CoreServices/Captive Network Assistant.app/Contents/MacOS/Captive Network Assistant` overwriting the file
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
#!/usr/bin/php | |
<?php | |
$SSID=trim(`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk -F: '/ SSID:/ {print $2}' | sed -e 's/.*SSID: //'`); | |
if ( $SSID == 'TELENETHOTSPOT' ) | |
{ | |
if (`curl --cookie-jar /tmp/cookiejar \ | |
--data "c=std&lang=nl&checkterms=1&userid=USERNAME&password=PASSWORD&remember=on&terms=on" \ | |
--cookie "TNLANG=nl&TN_HS_COOKIE_DETECT=HELLO" \ | |
--max-time 60 \ | |
--user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0" \ | |
--referer "https://portal.telenethotspot.be/portal/form.do" \ | |
"https://portal.telenethotspot.be/logon/welcome.jsp"`) | |
return `/Applications/Utilities/terminal-notifier.app/Contents/MacOS/terminal-notifier \ | |
-title TELENETHOTSPOT \ | |
-message Ingelogd! \ | |
-open http://www.google.com`; | |
} | |
else if ( $SSID == 'TELENETHOMESPOT' ) | |
{ | |
if (`curl --cookie-jar /tmp/cookiejar \ | |
--data "userName=USERNAME&passWord=PASSWORD&keepMeSignedIn=on&terms=on" \ | |
--cookie "TNLANG=nl&TN_HS_COOKIE_DETECT=HELLO" \ | |
--max-time 60 \ | |
--user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0" \ | |
--referer "https://portal.telenethotspot.be/portal/form.do" \ | |
"https://portal.telenethomespot.be/portal/login.html"`) | |
return `/Applications/Utilities/terminal-notifier.app/Contents/MacOS/terminal-notifier \ | |
-title TELENETHOMESPOT \ | |
-message Ingelogd! \ | |
-open http://www.google.com`; | |
} | |
else | |
{ | |
// You could add more networks here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I place this script that exact folder with all the same rights like the original file for writing and executing. It doesn't do anything. The Username en password are filled in but it doesn't work. I also have PHP 5.4.17 (cli). And I want to connect to telenethomespot.