I often connect to a network, that is open, but requires a key-pass authentication before used in a webpage. Is it possible to automate the authentication with a script?
What a fun problem.
While I'm sure ændrük's answer would probably work, I'm slightly adverse to letting something dependant on desktop software manage the network availability.
I would suggest you play around with Python's Mechanize library. You can install it from the repositories via:
Then get scripting. You need to start by finding out the stucture of the page you're submitting to. You need to find where you form comes and what fields need to be entered to submit. Once you know that, it's really as simple as just writing a quick little form parser and submitter. Mechanize does all the heavy lifting. Here's a quick example adapted from their docs on forms:
Depending on how their system works, this might be enough. You might have to tie in some cookie jarring to keep a session alive while they turn the connection on, but technically speaking, there's no argument why they should require that.
Then you just need to tie this into the networking system so it gets called. Loading it from
Depending on the type of captive portal in place, you might be able to authenticate via a POST request sent using Wget (use Tamper Data to learn what data needs to be sent) or by using an iMacros script in Firefox.
You can add a script to