CTF Challenges exploitation netcat tutorial

Sedna VM – Walkthrough

Hi Friends,

Today we will solve the Vulnhub VM Sedna

Firstly, I need to detect the VM ip address, I will be using netdiscover command from Linux

netdiscover -r

Now we got Target IP address – Sedna VM (Target Machine) – Kali Linux (Attacker Machine)

First I will do the Port scan by using nmap to find the open ports, by using port 8080 we confirmed tomcat is running on target machine

To gather more information about the target I will be using nikto,

and we got some juicy info like /files, /system and /licence.txt, if we read carefully licence.txt we came to know that it is running “BuilderEngine”

I searched in exploitdb by using searchsploit tool for builderengine and found Arbitrary File Upload exploit exists

I used exploit and uploaded PHP reverse shell on target machine

To see the uploaded file, go to target machine/files/ you will be seeing rshell.php

Start netcat in kali Linux terminal, and click on the rshell.php

nc -lvp 4444

now shell is open, to get the bash use command “python -c ‘import pty;pty.spawn(“/bin/bash”)'”

and found first flag in flag.txt

Then next part is local privilege escalation

For this I used popular Linux dirtycow exploit from https://www.exploit-db.com/exploits/40839/

I compiled the exploit as per instructions and run the exploit with password as password

SSHed the target machine by using firefart user with password as password

to make shell stable run “echo 0 > /proc/sys/vm/dirty_writeback_centisecs”

now I become root of the target machine and can see the next flag

Leave a Reply

Your email address will not be published. Required fields are marked *