Skip to content

Instantly share code, notes, and snippets.

@zeroSteiner
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroSteiner/75c568d40d1dad0b73e6 to your computer and use it in GitHub Desktop.
Save zeroSteiner/75c568d40d1dad0b73e6 to your computer and use it in GitHub Desktop.
Meterpreter Check If A Patch Is Installed

Drop into IRB:

meterpreter > irb
[*] Starting IRB shell
[*] The 'client' variable holds the meterpreter client

>> 

Then paste in the following, replacing the KB identifiers at the end with the desired ones.

client.core.use("extapi") if not client.ext.aliases.include?("extapi")
objects = client.extapi.wmi.query("SELECT HotFixID FROM Win32_QuickFixEngineering")
kb_ids = objects[:values].map { |kb| kb[0] }
kb_ids.include?('KB2871997') or kb_ids.include?('KB2928120')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment