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')