Skip to content

Instantly share code, notes, and snippets.

@larrybolt
Created August 21, 2013 13:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larrybolt/6294675 to your computer and use it in GitHub Desktop.
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
#!/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
}
@digihash
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment