Files
ctf/basically gambling/getflag_b46.sh
Jan Groß 954be5967d Fixed GetFlag script for basically gambling
The script now connects to the live server on port 6646
Netcat required a timeout on some systems or the connection won't terminate automatically, causing the
GetFlag script to be stuck at attempt one forever.
2018-09-19 21:37:50 +02:00

15 lines
311 B
Bash
Executable File

#!/bin/bash
echo "Attempting to get flag..."
ATTEMPT=1
while :;
do
echo "Attempt ${ATTEMPT}..."
ATTEMPT=$[ATTEMPT + 1]
RESULT=$(nc ctf.minzkraut.com 6646 -w2 | base64 -d | strings | grep "MNZ{")
if [[ $RESULT ]]; then
echo "Found the flag"
echo $RESULT
break
fi
done