Topology
Topology
Platform: HackTheBox | Difficulty: Easy | OS: Ubuntu Author: D3v0o0Nu11 | Date: 2026-02-10 | Status: Solved
Summary
Walkthrough of the HackTheBox machine Topology (Ubuntu, attack surface: Apache httpd 2.4.41 ((Ubuntu)) (80), OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0) (22)). Foothold via command injection, ssti; direct root access from the foothold. Both flags captured and redacted.
Recon
Port scan
bash read-only • copy allowednmap -p- -sVC 10.10.11.217 --min-rate 1000
| Port | Service | Version | Notes |
|---|---|---|---|
| 22 | ssh | OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0) | |
| 80 | http | Apache httpd 2.4.41 ((Ubuntu)) |
Enumeration highlights
- Detected OS: Ubuntu.
- Open services: http (80), ssh (22).
- Scan used:
nmap -p- -sVC 10.10.11.217 --min-rate 1000.
Foothold
Vulnerability / Misconfiguration
┌──(D3v0o0Nu11㉿htb)-[~]
└─$ nmap -p- -sVC 10.10.11.217 --min-rate 1000
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-01 06:44 PDT
Nmap scan report for toplogy.htb (10.10.11.217)
Host is up (0.028s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 dcbc3286e8e8457810bc2b5dbf0f55c6 (RSA)
| 256 d9f339692c6c27f1a92d506ca79f1c33 (ECDSA)
|_ 256 4ca65075d0934f9c4a1b890a7a2708d7 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Miskatonic University | Topology Group
|_http-server-header: Apache/2.4.41 (Ubuntu)
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 23.15 seconds
-
Based from the nmap results, the machine runs a web application and opens ssh login.
-
After ran dirsearch found nothing interesting.
-
Checking the webpage, found an interesting link.
-
Interesting, I think we all have the same thought here of what the vuln might be.
-
It could be command injection or SSTI.
-
Anyway, after searching on the internet about
latex injectionfound this -->https://book.hacktricks.xyz/pentesting-web/formula-doc-latex-injection. -
Let's try to read a file using these template payloads.
Input --> $\lstinputlisting{/etc/passwd}$
-
It creates a .png file and shows what's inside passwd. Great! This is our foothold, noticed we found 2 users --> root and vdaisley.
-
Anyway, I think the intended way is to get a reverse shell using command injection payload for LaTeX. But since it allows us to do arbitrary files read.
-
Hence, I tried to traverse all common dir and files location, but somehow can't access them.
-
Stuck in this for a while, until I check for subdomains and found this:
-
Found a subdomain -->
dev.
dev.topology.htb
-
Interesting! Let's run dirsearch again for this subdomain.
-
As you can see, I think it will shows the same result as the topology.htb domain.
-
But the unique thing is, there is no such ".htpasswd" inside it but indeed there seems ".htpasswds".
-
Even accessing ".htpasswds" shall gave me error message. Trying access ".htpasswd" shows us cred for vdaisley user.
-
Awesome, let's crack it with john.
-
Let's login to ssh as vdaisley:calculus20.
Proof
User flag: REDACTED
Privilege Escalation
User -> Root/Admin
The exploit provided a shell running with elevated privileges directly, so no separate privilege escalation was required.
Root flag: REDACTED
Flags
| Flag | Value |
|---|---|
| user | REDACTED |
| root | REDACTED |
Lessons Learned
- LaTex Injection.
- Using FFUF.
- htpasswds.