
HTB OneTwoSeven full walkthrough: deterministic creds, chroot symlink escape, rewrite-rule bypass RCE, CVE-2024-1086 to root
A complete, end-to-end walkthrough of OneTwoSeven, a retired HackTheBox Linux machine. The full chain: deterministic credential generation → symlink escape of an SFTP chroot → vim swap file recovery → SSH port-forwarding to a firewalled admin panel → bypass of commented-out Apache RewriteRules → RCE → CVE-2024-1086 (nf_tables UAF) for root.
The hook: the "disabled" plugin upload was not disabled — the addon manager's
switchmatched onREQUEST_URI, so the active download rewrite rule could be leveraged to reach the upload code path. And the kernel exploit's deliberate post-exploitation panic forced an exfiltration-by-design payload.
94ab980a4ab2c7c1eb8c7f78334d5a5e42379deee25d3b678a7f0df5c055e888password = md5(REMOTE_ADDR)[:8], username = "ots-" + base64(pw[3:]) → every IP gets its own SFTP account, and 127.0.0.1 yields the admin's./etc/passwd → discover the admin account via its GECOS field (127.0.0.1)..login.php.swp recovered from the admin's home → panel credentials ots-admin / Homesweethome1 (SHA-256 cracked with john + rockyou).-L forwarding despite /bin/false → reach the firewalled 60080 admin panel..htaccess, but rewrite is active; the addon manager switches on → lands a PHP shell in → .README.md - this overview
WRITEUP.md - the full walkthrough (recon → user → panel → RCE → root, findings, lessons, timeline)
LICENSE - MIT
Note: the detailed walkthrough (
WRITEUP.md) is written in Spanish; the README serves as the English executive summary.
nosymlinks is decorative when a neighboring service (Apache) resolves paths outside it.env_keep in sudo -l is never decoration — if proxies are preserved, the allowed command's traffic can be MITM'd.Axel Feduzka · GitHub @dopaminauta · [email protected]
Practice walkthrough on a retired HackTheBox machine. All attacks executed in an authorized lab environment; target IPs sanitized.
Solve et Coagula — bound by EMET, driven by AHAVA.
addon-download.phpREQUEST_URIPOST /addon-download.php?x=/addon-upload.phpaddons/www-admin-dataCONFIG_NF_TABLES=m, user namespaces enabled → Notselwyn's "Flipping Pages" PoC compiled static with musl → root. The PoC's deliberate kernel panic made exfiltration-by-design (modprobe payload wgets the flag to an attacker server) the winning move.| Domain | Techniques |
|---|
| Web enumeration | Virtualhost discovery, deterministic credential analysis, anti-DoS-aware pacing |
| SFTP / chroot | Symlink escape, cross-service (Apache) resolution |
| Forensics | Vim swap file recovery (vim -r), source recovery |
| Pivoting | SSH port-forwarding with restricted accounts |
| Web exploitation | Apache RewriteRule bypass, REQUEST_URI-based logic abuse, plugin upload → RCE |
| Kernel exploitation | CVE-2024-1086 (nf_tables UAF), static musl compilation, payload tuning (CONFIG_PHYS_MEM) |
| OpSec in exploit design | Exfiltration-before-crash payloads for panicking exploits |