ZenPhoto Writeup - Proving Grounds
Created October 8, 2026 • Last updated October 8, 2026 • 2 min read
ZenPhoto runs an outdated Zenphoto gallery with a public remote code execution exploit, giving a shell as www-data. The host’s equally old kernel is vulnerable to a local privilege escalation in the RDS protocol, which hands over root.
Reconnaissance
Nmap
Scan all ports, then fingerprint the open ones.
PORT STATE SERVICE 22/tcp open ssh 23/tcp open telnet 80/tcp open http 3306/tcp open mysql
Explain command
| -p- | Scan all 65535 TCP ports. |
22/tcp open ssh OpenSSH 5.3p1 Debian 23/tcp open ipp CUPS 1.4 80/tcp open http Apache httpd 2.2.14 (Ubuntu) 3306/tcp open mysql
Explain command
| -A | Enable OS detection, version detection, script scanning and traceroute. |
Port 23 is actually CUPS, not telnet. Brute force the web server’s directories.
Directory discovery
Brute force directories.
==> DIRECTORY: http://$TARGET_IP/test/
/test/ hosts an instance of Zenphoto.
<!-- zenphoto version 1.4.1.4 [8157] (Official Build) -->
Zenphoto 1.4.1.4 has a known public remote code execution exploit.
Exploitation
Zenphoto RCE
Run the public exploit against the install path.
zenphoto-shell# id uid=33(www-data) gid=33(www-data) groups=33(www-data)
Code execution as www-data through the exploit’s own pseudo-shell. Upgrade to a full reverse shell by downloading and running a staged ELF payload.
Set up the Metasploit handler, then execute the payload.
meterpreter > getuid Server username: uid=33, gid=33, euid=33, egid=33
Shell as www-data. local.txt is readable from here.
Privilege Escalation
Kernel exploit (CVE-2010-3904)
Check the kernel version.
Linux offsecsrv 2.6.32-21-generic #32-Ubuntu SMP i686 GNU/Linux
This kernel is vulnerable to CVE-2010-3904, a privilege escalation in the RDS protocol handler. Compile the public exploit for 32-bit and host it.
Download and run it on the target.
[*] Linux kernel >= 2.6.30 RDS socket exploit [*] Resolving kernel addresses... [*] Overwriting security ops... [*] Got root! # whoami root
The RDS kernel exploit gives a root shell.
Related
References
-
Zenphoto <= 1.4.1.4 remote code execution exploit.
-
Linux kernel RDS protocol privilege escalation.