Login to NUSOPEN network on iPAQ
From MoDe
Date: Feb 19, 2006
Author: CHENG Kok Hong
Update 17-Mar-2006: NUSOPEN will log you out after some time of inactivity. To keep your connection up, you can periodically fetch a webpage of your liking. Do NOT re-login every minute. Run this script (http://www.comp.nus.edu.sg/~g0502245/sma5508/keepalive.sh) with
sh keepalive.sh &
Update (23-Feb-2006): Using OpenVPN - Method preferred by NUS.
IMPT Note
Familiar v0.8.2 does not work for this method. (Thanks to Zahoor for this information)
You need to install the latest snapshot of GPE in order to install the latest version of Curl. http://familiar.handhelds.org/snapshots/v0.8.3/RC2/unsorted/gpe-image-v0.8.3-h3900.rootfs.jffs2
In HyperTerminal, get into the 'boot>' prompt and do a 'load root' command to transfer the rootfs. Beware, you should keep originals of all your own files on the iPAQ before doing so, as this will completely overwrite the iPAQ filesystem.
Alternatively, someone can write a Python script using urllib to submit a HTTPS request. Extra credit anyone???
You need the latest version of Curl. Download it: http://familiar.handhelds.org/releases/v0.8.3/feed/world/curl_7.14.0-r2_arm.ipk
Transfer the file to your iPAQ using HyperTerminal(with Zmodem) and install it with: ipkg install curl_7.14.0-r2_arm.ipk
Summary
You can login to the NUSOPEN network simply with this command - curl --insecure -c cookies -i -L -d Account_Username=<your_username> -d submitButton=Login -d Account_Password=<your_password> -d TLN_TargetURL=TARGET_URL=http://www.nus.edu.sg/ https://137.132.80.178/cgi-bin/authen/login.cgi
Replace <your_username> and <your_password> with whatever you use to login to your NUS machines.
If you had no idea what that was all about, please read on.
Value-Added Service
I've written a script (in Python no less!) to do the login for you: http://www.comp.nus.edu.sg/~g0502245/sma5508/nusopen.py
The script depends on getpass.py, which is available in your Python distribution. If you haven't installed Python, or you are just lazy, get it from: http://www.comp.nus.edu.sg/~g0502245/sma5508/getpass.py
Transfer them to your iPAQ using HyperTerminal. Note: they should be in the same directory.
To login: python nusopen.py
Follow the prompts to enter your username and password. You should see a large amount of text flowing by.
You can scroll back to look for a string that looks like "You have successfully logged in to the network." It means that login is successful and you have Internet connectivity.
If not, check your username and password and try again.
To logout: python nusopen.py logout
You can manually logout at this page: https://137.132.80.178/authen/logout.html
Reminders
1. Try not to send personal information over unencrypted links (i.e. Telnet, FTP, HTTP). Try to use SSH, SFTP, SCP, HTTPS instead.
2. Remember to LOGOUT after you are done!
Another lazy way
1. You can also place "curl --insecure -c cookies -i -L -d Account_Username=<your_username> -d submitButton=Login -d Account_Password=<your_password> -d TLN_TargetURL=TARGET_URL=http://www.nus.edu.sg/ https://137.132.80.178/cgi-bin/authen/login.cgi" into a script and type sh <your_file_name> on the command prompt to run it.
- Kian Loon
