rapid7/metasploit-framework — pull request #3303 by nstarke (2014-04-27 20:40:54+00:00)
Title: POST module duplicate search results

Running a POST module in meterpreter was causing duplicate search
results for the executed module. For example, running
post/windows/gather/checkvm would produce duplicate results for that
module when executing “search checkvm” in msf.

Debugging revealed that the cmd_exec function in meterpreter’s ui
command_dispatcher core was creating the specified module, and then
promptly reloading it. The reload function was causing the duplicate
module_detail record to be written to the msg postgres database
instance. Further analysis revealed that the “original_mod” could be
used for running the post module, so the “reloaded_mod” was removed
and the “original_mod” used in it’s place to run the post module.

SeeRM #8754