Notifications

332 views

Description

"sqlcmd" commands in "MsSql DB On Windows" Pattern fail to authenticate when the password variable is passed with quotations.

One example would be the command used in step "get server properties from sql query":

"sqlcmd -h-1 -U $$username$$ -P '$$password$$' -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"select SERVERPROPERTY('ProductLevel') AS ProductLevel, SERVERPROPERTY('EngineEdition') AS Engine,SERVERPROPERTY('ProductVersion') AS ProductVersion;\""

Steps to Reproduce

  1. Enable the Discovery plugin
  2. Configure a MID server
  3. Enable pattern based discovery
  4. Add the required Windows Credentials and Applicative Credentials for the Microsoft SQL Server
  5. Run discovery for a windows server hosting MsSQL database

Workaround

Remove the single quote for the password parameter value as follows:

"sqlcmd -h-1 -U $$username$$ -P $$password$$ -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"select SERVERPROPERTY('ProductLevel') AS ProductLevel, SERVERPROPERTY('EngineEdition') AS Engine,SERVERPROPERTY('ProductVersion') AS ProductVersion;\""

Related Problem: PRB1322425

Seen In

Kingston Patch 9

Fixed In

London Patch 9
Madrid Patch 4
New York

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-08-06 08:52:40
Published:2019-01-25