rapid7/metasploit-framework — pull request #2764 by Meatballs1 (2013-12-14 20:32:25+00:00)
Title: WMIC Post Mixin

This starts to utilize the ExtAPI clipboard functionality to retrieve WMI results. Something that was previously required file IO as WMIC does funny things with its stdout. N.B. Using the clipboard as output does not capture ERROR conditions so we cant see why it has failed but know it has if we get no text back at all.

The Local WMI module is now slightly more responsive as it can detect a successful command and skip a host if the command fails.

The post/windows/gather/wmic_command can now target another host with credentials or using the current user's credentials.

The wmic_query command can be used to retrieve any query but is not currently implemented in any post modules.
wmic_query("qfe list") will bring back all the current patches:

```
Caption CSName Description FixComments HotFixID InstallDate InstalledBy InstalledOn Name ServicePackInEffect Status
http://support.microsoft.com/kb/2899189 DRAKE Update KB2899189_Microsoft-Windows-CameraCodec-Package NT AUTHORITY\SYSTEM 12/12/2013
http://support.microsoft.com/?kbid=2862152 DRAKE Security Update KB2862152 NT AUTHORITY\SYSTEM 11/13/2013
http://support.microsoft.com/?kbid=2868626 DRAKE Security Update KB2868626 NT AUTHORITY\SYSTEM 11/13/2013
```