← All writeupsCase 10 · Filed 25 Oct 2026 · HackTheBox · 6 min read
Monitors
Rooted
Hard Linux box: LFI to Cacti RCE, then an OFBiz container escape via CAP_SYS_MODULE
Evidence photo — case 10
Machine Overview
Monitors is one of those boxes where no single bug is exotic, but the chain is long and every link is a lesson in trusting the wrong thing. It starts with a WordPress site running an abandoned plugin that hands me arbitrary file read. That leak points me at a hidden Cacti install and a database password that — of course — gets reused. Cacti 1.2.12 drops me to www-data through an authenticated SQLi-to-RCE, a backup script coughs up the password for marcus, and then the real fun begins: a Docker container running Apache OFBiz that's both unauthenticated-RCE-able and handed CAP_SYS_MODULE, which is basically a gift card for host root.
Attack chain
Recon → WordPress on monitors.htb, direct-IP access blocked.
Foothold → WP with Spritz plugin LFI → read /etc/passwd, the Apache vhost config, and wp-config.php.
User (pt.1) → reuse the WordPress DB password on Cacti admin → CVE-2020-14295 SQLi→RCE → shell as www-data.
User (pt.2) → cacti-backup.service points at a readable backup script with marcus's password → SSH.
Root → OFBiz 17.12.01 deserialization RCE (CVE-2020-9496) → root inside a container → CAP_SYS_MODULE kernel-module load → root on the host.
Hitting the IP straight gives me a 403 that politely tells me the vhost it wants — and leaks an admin email while it's at it:Direct IP access blocked, revealing admin@monitors.htbSo I add the host and move on:
Bash
echo "10.129.235.40 monitors.htb" | sudo tee -a /etc/hosts
monitors.htb is a WordPress blog — "Welcome to Monitor", Iconic One theme. Taking hardware monitoring seriously, apparently.WordPress blog at monitors.htb
Foothold — WP with Spritz LFI
Spotting the plugin
I always let DevTools tell me what a WordPress site is actually loading. Here the Network and Sources panels light up with the WP with Spritz plugin (wp-with-spritz, v1.0):WPSpritz.js loaded from the wp-with-spritz pluginwp-with-spritz plugin tree in the Sources panelThat plugin has a known LFI/RFI in wp.spritz.content.filter.php via the url parameter — it'll happily include whatever path I give it. First thing I always read:
GET /wp-content/plugins/wp-with-spritz/wp.spritz.content.filter.php?url=../../../../..//etc/passwd
/etc/passwd returned through the LFIConfirmed file read. Now the question is what to read next.
Chasing the hidden vhost
The /etc/passwd output only lists marcus as an interesting user, so I go hunting through config instead of users. The Apache default site config is the gift that keeps giving:
GET /wp-content/plugins/wp-with-spritz/wp.spritz.content.filter.php?url=../../../../..//etc/apache2/sites-enabled/000-default.conf
Apache vhost config referencing cacti-admin.monitors.htbThere it is — a second vhost I had no way of guessing:Add monitors.htb.conf / Add cacti-admin.monitors.htb.conf
Bash
echo "10.129.235.40 cacti-admin.monitors.htb" | sudo tee -a /etc/hosts
Looting wp-config.php
Before I touch Cacti, I grab the WordPress DB creds — passwords here love to travel:
GET /wp-content/plugins/wp-with-spritz/wp.spritz.content.filter.php?url=../../../../..//var/www/wordpress/wp-config.php
cacti-admin.monitors.htb is running Cacti 1.2.12. On a hunch I try the WordPress DB password against the Cacti admin user, and it just works:
admin : BestAdministrator@2020!
Reusing creds across a WordPress DB and a Cacti admin panel is exactly the kind of thing this box wants me to notice.
CVE-2020-14295 — SQLi that turns into a shell
Cacti 1.2.12's color.php takes an injectable filter parameter, and since the backend allows stacked queries, that SQLi folds neatly into command execution. The public PoC (EDB-49810) automates the whole dance — auth, inject, pop a shell:
OFBiz's /webtools/control/xmlrpc endpoint deserializes attacker XML with zero authentication — textbook CommonsBeanutils1 ysoserial territory.One detail that cost me time and is worth calling out: OFBiz 17.12.01 is a Java 8 app, and the CommonsBeanutils1 gadget only serializes cleanly under JDK 8. My box runs JDK 17, which throws InaccessibleObjectException the moment ysoserial tries to reflect into the gadget. The fix is just to generate the payloads inside a Java 8 environment — a throwaway Temurin 8 container with host networking so it can still reach my tunnel:
This is the whole ballgame. CAP_SYS_MODULE lets a process call init_module()/finit_module() — load a kernel module. And a module's init function runs in the host kernel, not the container's. So a one-line call_usermodehelper() inside the module executes as real root on the host. The container walls mean nothing when you can speak directly to the host kernel.The annoyance: no gcc, no make, no insmod in the container. But it does ship the matching kernel headers, so I just build elsewhere and bring the pieces in.
Build off-box, deliver in
Compile the module against the exact 4.15.0-151 headers in a disposable Ubuntu 18.04 container (so the vermagic matches and insmod won't reject it):
The instant the module loads, the host phones home as root:
Connection received on 10.129.235.40 41614
123deddd...REDACTED...5d3b
🏁 root.txt — host fully owned, straight out of the kernel. Flag trimmed per convention.Tidy up after myself so the box isn't left with a rogue module loaded:
That "low-impact" file read was the whole box — it leaked a hidden host, config, and the password that bootstrapped everything. Kill abandoned plugins.
One password spanned the WordPress DB and the Cacti admin panel. Unique secrets per service, every time.
Secrets hardcoded in a script that a service account can read is how www-data became marcus.
CAP_SYS_MODULE on a container is equivalent to host root. Drop capabilities by default; this one should never be granted to an app container.