HTB: Writer Writeup
Writer — HackTheBox Writeup
| Machine | Writer |
| OS | Linux |
| Difficulty | Medium |
| Rating | ⭐⭐⭐☆☆ |
| Author | d3vn0mi |
🛠️ Walkthrough
Both flags successfully captured on the Writer box:
user.txt (kyle): <redacted>
root.txt (root): <redacted>
Summary of the chain:
- SQLi auth bypass → manual UNION injection (sqlmap’s
-rrequest-file mode was broken in this environment, and default time-based blind was too slow, so I hand-crafted UNIONLOAD_FILE()payloads reflected in the login success page) - Read
/etc/passwd, Apache vhost config, andwriter/__init__.pyto get MySQL creds (admin/ToughPasswordToCrack) andsmb.conf - SMB login as
kyle(password reuse) on thewriter2_projectshare - RCE via the write-up’s unintended path (malicious filename command injection through the image upload/edit flow) — more reliable here than the internal SSRF, which appeared to only serve one request before dying
- Found Django DB creds, dumped and cracked kyle’s password hash (
marcoantonio) → SSH as kyle → user.txt - Abused the
filtergroup’s write access to/etc/postfix/disclaimer(run asjohn) via a looping copy to beat the restore cron, triggered over SMTP → shell as john, added SSH persistence - Abused john’s
managementgroup write access to/etc/apt/apt.conf.d/, planted anAPT::Update::Pre-Invokereverse-shell hook, triggered byapt-daily-upgrade.timer→ root shell → root.txt
Full plan and details are saved in /out/solve_out_20260722_184140/attack_plan.md, progress.md, and flags.md.
🏁 Proof of Ownership
| Flag | Value |
|---|---|
| User | <redacted> |
| Root | <redacted> |