ExGhost Writeup - Proving Grounds
Created October 8, 2026 • Last updated October 8, 2026 • 3 min read
ExGhost locks down both its services until a default-credential brute force against FTP succeeds. A captured PCAP in the retrieved file reveals a hidden upload endpoint running a vulnerable ExifTool, giving a www-data shell via a crafted image upload, and an outdated PolicyKit lets PwnKit finish the job as root.
Reconnaissance
Nmap
Scan all ports with version detection.
21/tcp open ftp vsftpd 3.0.3 80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
HTTP returns 403 Forbidden at the root with no index file, and dirsearch only turns up an empty, forbidden /uploads/. Anonymous FTP login fails and there is no version-specific vsftpd exploit, so both services look locked down by design.
Exploitation
FTP default-credential brute force
Brute force FTP against a default-credential list rather than rockyou.
[21][ftp] host: $TARGET_IP login: user password: system
Explain command
| -C | Colon-separated user:pass combo list instead of separate -l/-P lists. |
Log in with user:system and pull everything off the share.
backup 100% transferred
Always check the file type before trusting a name or extension.
backup: pcap capture file, microsecond ts (little-endian)
PCAP analysis
Open the capture in Wireshark, filter on http, and follow the HTTP streams. That reveals a hidden upload endpoint, POST /exiftest.php, a form field named myFile, and the server-side tool version: ExifTool 12.23.
ExifTool RCE (CVE-2021-22204)
ExifTool 12.23 executes embedded Perl code from crafted DjVu metadata. Generate a malicious image and start a listener.
image.jpg
Upload the image to the hidden endpoint using the correct field name to trigger the RCE.
The listener catches a shell as www-data. Stabilize it.
Privilege Escalation
PwnKit (CVE-2021-4034)
Check PolicyKit's version and pkexec's permissions.
Installed: 0.105-26ubuntu1.1 -rwsr-xr-x 1 root root 36248 /usr/bin/pkexec
Vulnerable, and there is no gcc on the target, so use the Python port of the exploit.
Serving HTTP on 0.0.0.0 port 8000
# id uid=0(root) gid=0(root) groups=0(root)
Related
References
-
ExifTool arbitrary code execution via crafted DjVu metadata.
-
ExifTool 12.23 DjVu metadata RCE exploit.
-
CVE-2021-4034 (PwnKit)CVE: CVE-2021-4034 (PwnKit), nvd.nist.gov/vuln/detail/CVE-2021-4034 (opens in new tab)
Polkit pkexec local privilege escalation.