Posts Tryhackme - Bounty Hacker
Post
Cancel

Tryhackme - Bounty Hacker


Bounty Hacker is a beginner level room in Tryhackme. The objective is to get the user and the root flag.


cover_image

AuthorSevuhl
DescriptionYou talked a big game about being the most elite hacker in the solar system. Prove it and claim your right to the status of Elite Bounty Hacker!.

Deploy the VM and lets go.

Enumeration


Let’s start with a nmap scan.
nmap_scan

From the nmap scan we can see that ftp Anonymous login is enabled. I checked the http service and couldn’t find anything useful. So, Login to the ftp server.
ftp_server

Found two text files. Download it using the command get file-name.

After reading the files I concluded that locks.txt is a wordlist and the username is lin.
task.txt

User flag


Let’s use what we found to bruteforce ssh using hydra.

hydra -l lin -P locks.txt ip-addr ssh


hydra

With the username and password in hand, let’s login to ssh.
user_flag
Boom!! We got the user flag.

Root flag


I used sudo -l to see if there are any files that can be run as root.
suod_check

I searched gtfobins for tar and got this.
gtfo_bins

sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh


Run the command to get the root shell. The root flag is there in the /root dir.
root_flag

Thats it folks. Happy hacking!!!

This post is licensed under CC BY 4.0 by the author.