Windows Discovery Findings
Setup
Mid Server Configuration
Much of this is set by default, but here's the settings that work.
Windows Configuration needed
Adding trusted host for WinRM. This is a bit of a lazy configuration on my part here, because I don't think I need target and source, and ip and FQDN, but it works.
PS C:\Windows\system32> winrm s winrm/config/client '@{TrustedHosts="spinup-0005a2.yu.yale.edu,172.17.172.207,spinup-0005a8.yu.yale.edu,172.17.172.247"}'
Ran into some issues with reverse DNS lookup. Might need some more investigation.
High Level Process
Script provided to probe is parsed on mid server
- Script is executed via remote session on the target server
- Results are picked up from mid server
Example:
Note : Tests run on Server 2016 in Spinup environment
- Windows - CPU / Memory, which is a WMI Probe is executed.
ECC Entry looks like this. In this case basically just a list of values it wants. Executed via mid server at 172.17.172.207.
- This input is parsed by scripts on the mid server and executed on the target machine at 172.17.172.247. Here's some powershell logging showing the execution going against the remote host.
- Script is executed as PowerShell. See the log from the target machine here:
PowerShell_transcript.SPINUP-0005A8.NdOTnTCh.20170607142128.txt - Information is pulled back into the mid server and parsed. See the output here.
probe_response.xml - ServiceNow works it's magic to get it into the CMDB.
More Details
Script Files
Powershell and WinRM scripts are here:
https://yale.app.box.com/files/0/f/27799187643/Mid_Server_Powershell_Scripts_
Ecc Queue
One thing that's a bit confusing here is that we see WMI being invoked. This isn't actually remote WMI as evidenced above and is handled differently based on the protocol being used.
Wireshark
Shows WinRM port 5985 and only 5985 being used.
Powershell log
Further evidenced here is that PowerShell is using the Get-WmiObject cmdlet and not remote WMI
PS>CommandInvocation(Get-WmiObject): "Get-WmiObject" >> ParameterBinding(Get-WmiObject): name="Class"; value="Win32_ComputerSystem" Domain : yu.yale.edu Manufacturer : RDO Model : OpenStack Compute Name : SPINUP-0005A8 PrimaryOwnerName : Windows User TotalPhysicalMemory : 8589373440
Without local admin
Work in progress...
Add user to Remote Admin Group
LocalAccountTokenFilterPolicy needs to be set for local account to work