Box Stats
Box Info | Details |
---|---|
Box Name : | DC 1 |
Series : | DC |
Difficulty : | Easy |
Release Date : | 28 Feb 2019 |
OS : | GNU/Linux |
Maker : | DCAU |
Download : | DC 1 |
Recommended : | Yes ![]() |
Summary
Hello all, i’ve been away from CTFing all this period so i decided to warmup a bit with an old box. DC series is pure gold! It’s all about exploiting a vulnerable drupal version and the privesc is a simple SUID binary exploitation. Let’s pwn it!
PoC
Target IP
Always first step is to find target IP address, i prefer to use the arp-scan
utility. Then we’ll save the IP address in a variable.
1 |
|
Enumeration/Reconnaissance
Now as always let’s continue with a nmap scan.
1 |
|
Obviously, we have to deal with web exploitation. Once we visit the website we can see that is running drupal, to double check that we can use an awesome tool called whatweb
:
1 |
|
Googling around for a drupal vulnerability scanner, i found out this tool droopescan. You can simply install it using this command: pip install droopescan
. Let’s fire it up(takes some time).
1 |
|
droopescan
tell us an interesting thing that drupal version is 7.x. So we’ll continue by searching possible exploits on 7.x version using searchsploit
.
Shell as www-data
1 |
|
Bingo! We’ve a RCE exploit the famous Drupalgeddon
. I’ll use the MSF way for faster.
1 |
|
Shell as root
Privilege escalation is root is simple, we just have to search for SUID binaries & exploit find.
1 |
|
1 |
|
Reading the flag(s)
1 |
|
Analyze metasploit module using burp suite
For beginners burp suite is a web penetration testing framework, burp suite works as a proxy. We route the traffic through the burp suite proxy server.
A proxy server acts as a gateway between you and the internet. When we send a HTTP request, your request goes to the proxy server first. The proxy server then sends your HTTP request to the server, collects the response from the web server, and forwards you the web page.
To understand what metasploit does in the background, we’ll set a proxy.
I made a diagram with photoshop, so you will understand what we’re doing now.
First let’s terminate our current session.
1 |
|
Now we’ll check the advanced options of the module & set the proxy.
1 |
|
1 |
|
You can analyze now what metasploit is doing step by step:
Thank You
Thank you for taking the time to read my writeup. If you don’t understand something from the writeup or want to ask me something feel free to contact me through discord(0xatom#8707) or send me a message through twitter 0xatom
Until next time keep pwning hard!