Monday, December 8, 2014

Bandit Level 14 to Level 15

Submitting a password to a port.
 
Host name is bandit.labs.overthewire.org 
User: bandit14
password: 4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e


Goal: The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost.

Commands used for this level:
echo - display a line of text
nc - arbitrary TCP and UDP connections and listens (nc is short for netcat)
 
Step 1.
We need to somehow submit our current password to port 30000.
First lets check man page on echo.
Type man echo
We see that the echo command will echo the STRING(s) to standard output.
What we can do is use that to send our password by piping it to a command that will allow us to connect to a local port.
Port's use TCP or UDP to establish connections and it just so happens Linux has a tool to do that called netcat. Lets check the man page for netcat.
Type man nc
The very first line in the description says that netcat utility is used for just about anything under the sun involving TCP, UDP. Wow that sounds perfect for what we want to do. We also know we need to connect to localhost at port 30000, we have everything for our full command. We will echo our password and pipe the output to netcat and tell netcat to connect to localhost at port 30000.
Type echo 4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e | nc localhost 30000 and our password is given to us for the next level: BfMYroe26WYalil77FoDi9qh59eK5xNr

2 comments:

  1. no me funciona me sale lo siguiente alguien me puede a yudar
    localhost [127.0.0.1] 30000 (?) : Connection refused

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete