Auto-login to UOG wifi without WPA

repost form the old forums

quick how-to for Ubuntu:
1) $ gksudo vi /etc/network/if-up.d/magicup
2) paste contents of python or wget script.
3) enter your password and username to replace Your_Username and Your_Password
4) save and close
5) $ sudo chmod 700 /etc/network/if-up.d/magicup (so only can run or view it)

python (matt)
----
#! /usr/bin/python

import urllib

data = urllib.urlencode({ "buttonClicked" : "4", "redirect_rul" : "http://www.uoguelph.ca", "err_flag" : "0" , "username" : "Your_Username" , "password" : "Your_Passwd"})
urllib.urlopen("https://mywireless.uoguelph.ca/login.html", data)
----

wget (Drew)
-----
wget -O - --no-check-certificate --post-data='username=My1337UID&password=My1337Password&buttonClicked=4&redirect_url=https://mywireless.uoguelph.ca/fs/customwebauth/postlogin.html?redirectUrl=&err_flag=0' "https://mywireless.uoguelph.ca/login.html" > /dev/null
-----
run this as a /etc/network/if-up.d/ script and it will auto-log you into uog-wifi unsecure on ifup.

enjoy,

Well... it DID Work like a charm

Thanks Matt.

Although, just a thought, maybe put it in a tutorial form, step by step, like you showed me on Monday, for the rest of us linux noobies. When you have time, that is.

EDIT: It auto logged in for me in Reynolds (LOCIS), but I'm in Algorithms right now, and I had to log into this wireless signal. So I dunno if the script is broked, or if Matt and I didn't do it right, or what, but the script didn't help me here.

Randall Roberts - 3rd Year Class Rep

dlachape@uoguelph.ca's picture

Auto-Login: 1. Set up WPA to

Auto-Login:

1. Set up WPA to connect to uog-wifi-secure.
2. Log in with your Central Account.

For those of us who are super insanely concerned about security follow steps 3 and 4 below:

3. Connect to school vpn
4. Connect through school vpn to home vpn

Dave

----
"The only thing more dangerous than a hardware guy with a code patch is a programmer with a soldering iron."

WPA is very nice if you can

WPA is very nice if you can get it working. If you are under windows, i would reccomend WPA, as it is very nice.

with the quality of WPA support for linux, i would still sujest automating the login to uog-wifi. i will update my post to make it a little more friendly.

------
Matt Englert
SOCIS System Admin

WPA in Linux

How about a WPA tutorial then? or a link to it?

