Query regarding creating auto sessions on internet.iitb site

21 views
Skip to first unread message

Chinmay Rajhans

unread,
Feb 27, 2016, 9:27:48 AM2/27/16
to wncc_iitb


Is there any software that can create session automatically on internet.iitb.ac.in site?
It should work on Windows and Linux preferably.
Even if servers restarts and closed the session this software should re-start it on its own after specified period of time using the authentication credentials already stored inside it.

Or any plugin inside browser that will create it as and when it is not present.

Kindly let me know.

Chinmay


Siddharth Bulia

unread,
Feb 27, 2016, 10:28:53 AM2/27/16
to wncc...@googlegroups.com

--
--
The website for the club is http://wncc-iitb.org/
To post to this group, send email to wncc...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Web and Coding Club IIT Bombay" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wncc_iitb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pritam Baral

unread,
Feb 27, 2016, 4:42:29 PM2/27/16
to wncc...@googlegroups.com

Linux solution, with theory of operation:

1. When to log in? When the IP address changes.

2. How to remain logged in? Keep using the internet, or login every 15 minutes.

#1 is solved on Linux using NetworkManager's interfaces. One can either listen for the 'connected to a network!' event on dbus, or one can tell NM itself to execute a script when connected. Personally, I prefer the latter on personal systems and the former on multiuser systems.

NetworkManager has a nifty feature, called dispatchers, which executes something when a specific network event happens. It's not as fine-grained as the events dbus, but for our purposes, it will suffice. Check out the manual: http://linux.die.net/man/8/networkmanager

I fire a script upon dispatched events 'up' and 'dhcp4-change' that logs me in to internet.iitb. It's a simple enough one liner, with the following contents:

curl --noproxy '*' https://internet.iitb.ac.in/index.php -d 'uname=<YOUR-USERNAME>&passwd=<YOUR-PASSWORD>&button=Login'

#2 is also simply solved using a cron job.

For good measure, I wrap both scripts with a check for the availability of the domain 'internet.iitb.ac.in', so they don't execute when I'm connected to a non-IITB network.

I tried doing this on Windows, using the Task Scheduler, but for some reason the 'connected to a network!' events just didn't reach. I gave up after trying that on one system, maybe someone else will have better luck.

Sourabh Bhat

unread,
Feb 27, 2016, 4:50:40 PM2/27/16
to wncc...@googlegroups.com
Just saw that the form on internet.iitb.ac.in uses a POST method. On linux it should be doable using cURL to submit the form to index.php, with parameters (uname, passwd). I am not sure about windows.

On linux the command will look like:
curl --data "uname=username&passwd=password" https://internet.iitb.ac.in/index.php

Just replace username and password with your credentials.

Regards,
Sourabh

On Sat, Feb 27, 2016 at 4:35 PM, Chinmay Rajhans <rajhans...@gmail.com> wrote:

--
--
The website for the club is http://wncc-iitb.org/
To post to this group, send email to wncc...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Web and Coding Club IIT Bombay" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wncc_iitb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best Regards,
-- Sourabh

Pritam Baral

unread,
Feb 27, 2016, 10:30:20 PM2/27/16
to wncc...@googlegroups.com

@Sourabh: when I first tried that (more than a year ago), it didn't work. Apparently the form processor at internet.iitb also expected the submit button in the POST data.

Reply all
Reply to author
Forward
0 new messages