Summary
sqlcmd is a Microsoft command-line tool for interacting with SQL Server databases. It allows you to connect to a SQL Server instance, execute SQL queries, and manage databases from the command line. For pentesting, it is useful for enumerating databases, users, permissions, and executing queries with obtained SQL Server credentials.
Commands
sqlcmd -S TARGET -U USER -P PASSWORD - Connect to SQL Server using SQL authentication.
sqlcmd -S TARGET -E - Connect using Windows integrated authentication.
You should be able to run MSSQL commands without any issues with it.
Examples
sqlcmd -S '.\SQLExpress' -U 'dnnuser' -P 'DotNetNukeDatabasePassword!' - Connection to a local db
sqlcmd -S '.\SQLExpress' -d 'dnndatabase' -U 'dnnuser' -P 'DotNetNukeDatabasePassword!' - Connection to a local db