Welcome to the expanded SSH Lab. This progressive challenge tests your skills in web exploitation, credential harvesting, lateral movement, and privilege escalation.
- Start the Lab:
docker compose up --build -d
- Access the Dashboard: Open
http://localhost:8080. - Ports exposed:
8080: Dashboard8001: Server 1 (WebShell - Vulnerable App)2201: Server 1 (SSH)2202: Server 2 (SSH)2203: Server 3 (SSH)2204: Server 4 (SSH - The Core)
- Web: Access
http://localhost:8001. This is a real interactivettydterminal. - Goal: Find credentials for SSH Access.
- Execution:
- You are logged in as
webuser. - Find
LEVEL1_PASSWORDin the hidden.envfile (cat ~/.env). - Use this password to SSH into
localhost:2201aslevel1. - Once logged in via SSH, find
id_rsainlevel1's.sshdirectory.
- You are logged in as
- Connect:
ssh -i id_rsa level2@localhost -p 2202 - Goal: Find the hidden key for Server 3.
- Execution:
- Check
.bash_historyfor clues. - Recover key from
/var/backups/.secret.key. - Clue: Notice the
.ssh/configfile which shows thatlevel2was connecting toserver-3. - Bonus: The
.ssh/known_hostsis already pre-configured forserver-3.
- Check
- Connect:
ssh -i server3_key level3@localhost -p 2203 - Goal: Find credentials for Server 4.
- Execution:
- Analyze
connect_db.pyscript in the home directory. - Extract
level4credentials (purple_unicorn_42).
- Analyze
- Connect:
ssh level4@localhost -p 2204 - Goal: Escalate to Root.
- Execution:
- Run
sudo -l. - Exploit
sudo vimto spawn a root shell (:!/bin/sh). - Capture the flag in
/root/flag.txt.
- Run
docker-compose down