Potato 1

Easy, Real life like

I have completed this in 3 steps.

  1. Enumeration: Nmap helped to get in

  2. Exploitation: Burp proxy and php vulnerability

  3. Post exploitation: Abusing admin permission

So let's talk in detail.

1. Enumeration

1) At first, I need to know the target IP, so:

and I got the IP: 10.0.2.39

2) As always I have started with all port scanning

and I have got 3 ports open:

3) Now digging deeper to those ports:

An unusual port running FTP:

4) As it has a web page, so I have started dirbuster to scan:

Running the scan
Scan result

5) Nikto scan also reveals similar info to dirbuster:

Scan report is:

6) Found /admin, /admin/index.php. These page are showing one login form.

7) Attempted to brute force or guess the password I have failed

8) Found logs.txt but nothing interesting found except - Admin has changed password.

9) After some failed attempt to brute force, I have focused on FTP. FTP login:

I have found: - anonymous login allowed - found 2 interesting files

downloaded those files:

2. Exploitation

10) From index.php.bak, I can see the source code:

11) I have tried SQL injection but failed. After some research, I have found this article about - type juggling. It helps!

12) Successfully exploited this vulnerability. I have used - password[]=""

13) Result:

14) But I am facing access denied message:

15) Other pages don't have any interesting this except the Logs. I have intercepted all the request with Burp. And I have found an interesting entry in logs. This will probably lead to LFI.

16) I have tried file=../../../../../etc/passwd

17) got = webadmin:$1$webadmin$3sXBxGUtDGIFAcnNTNhi6. Here I have used john the ripper and I have got:

  1. user: webadmin

  2. pass: dragon

18) Now login to ssh

and eventually I have found the user flag

3. Post Exploitation

19) Now I need root access. I have searched for another profile then webadmine's privilege

20) Here, webadmin cat execute /notes and anything after it. That's the key point! I have created a small shell and executed it.

21) Finally I have got root flag in /root/root.txt

bGljb3JuZSB1bmlqYW1iaXN0ZSBxdWkgZnVpdCBhdSBib3V0IGTigJl1biBkb3VibGUgYXJjLWVuLWNpZWwuIA==

Hope this write up will help you. Any feedback is appreciated

Last updated

Was this helpful?