Flimsy Writeup - Proving Grounds
Created October 7, 2026 • Last updated October 7, 2026 • 2 min read
Flimsy runs Apache APISIX 2.8 behind OpenResty on port 43500. That version is vulnerable to CVE-2022-24112, a remote code execution that gives a low-privileged shell. A root cron job runs apt-get update and /etc/apt/apt.conf.d is writable, so an APT Pre-Invoke hook runs a root reverse shell.
Reconnaissance
Nmap
Scan all TCP ports and fingerprint the services.
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 80/tcp open http nginx 1.18.0 (Ubuntu) |_http-title: Upright 3306/tcp open mysql MySQL (unauthorized) 43500/tcp open http OpenResty web app server
Explain command
| -p- | Scan all 65535 TCP ports. |
| -sCV | Run the default scripts and probe service versions. |
Port 43500 runs an OpenResty web server. A nikto scan fingerprints it as Apache APISIX 2.8, which is below 2.12.1 and vulnerable to CVE-2022-24112.
Exploitation
Apache APISIX RCE (CVE-2022-24112)
CVE-2022-24112 abuses the batch-requests plugin to bypass the admin API's IP restriction and run Lua code. Clone the public exploit, start a listener, and run it against the APISIX port.
Explain command
| -lvnp | Listen, verbose, no DNS resolution, on the given port. |
Explain command
| (args) | Target APISIX URL, attacker IP, and attacker port for the reverse shell. |
The listener catches a low-privileged shell. Upgrade to a TTY, then enumerate for privilege escalation, for example with linpeas, which flags that root runs apt-get update on a schedule and that /etc/apt/apt.conf.d is writable.
Privilege Escalation
APT Pre-Invoke cron abuse
APT runs any command in an APT::Update::Pre-Invoke hook before updating. Because the config directory is writable and root runs apt-get update on a cron, drop a hook that calls back a shell. Start a listener, then write the hook.
connect to [$ATTACKER_IP] from $TARGET_IP # id uid=0(root) gid=0(root) groups=0(root)
When the root cron runs apt-get update, the Pre-Invoke hook fires as root and returns a root shell.
Related
References
-
Apache APISIX admin API IP restriction bypass via the batch-requests plugin, leading to remote code execution.
-
APT privilege escalationLINK: APT privilege escalation, www.hackingarticles.in/linux-for-pentester-apt-privilege-escalation (opens in new tab)
Abusing APT Pre-Invoke hooks to run commands as root.