Sitemap
Fethallah Abdelkader GHELLAIMI

Fethallah Abdelkader GHELLAIMI

๐—•๐—ผ๐˜‚๐—ป๐˜๐˜† ๐—›๐—ฎ๐—ฐ๐—ธ๐—ฒ๐—ฟ ๐˜„๐—ฟ๐—ถ๐˜๐—ฒ๐˜‚๐—ฝ โ€” ๐—ง๐—ฟ๐˜†๐—›๐—ฎ๐—ฐ๐—ธ๐— ๐—ฒ

4 min readMar 4, 2026

--

Press enter or click to view image in full size

From nmap to root.
Here is my writeUp for the Bounty Hacker CTF on TryHackMe. Itโ€™s a great, quick room that covers the trifecta of pentesting: Network Scanning, Brute-Forcing, and Privilege Escalation. Perfect for beginners looking to put it all together.

#ENJOY WITH PH1X0R17

1/-Reconnaissance phase:

we will do ports scan with โ€œNMAPโ€ command

nmap @ip_target

Press enter or click to view image in full size
Ports Scan 1

The initial scan revealed that ports 21 (FTP), 22 (SSH), and 80 (HTTP) were open. With this information, I conducted a more detailed service version and default script scan using -sV and -sC flags.

Press enter or click to view image in full size
Ports scan 2

we Know the versions of all services :

  • Port 21: FTP service running vsftpd 3.0.5 (with Anonymous Login !!!!!!!!)
  • Port 22: SSH service running OpenSSH 8.2p1
  • Port 80: HTTP service running Apache 2.4.41

2/ โ€” Enumeration :

Who wrote the task list?

Great job so far, Bounty Hacker. Letโ€™s try logging in on the ftp service:

ftp @ip_target

Press enter or click to view image in full size
ftp _ ls (So we have two files)

Note:

if ftp commad do not work , switch to โ€œpassiveโ€ mode and ASCII transfer mode. then used mgetto download both files to my local machine

Press enter or click to view image in full size
download files on our machine
locks.txt
Press enter or click to view image in full size
task.txt

Analyzing the downloaded files revealed:

  • locks.txt: Appeared to be a password list containing potential credentials
  • task.txt: Contained a task list signed by a user named โ€œlinโ€โ€™

We can see that lin has written the note.

Answer: lin

we have also http port open so we will check it

Press enter or click to view image in full size
we see Users

So, I think I will put all the usernames in a file named โ€œuser.txtโ€. Iโ€™m doing this because we need to find the username and password. The syntax for SSH is like this:

ssh user@ip_target

users test

3/-Exploitation Phase:

What service can you bruteforce with the text file found?

Get Fethallah Abdelkader GHELLAIMIโ€™s stories inย yourย inbox

Join Medium for free to get updates fromย thisย writer.

This looks to be like some kind of wordlist that we can use to gain access to a server. Since we have a protected SSH access to the server I am going to guess we can bruteforce it.

Answer: SSH

What is the users password?

To bruteforce linโ€™s password we can use hydra

Press enter or click to view image in full size
Cracking the code with hydra

Answer: RedDr4gonSynd1cat3

I established an SSH connection using these credentials and successfully retrieved the first flag (user.txt)

Press enter or click to view image in full size
Logging into the SSH service and finding the flag

Answer: THM{CR1M3_SyNd1C4T3}

4/-Privilege Escalation:

For privilege escalation, I began enumerating the system. Using sudo -l, I discovered that the user "lin" could execute /bin/tar with sudo privileges without requiring a password as the root user.

Press enter or click to view image in full size
SUDO -L

I checked GTFOBins and quickly found a tar payload that worked perfectly for privilege escalation.

sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
Press enter or click to view image in full size
privilege escalation
Press enter or click to view image in full size
root.txt flag

Answer: THM{80UN7Y_h4cK3r}

Conclusion

And thatโ€™s a wrap! I hope this walkthrough was clear and helpful. Bounty Hacker was definitely on the easier side, but Iโ€™ll admit โ€” the final step took a little extra thought to figure out. Itโ€™s a good reminder that proper enumeration can make all the difference. Thanks for reading โค

โ€” ph1x0r17

--

--