Skip to content

Instantly share code, notes, and snippets.

@joshrendek
Created January 28, 2009 18:02
Show Gist options
  • Save joshrendek/54105 to your computer and use it in GitHub Desktop.
Save joshrendek/54105 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import urllib2, urllib, socket
username = 'USERNAME'
password = 'PASSWORD'
ip = socket.gethostbyname(socket.gethostname())
gateway = ip.split('.')
gateway[3]='1'
gatewayip = gateway[0:4]
gate_ip = ".".join(gatewayip)
gatesip = "http://",gate_ip,"/login.pl"
g = "".join(gatesip)
login = urllib.urlencode({'customlogin': 1, '_FORM_SUBMIT': 1, 'which_form': 'reg', 'destination': '', 'error': '', 'source': '128.186.232.83','SUBMIT': 'Log In', 'bs_name': username, 'bs_password': password});
e = urllib2.urlopen(g, login)
print "Tried...",g
#print f.read();
print "Logged in!"
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment