Ochima Writeup - Proving Grounds
Created October 8, 2026 • Last updated October 8, 2026 • 2 min read
Ochima runs Maltrail 0.52, a malicious-traffic detection tool vulnerable to CVE-2023-27163, an unauthenticated command injection in its login endpoint. The resulting shell escalates to root through a world-writable backup script a root cron job executes.
Reconnaissance
Nmap
Full TCP port scan with service detection.
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 80/tcp open http Apache httpd 2.4.52 (Ubuntu) 8338/tcp open http Maltrail 0.52
Port 8338 runs Maltrail 0.52. Its /login endpoint accepts a POST username parameter known to be vulnerable to CVE-2023-27163, an unauthenticated OS command injection where the value is passed unsanitized to a subprocess.
Exploitation
Maltrail login command injection (CVE-2023-27163)
Base64-encode a Python reverse shell to avoid special-character issues in the injection.
<base64 payload>
Start a listener, then fire the payload into the username parameter.
The injection fires and a reverse shell connects back as snort. Stabilize it.
snort@ochima:~$
Privilege Escalation
Writable cron backup script
An etc_backup.tar artifact in the home directory hints at an automated backup. Search for the script that produces it.
/var/backups/etc_Backup.sh
The script is world-writable and runs periodically as root.
-rwxrwxrwx 1 root root 142 Jan 1 2023 /var/backups/etc_Backup.sh
Append a reverse shell and catch it on a second listener.
connect to [$ATTACKER_IP] from (UNKNOWN) [$TARGET_IP] # id uid=0(root) gid=0(root)
Within a minute the cron job fires and a root shell connects back.
Related
References
-
Maltrail <=0.53 unauthenticated OS command injection via the login username parameter.