TCP: MSSQL - 1433
Initial Connection
Connect on local machine
sqsh -S <Target IP Address> -U .\\<Username> -P <Password> -D <Database Name>OR
impacket-mssqlclient [<Domain Name>/]<Username>:<Password>@<Target IP Address> -local-authConnect to machine
sqsh -S <Target IP Address> -U <Username> -P "<Password>"OR
impacket-mssqlclient [<Domain Name>/]<Username>:<Password>@<Target IP Address> -windows-authReverse Shell
On Machine
Initiate connection
If using sqsh, "GO" needs to be entered after every query to send it
Use the master databse
Get users that can run xp_cmdshell
Check if xp_cmdshell is enabled
Enable advanced options as it is needed for xp_cmdshell
Apply changes
Enable xp_cmdshell
Apply changes
Run command
On SQLi vulnerability
Enable advanced options as it is needed for xp_cmdshell
Apply changes
Enable xp_cmdshell
Apply changes
Run commands
Bruteforce
Last updated