**Level Information**
> [!important] There is a setuid binary in the homedirectory that does the following: it makes a connection to localhost on the port you specify as a commandline argument. It then reads a line of text from the connection and compares it to the password in the previous level (bandit20). If the password is correct, it will transmit the password for the next level (bandit21).
>
> **NOTE:** Try connecting to your own network daemon to see if it works as you think
>
>
>
> **Commands you may need to solve this level:**
>
> - ssh, nc, cat, bash, screen, tmux, Unix ‘job control’ (bg, fg, jobs, &, CTRL-Z, …)
This one took me a while to figure out as I had not used `netcat` before.
In this instance `netcat` can be used to open a listening port as well as more.
To test this I created a listening port on port `1234` and then used the `netstat` command on another terminal to confirm that the port was open.
![[Level 20 - 21.png]]
Additionally, with some prior knowledge of background jobs, I know you can create a job or process to run in the background by using the `&` at the end of a command.
We can echo this password to the command line and then send that to the `netcat` command to work in the background.
![[Level 20 - 21-1.png]]
Using the `suconnect` binary we can use it to connect to the listening port we opened using the background process.
Bingo.
![[Level 20 - 21-2.png]]