I Broke Into a Server Through a Painting on the Wall
A deliberately vulnerable practice machine exposed an anonymous SMB share containing root's terminal history and the Samba configuration, which revealed a valid username. After cracking that account's reused password, the attacker reached a localhost-only LibreNMS install, exploited a command injection in its add-host feature, and used a passwordless sudo rule for the mysql client to gain root.
Every vulnerable machine tells you a story if you know how to read it. Symfonos2 tells a particularly good one: it starts with a server that looks completely empty, and ends with a sudo misconfiguration handing over the keys to the whole box.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a chain of weak configurations: an unauthenticated file share holding sensitive backups, password reuse across services, an unpatched command injection in LibreNMS, and a passwordless sudo rule for a binary that can spawn a shell.
Impact
An attacker with network access could read sensitive backup data, crack a reused password, and escalate all the way to root on the machine.
What the attacker needed
Network access to the target; no credentials needed for the SMB share; a weak, reused password; an unpatched LibreNMS version
The fix
The share should not have been anonymously readable, passwords should not be reused, LibreNMS should be patched, and the sudo rule for mysql should be removed.
How it was found
- Scan the subnet to find the target host and its open services.
- List the SMB shares without credentials and read the log file in the anonymous share.
- Brute-force the SSH account named in the leaked configuration.
- Log in over SSH and list listening ports to find a service bound only to localhost.
- Tunnel the localhost service to the attacker machine and log in to LibreNMS with the same credentials.
- Run the LibreNMS add-host command injection to get a shell as another user, then use the sudo mysql rule to become root.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This is a walkthrough of a deliberately vulnerable practice machine, not a real product. The attacker found a file share that anyone could read without logging in, and a file inside it gave away a username; the same password then worked for both the login service and a hidden monitoring web app, which had a bug letting the attacker run commands. Finally, a rule allowed one account to run the database client as the all-powerful root user, and that client can drop into a shell.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.