Mentor
Executive summary — Mentor only exposes SSH and HTTP over TCP, but the real entry point lives in SNMP over UDP, a port a conventional TCP scan never reveals. From there the box is a chain of six reused secrets without a single CVE involved: SNMP leaks a process's command line (and with it a password), that password grants admin access to a FastAPI API with a backup endpoint vulnerable to command injection, the resulting RCE lands inside a Docker container whose source code holds PostgreSQL credentials, the database stores user passwords as unsalted MD5, and two of those passwords are reused verbatim as system SSH credentials — the second one with
sudoover/bin/shat the very end.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Medium |
| Status | Retired |
| Target IP | 10.129.x.x |
Attack map
[22,80] mentorquotes.htb — TCP only; SNMP UDP/161 invisible to the TCP scan
▼
[161/udp] SNMP — "internal" community (onesixtyone misses it, snmpwalk finds it)
│ hrSWRunParameters -> "login.py <password>" in the process command line
▼
[FastAPI] api.mentorquotes.htb — login as james (admin) with that password
│ /admin/backup (undocumented) — blind command injection via "path"
▼
[RCE] root INSIDE the Docker container (BusyBox, no bash)
│ /app/app/db.py -> postgres:postgres@172.22.0.1/mentorquotes_db
│ users table -> MD5 hashes for james and svc; svc cracks with rockyou
▼
[SSH] svc (user.txt) — DB password reused as the system account password
│ /etc/snmp/snmpd.conf -> james's password in clear text (createUser bootstrap)
▼
[SSH] james — password from snmpd.conf reused
│ sudo (ALL) /bin/sh, unrestricted
▼
[ROOT] root.txt
1. Reconnaissance
ping -c 3 -W 3 mentorquotes.htb
ttl=63 (64 minus one hop) points to Linux. Full TCP scan:
nmap -p- --min-rate 5000 -T4 -Pn -oN nmap-allports.txt mentorquotes.htb
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Only two ports, with no obvious web vector behind them — easy to get stuck here. Version detection to confirm the base system:
nmap -sCV -p22,80 -Pn -oN nmap-services.txt mentorquotes.htb
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.52 ((Ubuntu))
|_http-title: Did not follow redirect to http://mentorquotes.htb/
OpenSSH 8.9p1 + Apache 2.4.52 confirm Ubuntu 22.04. When TCP offers so little surface, the mandatory next reflex — the one a lot of people skip because it's slow and noisy — is checking UDP, where services like SNMP live:
sudo nmap -sU --top-ports 50 -T4 -Pn -oN nmap-udp.txt mentorquotes.htb
PORT STATE SERVICE
161/udp open snmp <- INVISIBLE to the TCP scan
161/udp — SNMP open. This port never shows up in a TCP scan, and it changes the whole machine: SNMP exposes system management data (processes, software, network) to anyone who knows the community string that works as its password.
Root Access unlocks the content you can't see — everything else on the site is already open.
See Root Access plansNo account? Create one free then upgrade from your console.