Bait A Phish
Bait A Phish
Security Pulse
tutorial · bandit

Bandit Level 21

Use a setuid connector binary + a local listener to receive the next password.
banditsetuidnclocalhost
Narration (cached)
Marks this level complete in your browser.

Goal

There is a setuid binary in your home directory that:

  1. connects to localhost:<port-you-supply>
  2. reads one line from that connection
  3. compares it to the previous password (bandit20)
  4. if correct, sends back the password for bandit21

Hints

Solution (click to reveal)
  1. SSH in:
ssh bandit21@bandit.labs.overthewire.org -p 2220
  1. In terminal A, start a listener on some high port (example 44444):
nc -l 44444
  1. In terminal B (another SSH session), run the setuid program and point it at your listener port:
./suconnect 44444
  1. Now go back to terminal A (the listener). Paste the bandit20 password and press Enter.

The setuid binary should send back the password for Level 22.

Notes

Bandit Level 20Bandit Level 22