To automate log on to hotel / apartment wifi networks that uses a login web page. Typically for unsecured (non-WEP/WPA/WPA2) connections that use the crappy "splash" screen login prompt where the "remember me" checkbox is borked.
- Linux only ATM. However, forks, improvements and pull requests are welcome.
- License: GNU v3.0
I got bored of manually loading up our apartment's Wifi provider's 192.x.x.x page and clicking on their broken "Login" button every time we turn on our machines. It required two clicks, first to refresh an already loaded page and second to click "Login", each time waiting on an overloaded hotspot's microprocessor. Instead, I wrote this project in an evening to run in the background and give back some piece of mind..
wireless
- to collect wireless access point names (plus interface, driver, etc).backoff
- function decorators for fibonacci/exponential backoff/ retries on failures.dryscrape
- HTTP requests to web pages dependent on loaded javascript, then scraping its content.beautifulsoup
andlxml
- for DOM parsing.requests
- for HTTP requests issuing.urllib
- for url encoding.proc_killer
- for a callback hook on a SIGKILL interrupt.App
- an uncomplicated hardcoded-config class. Alternative isConfigParser
.getpass
- for taking password inputs on the console.
- Clone the repo:
git clone https://github.com/pmdscully/HHWAutoLogon.git
- Install the required packages (below)
- Run it.
sudo apt-get install python2.7 qt5-default libqt5webkit5-dev build-essential python-lxml python-pip xvfb
sudo pip install wireless requests beautifulsoup4 dryscrape urllib backoff
- Update as appropriate -
src/config.py
->App
configuration class, with:- SSID names
- login URL, etc.
- username
- password (optional, enter when program runs instead.)
- Run:
- Foreground:
python HHWAutoLogon.py
- Background:
nohup python HHWAutoLogon.py &; disown;
(you'll need to fill in the username/password somehow)
- Foreground:
- Create a new profile: -
src/hotspot_profiles/
->Profile
implementation class. SubclassProfile_ABC
and override the two methods that:- collect to login page form and fill in the username / password
- send the form data and wait for confirmation page load.
- Use the new Profile: - In
__main__
insrc/HHWAutoLogon.py
, instantiate the new profile and pass intoDoConnect
. - As required, update logging level
logging.basicConfig(format='%(message)s',level=logging.INFO)
, e.g. level=logging.DEBUG / WARNING , etc.