(I'd look it up and do it myself right now, but Im currently procrastinating on my Algos assignment)

EDIT: I've now created a new thread on how to do it.

Randall Roberts - 3rd Year Class Rep

bondg@uoguelph.ca's picture

This one checks for a uog SSID

The scripts at the head of the thread are all very well and good, but I connect to more than one wireless network, so I don't always want it to log in.

Here's one that checks for a uog wifi name, and then connects. It also then queries another webpage since at least on my machine, things other than web pages don't work until you've loaded at least one page after logging in (like email and whatnot). Don't forget to actually enter your username and password in where appropriate

#!/bin/bash
ESSID=`iwgetid>/dev/null | awk 'BEGIN {FS="\"" } /ESSID/ {print $2}'`
if [ $ESSID=uog-wifi ]; then
wget -O /dev/null --no-check-certificate --post-data='username=MYUSERNAME&password=MYPASSWORD&buttonClicked=4&redirect_url=https://mywireless.uoguelph.ca/fs/customwebauth/postlogin.html?redirectUrl=&err_flag=0' "https://mywireless.uoguelph.ca/login.html" > /dev/null
wget -O /dev/null "http://www.google.ca/" > /dev/null
fi

Edit: Nevermind, the second wget isn't fixing the first redirection like I thought it would. Any suggestions, anyone?
-----
These are your father's parentheses. Elegant weapons, for a more... civilized age.

yea, the login redirect is a pain

yea, the login redirect is a pain. here is my quick hack:


#! /usr/bin/python
import urllib
import re
username = "your_username"
passwd = "your_passwd"
data = urllib.urlencode({ "buttonClicked" : "4", "redirect_rul" : "http://www.uo guelph.ca", "err_flag" : "0" , "username" : username , "password" : passwd} )
back = urllib.urlopen("https://mywireless.uoguelph.ca/login.html", data)
# redirect hack
back = urllib.urlopen("http://www.google.ca").read()
authrf = re.findall("='https.*ca",back)
if len(authrf) > 0: back = urllib.urlopen(authrf[0][2:]).read()

dose not check the ESSID though,

------
Matt Englert
SOCIS System Admin

aberry@uoguelph.ca's picture

And for getting around NAC

Here is the wget line:

wget -O - --no-check-certificate "https://nac1.net.uoguelph.ca/auth/perfigo_weblogin.jsp?cm=ws32vklm&uri=http%3A%2F%2Fwww.google.com%2F" > /dev/null

You might have to change the cm parameter. I have it fire via LocationChanger on OS X and it works like a charm.

--
Andrew

dose this clear the web

dose this clear the web redirect?

------
Matt Englert
SOCIS System Admin

bondg@uoguelph.ca's picture

Been sick, and haven't been

Been sick, and haven't been back to campus to test it since Tuesday.
-----
These are your father's parentheses. Elegant weapons, for a more... civilized age.

bondg@uoguelph.ca's picture

Seems to have worked with

Seems to have worked with that new line, although I have only tried once so far.
-----
These are your father's parentheses. Elegant weapons, for a more... civilized age.

aberry@uoguelph.ca's picture

It does for me. -- Andrew

It does for me.

--
Andrew

bondg@uoguelph.ca's picture

WPA Connection on Ubuntu 8.04?

Bumping this quickly because since the release of 8.04 I've been unable to connect to the uog-wifi-secure network... maybe someone can give my settings a quick once-over and suggest something?

Network manager lists my settings as the following:

Name: uog-wifi-secure
bssid: 00:17:94:FE:46:F0, 00:14:A9:F5:FD:D0
Security: WPA2 Enterprise
EAP Method: PEAP
Key Type: AES-CCMP
Phase2 Type: MSCHAPV2
Identity: (my CCS login name)
Password: (my CCS password)
Anonymous ID: (blank)
Client Certificate File: (blank)
CA Certificate File: ThawtePremiumServerCA.cer (downloaded from Thawte's site)
Private Key File: (blank)
Private Key Password: (blank)

Those all seem correct to *me* but I'm still not able to connect to the network. Any advice?

aberry@uoguelph.ca's picture

I was connected to the WPA

I was connected to the WPA network on Ubuntu yesterday, with both 8.04 and 8.10. I didn't bother downloading a CA Certificate file, though that's probably a good idea. Actually, aren't those certs included in the system anyways?

I don't have the machine in front of me, but from memory all of those settings look good.

--
Andrew

Edit: Oh, and talk about resurrecting a thread from the dead. Perhaps next time just post a new thread? :)

I'll help raise this from

I'll help raise this from the dead. I'm also having trouble with getting WPA2 to work with Hardy. My settings pretty much match bondg's. I also can't get my N95 to connect either with similar settings. I did the password change thing and I can connect in XP, but that's not helping much. I just keep getting EAP-PEAP authentication errors :( Could you list your settings aberry?

aberry@uoguelph.ca's picture

Sorry, I no longer have the

Sorry, I no longer have the machine, but I just used the GUI. I think I selected WPA2 enterprise, put in my user name and password, and really, that was it.

--
Andrew

Got it working

I Finally got it to work on ubuntu and my n95. I set the Network Manager connection to:

Name: uog-wifi-secure
bssid: --blank--
Security: WPA2 & Enterprise
Authentication: PEAP
Anonymous Identity: CCS username
CA Certificate: Thawte_Premium_Server_CA.pem (under /etc/ssl/certs/ in ubuntu)
PEAP Version: Version 0
Inner Authentication: MSCHAPv2
User Name: CCS username
Password: CCS password

Make sure you also 'synchronize' your password beforehand by running https://www.uoguelph.ca/ccs/apps/password/change/ . You can change your password to your current password which synchronizes the central login id with the fileservers or something like that.

bondg@uoguelph.ca's picture

I had the same experience a

I had the same experience a couple of weeks after I posted that, where I tried again and it just worked.

Maybe there was some issue with the secure network on CCS's end?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.