Testing WMI, RemoteReg, SMB and RemoteCommand

Introduction

Remote access to Windows machines is carried out over a number of protocols that must be available (as part of the pre-reqs for the CAM tool to execute correctly). The four access methods that are used are:

  • WMI

  • Remote Registry

  • SMB

  • Remote Command

By default, only local administrators can have access to WMI remotely. If you are using a standard domain user account, you will obtain a “WMI Access denied” error while testing the connectivity. The user must be configured to allow WMI access.

Once a user with appropriate privileges has been created then there are some simple diagnostic methods to establish that appropriate connectivity is available.

WBEMTEST Tool

In order to test the credentials used by the appliance are valid. The customer will need to use the wbemtest tool to connect to the target, using the same credentials as the appliance uses to scan the target server.

  1. Go to Start and type "WBEMTEST" into the search or run box. This will launch the wbemtest tool.

  2. Click on the Connect button and you will be prompted for the namespace that is to be queried. This is typically either:

    1. \\<hostname>\root\cimv2

    2. \\<ip address>\root\cimv2

  3. Provide the username and password for the user that has permissions to access WMI on the target machine.

  4. If the connection is established, this will succeed silently and the Connect dialogue will disappear.

  5. You will be prompted with a series of Services associated WBEM.

  6. Click Query…

  7. Enter "SELECT * FROM Win32_DiskDrive"

  8. Click Apply

     

  9. The results of the WMI query will be displayed, showing that basic connectivity is available.

Commands on the Appliance

Once the basic connectivity of a target device has been established using the WBEMTEST tool, it is also possible to run test commands from the appliance to execute WMI commands and a number of other remote queries.

As the appliance software is containerised, it is necessary to execute the required command through a specific container on the appliance. The ID of this container is required in subsequent commands. To get teh container id value execute teh following command when logged into a shell on the apliance.

% sudo docker ps -f "name=docker_appliance-server*" --format "{{.ID}}"

Example output:

6f2294adae77


Note this ID value and insert into commands lines in place of the <container-id> tag. .
The complete list of place holders in the following commands are:

  • <container-id> - the docker appliance container ID

  • -server <ip> - the IP address of the target server

  • -username <user> - the username for the login

  • -password <password> - the password for this user

  • -domain <domain> - If the login is associated with a specific domain, specify it using this parameter

WMI Query

% sudo docker exec -it <container-id> bash -c "/opt/iqas/server/tmp/scripts/wmi_query.py -server <ip> -username <user> -password <pass> -query 'SELECT SERIALNUMBER FROM Win32_BIOS'"

Example Result

 

SMB

Example Result

 

Remote Registry

Example Result

 

Remote Command

Example Result