If you're near a coffee shop with a free Wifi network with a guest login that uses a Cisco router, you can use a simple script to automatically login so you have free Wifi without any annoying login pages!
I reverse engineered the compressed JS of the login page to find out how login works (won't go into details it was a few years ago). Anyways, it turns out you can login with a simple curl request. Here's how.
First, manually connect to the Wifi, but don't login!.
Now run `ifconfig` or `ipconfig` to get the MAC address of the wifi card of your device and the ipaddress it assigned you.
The MAC address will be a series of hex separated by colons like: `00:AB:CD:EF...`. Note this down.
The IP address will 4 sets of numbers like `192.168.3.100`.
Next get the guest password from the Coffee shop, usually they have them posted inside or just ask them (and buy a cup of coffee!).
{"result": "OK"}
And after that you're logged in (for a day). Simple right?
Now click the Management subtab, enable cron, and paste in:
Save and you're good to go!
Enjoy your less annoying free Wifi! Don't forget to support the local shop by buying coffee there every now and then! And give them a big tip with all the money you're saving by being tech savy.
Happy surfing!
I reverse engineered the compressed JS of the login page to find out how login works (won't go into details it was a few years ago). Anyways, it turns out you can login with a simple curl request. Here's how.
Getting required parameters
First, manually connect to the Wifi, but don't login!.
Now run `ifconfig` or `ipconfig` to get the MAC address of the wifi card of your device and the ipaddress it assigned you.
The MAC address will be a series of hex separated by colons like: `00:AB:CD:EF...`. Note this down.
The IP address will 4 sets of numbers like `192.168.3.100`.
Next get the guest password from the Coffee shop, usually they have them posted inside or just ask them (and buy a cup of coffee!).
Login command
Now that we have everything login is pretty simple.
Use `curl` or equivlalent and run the following:
curl -H "X-JNAP-Action: http://cisco.com/jnap/guestnetwork/Authenticate" --data '{"macAddress":"YO:UR:MA:CA:DD:RS","ipAddress":"192.168.3.XX","password":"The Password"}' -X POST http://192.168.3.1:10080/JNAP/
You should get back:
{"result": "OK"}
And after that you're logged in (for a day). Simple right?
Setup with DD-WRT
If you have a router with DD-WRT, you can configure it to do this using cron. Login to the DD-WRT dashboard, click on the Administration tab and then Commands. Get the IP and MAC address (of the router). Paste the script in and do save as startup and custom script.#!/bin/sh
curl -H "X-JNAP-Action: http://cisco.com/jnap/guestnetwork/Authenticate" --data '{"macAddress":"YO:UR:MA:CA:DD:RS","ipAddress":"192.168.3.XX","password":"The Password"}' -X POST http://192.168.3.1:10080/JNAP/
Now click the Management subtab, enable cron, and paste in:
0,10,20,30,40,50 * * * * root sh /tmp/custom.sh
Save and you're good to go!
Comments
Please note that unlike other methods, this is still accepting the user agreement and is thus completely legal (it's just automating the process of doing it manually). You're still required to follow the rules posted and respect their usage guidelines.Enjoy your less annoying free Wifi! Don't forget to support the local shop by buying coffee there every now and then! And give them a big tip with all the money you're saving by being tech savy.
Happy surfing!
Comments
Post a Comment