Bait A Phish
Bait A Phish
Security Pulse
tutorial · bandit

Bandit Level 20

Use a setuid helper binary to read the next password from /etc/bandit_pass.
banditsetuidprivilege
Narration (cached)
Marks this level complete in your browser.

Goal

There is a setuid binary in your home directory.

Run it (without arguments) to learn how to use it. After using it correctly, you can read the next password from the usual place (/etc/bandit_pass).

Hints

Solution (click to reveal)
  1. SSH in:
ssh bandit20@bandit.labs.overthewire.org -p 2220
  1. List files and identify the setuid binary:
ls -la
  1. Run it with no args to see usage:
./bandit20-do
  1. Use it to run cat as the privileged user:
./bandit20-do cat /etc/bandit_pass/bandit20

The output is the password for Level 21.

Notes

Bandit Level 19Bandit Level 21