PG: Shenzi
| ターゲット // Shenzi | |
|---|---|
| Platform | OffSec Proving Grounds |
| OS | Windows |
| Difficulty | Medium |
| IP | 192.168.243.55 |
Enumeration#
Nmap#
▶ Nmap output
PORT STATE SERVICE VERSION
21/tcp open ftp FileZilla ftpd 0.9.41 beta
80/tcp open http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
443/tcp open ssl/http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
445/tcp open microsoft-ds
3306/tcp open mysql MariaDB (host not allowed)
5040/tcp open unknown
Windows 10 box with an Apache/PHP stack on 80/443, FileZilla FTP, SMB, and a MariaDB that refuses remote connections. FTP rejects the obvious weak creds and MySQL is locked to localhost, so the two live doors are SMB and the web server.
Port 445 - SMB#
SMB allows a null/guest session. Mapping the shares surfaces a non-default Shenzi share that’s world-readable:
| |
Pull everything out of it with a null-session smbclient:
| |
Most of the loot is noise, but one config file leaks WordPress credentials — and the password format (FeltHeadwallWight357) screams OffSec-generated:
admin:FeltHeadwallWight357
Port 80/443 - Web#
The web root doesn’t obviously advertise WordPress, so it’s hiding on a path. Fuzzing with a cewl-generated wordlist works, but the fast path on OffSec is to just try the machine name:
https://192.168.243.55/shenzi/
That lands on the WordPress install the SMB creds belong to.
Foothold#
WordPress Theme Editor RCE#
Log into wp-login.php with admin:FeltHeadwallWight357. With admin access, the Appearance → Theme Editor turns into a code-execution primitive: overwrite a rarely-touched template in the active theme with a PHP webshell.
| |
Drop that into 404.php of the twentytwenty theme. Site Health → Info confirms the theme path, then hit the poisoned file directly:
https://192.168.243.55/shenzi/wp-content/themes/twentytwenty/404.php?cmd=whoami
Command execution confirmed. Upgrade to a full reverse shell with a PowerShell one-liner (listener on 80):
| |
Shell as the low-privileged web user.
Privilege Escalation#
AlwaysInstallElevated#
Running PowerUp / winPEAS flags the classic AlwaysInstallElevated misconfiguration — when both registry keys are set, any .msi runs as SYSTEM:
| |
Both return 0x1, so build an MSI reverse-shell payload:
| |
Upload it to the target and fire it through msiexec with a listener waiting:
| |
The installer executes with elevated privileges and the callback lands as nt authority\system.
Proof#
Both flags and SYSTEM from a single shell:

Key Takeaways#
- Always enumerate SMB with a null/guest session — a single readable non-default share (
Shenzi) handed over the WordPress admin password. - OffSec loves hiding web apps on a path named after the box. When the root looks empty, try
/<machine-name>/before burning time on a full dir-bust. - WordPress admin access is RCE: the Theme Editor lets you plant a PHP webshell in any template (
404.php) of the active theme. - When both
AlwaysInstallElevatedkeys are0x1, anmsfvenomMSI run viamsiexec /iis a straight shot to SYSTEM.