Agent Sudo Challenge

Hi everybody! I am back with yet another CTF Challenge.

You all can try this challenge at https://tryhackme.com/room/agentsudoctf .

Let's Begin.

1. we have to enumerate the given Vm link to find how many service ports are open.

Nmap results will give you the no of open ports.

2. Now we have to redirect ourself to a secret page. if you visit the site it says that you have to use your own agent and the hint tells us to use agent C.

we can change our web browser agent through Dev tools or using external plugins from web store.

3. Now load the main page again and you will get a message.

4. Now we know the username and we also now he has a weak password. In nmap scan we found that a ftp port is open. we can use hydra on this port to find Chris's password.

Boom! we found his password.

5. login using ftp and list the directory. we find 3 files .

6. Download these files.

7. There is a message in To_agentJ.txt .

It says that the login password is in the fake pic's. This clearly indicates to use of Steganography.

8. using steghide we see that we need a passphrase to extract info from cute-alien.jpg , this password must be hidden in cutie.png . we use binwalk for this.

the scan shows a hidden zip file. use binwalk to extract it.

zip file is password protected. It's time to use Jtr.



using this extract To_agentR.txt.

this message gives us a base64 encoded message. converting it we get.

This is the password to steg file cute-alien.jpg



The message.txt reads:

Now we know the names of 2 agents and James ssh login password.

login using this password.

listing the directory you can find user-flag.txt .

you can download the picture through scp and using reverse image search find out about the event.

Now it's time for privesc . type sudo -l to know what your user can do.

we see that we cannot run /bin/bash command as root. googling about this gave us the exploit.

use this exploit to become root.

yay ! we did it.

So long! everybody.


Comments

Post a Comment

Popular posts from this blog

MetaCTF 2020 writeup

Mr. Robot Walkthrough