Simon McCabe

WAPT. OSCP. OSWP. PGCert. BSc. Linux+. Security+.

cloud cloud
Home HackTheBox TryHackMe Vulnhub General Security Quick Links About Me

...Sumo Writeup...

vulnhub

1. Enumeration

Nmap didn't produce much of interest. Nor did dirbuster. I decided nikto would be the next best option, so I pointed it at the target:

vulnhub

An uncommon-header was found, and with it finding a cg-bin path....could it be? Shellshock?

vulnhub

Exploitation

You're damn right! Well, I was damn right. It was indeed, shellshock. I exploited it using curl and got a reverse shell:

vulnhub

Next up, I figured I'd look for a SUID exploit. They seem to be on pretty much every single CTF/vulnerable machine right now. Well, it didn't look like that was the case! Great! I looked at the kernel in use:

vulnhub

As expected, it was vulnerable to privilege escalation using the perf_swevent_init local root exploit, which looked to be from 2014, just like shellshock.

vulnhub

Privilege Escalation

I'll save you some time here - I couldn't get gcc working, nor could I seem to get a tty shell. I created an elf file which would connect back to my attacking VM.

vulnhub

I set up a handler on my attacking VM:

vulnhub

Now all I needed to do was run the elf file on the target:

vulnhub

This is where things got a bit complicated. The exploit STILL wouldn't run. I got an error message which complained about gcc. This may have been an unintentional issue with the VM, as some folks reported theirs worked ok. Either way, some kind chap over at Reddit shared the fix for gcc here. The following will set the appropriate gcc path:



            export PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6:$PATH

        

Once the gcc path issue was resolved, the exploit would now run and we were now running as root:

vulnhub

From here, I grabbed the root flag, and that, as they say, was that!

vulnhub

Another fun VM by SunCSR - with a bit of a twist, rather than the usual suid. Thanks SunCSR Team for the challenge!

Go to top

linkedin twitter youtube
Valid XHTML 1.0!

© 2020 Simon McCabe - 7s26simon.github.io