Sitemap

TryHackMe: Agent Sudo writeup

3 min readSep 9, 2026

--

room link: https://tryhackme.com/room/agentsudoctf

Task 1: Enumeration

1. How many open ports?

Press enter or click to view image in full size

3

2. How do you redirect yourself to a secret page?

Press enter or click to view image in full size

user-agent

3. What is the agent name?

Chris

Got stuck, didn’t know what to look for. Got a hint:

Press enter or click to view image in full size

In the networks tab, changing the value of User-Agent to C.

Press enter or click to view image in full size
Press enter or click to view image in full size
what the get request looks like

This leads to...

Press enter or click to view image in full size

Task 2: Hash Cracking and Brute-force

1. FTP password

crystal

Press enter or click to view image in full size

Let’s use these credentials.

Press enter or click to view image in full size

Getting these files...

Press enter or click to view image in full size

note: to escape- !

Press enter or click to view image in full size

Clearly hinting to steganography.

Get cracka_xss’s stories in your inbox

Join Medium for free to get updates from this writer.

Extracting Hidden Files:

Press enter or click to view image in full size

the other filed didn’t have anything. So.... We get a zip file. Let’s prepare and use John for the password.

Zip password:

Press enter or click to view image in full size
(ignore lz typo)
Press enter or click to view image in full size

There, our password is alien.

Now that we have the password, let’s go ahead and see what’s in the zip file.

Press enter or click to view image in full size

Steg password

Decoding that with base 64 gives us Area51.

using that password...

Press enter or click to view image in full size

Here, we get the other two flags.

3. Capturing the user flag

Using those SSH credentials...

Press enter or click to view image in full size

4. Privilege Escalation

upon some investigations...

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

So, running ‘sudo -u#-1 /bin/bash’ should give us root access.

Press enter or click to view image in full size
notice how user changed from james to root
Press enter or click to view image in full size

--

--