You are not logged in.

#1 2010-02-07 21:44:50

smalltimer
Member
Registered: 2009-12-21
Posts: 2

browser based login

hi guys!

my first post!! a noob, go easy. use simple words etc ...

i just shifted to a new hostel. here, every time i need to access the internet, i need to login through a browser window. this way, to do anything on the internet, i must have that particular webpage open in some browser tab. if not, the internet is disconnected. i would like to know if there is a way to write a startup script that would open a (hidden) browser, login for me, and keep that particular page open right until i shut down!

thanks!!!

note to moderator: if it is in the wrong section, please do move the post to the appropriate section!

Offline

#2 2010-02-08 12:17:31

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: browser based login

I have something similar here (dormitory, university is my ISP). I need to, after dhcp-ing my IP, 'activate' it by login to some webpage. However i don't need to keep that page open then, as the login will last for max. 24hours.
Since i was annoyed to get disconnected every 24hours, i wrote a little script with curl, that automatically logs me out and back in at a certain time.
I use the option -d to post data to the page.
I dunno exactly what you mean with "keep open", but if it is just a simple login via submit-form, you could try curl.
You could for example wget the page, then open it in a browser, put login data and stuff in and hit submit/login, and then it wants to redirect you but since you downloaded the page and look at it as a file, it can't. And at that moment it shows you the string that it appends at the url with login info and such. Put that string then in "" after curl -d

Might not work for you, but maybe it's a start.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#3 2010-02-08 23:44:43

raf_kig
Member
Registered: 2008-11-28
Posts: 143

Re: browser based login

Okay, this should be possible but you will need some knowledge of http.

You will need firefox and the extension "Tamper Data" (https://addons.mozilla.org/en-US/firefox/addon/966).

After you installed the extension, go to the login page, but don't log in yet.
Open tamper data (Tools->Tamper Data), now log in. In the Tamper Data window you will probably see a post request. (Method: "POST").
Select the POST request, in the lower window you will see a list of request headers and values.
Select POSTDATA, right click and select copy.

Paste that string somewhere (in an editor or whatever) and replace sensitive information (your password/username) and paste the edited string here. Then we can write a little script to do the login automatically.

You mentioned that you'll have to leave the window open, so there probably is some JavaScript code that makes sure the connection stays alive - so a copy of the source of the webpage + the JavaScript files it references might come in handy.

Regards,

raf

Last edited by raf_kig (2010-02-08 23:45:27)

Offline

Board footer

Powered by FluxBB