Sitemap

Bounty Hacker & Agent Sudo

Find open ports on the machine

Press enter or click to view image in full size

Who wrote the task list?

login to the FTP server as anonymous:

Here I wanted to view the files in the current directory, but it was not able to do it, to solve this issue, enter: passive

Press enter or click to view image in full size

Get the two files:

Press enter or click to view image in full size

On your local machine:

Lin

What service can you bruteforce with the text file found?

ssh

What is the users password?

We will use Hydra to brute-force Lin’s password

Syntax:

hydra -l [username] -P [password list] [target IP addr] [service]
hydra -l lin -P locks.txt 10.10.207.169 ssh
Press enter or click to view image in full size

RedDr4gonSynd1cat3

user.txt

Ssh to the target machine with the credentials we just got:

Press enter or click to view image in full size
Press enter or click to view image in full size

THM{CR1M3_SyNd1C4T3}

root.txt

View the sudo list, we have the tar command as the root user privilege:

Press enter or click to view image in full size

We can find privilege escalation method on GTFobins:

https://gtfobins.github.io/gtfobins/tar/

Press enter or click to view image in full size

enter the above command provided in GTFObins for allowing a normal user to run as a root user:

Press enter or click to view image in full size

find and print the flag:

THM{80UN7Y_h4cK3r}

Agent Sudo

Task 2 Enumerate

How many open ports?

nmap -T4 -sV -v 10.10.113.54
Press enter or click to view image in full size

3

How you redirect yourself to a secret page?

user-agent

What is the agent name?

Intercept the traffic visiting the website and change the user-agent to C:

Chris

Task 3 Hash cracking and brute-force

FTP password

Hydra can brute-force the FTP server with rockyou.txt wordlist:

hydra -l chris -P /usr/share/wordlists/seclists/Passwords/Common-Credentials/best110.txt [Your target machine ip add] ftp
Press enter or click to view image in full size

crystal

Zip file password

Get YCZHU’s stories in your inbox

Join Medium for free to get updates from this writer.

login to the FTP server as chris and get all files:

mget *.*
Press enter or click to view image in full size

view the txt file, we get the hints:

Press enter or click to view image in full size

Analyse two image files by binwalk:

Press enter or click to view image in full size

the .jpg is empty, however we got some information from .png, now we can extract the binaries in .png:

binwalk -e cutie.png
Press enter or click to view image in full size

The 8702.zip is encrypted:

Press enter or click to view image in full size

Use zip2john to crack the zip file:

Use john to crack the hash:

Press enter or click to view image in full size

alien

steg password

From this output we are revealed that the content was saved to the To_agentR.txt:

Press enter or click to view image in full size

The code ‘QXJlYTUx’ looks interesting we can try to decode it:

Area51

Who is the other agent (in full name)?

Now we have the password for the file cute-alien.jpg:

Press enter or click to view image in full size
Press enter or click to view image in full size

james

SSH password

hackerrules!

Task 4 Capture the user flag

What is the user flag?

ssh to the james account :

Press enter or click to view image in full size

What is the incident of the photo called?

Send the jpg to the local machine:

Press enter or click to view image in full size
Press enter or click to view image in full size

search for the image on google:

Press enter or click to view image in full size

Task 5 Privilege escalation

CVE number for the escalation

Display sudo version information:

sudo -V

Search for some information about the sudo 1.8.21 version:

Press enter or click to view image in full size

The highlighted price of info is what we are looking for, download the code:

Press enter or click to view image in full size

CVE-2019–14287

What is the root flag?

transport the python code form the local machine to james account:

Press enter or click to view image in full size

execute the code:

Now we are the root user, print the flag:

Press enter or click to view image in full size

b53a02f55b57d4439e3341834d70c062

(Bonus) Who is Agent R?

DesKel