From d65ca818eab6b381a120d3c705c716ededd6255f Mon Sep 17 00:00:00 2001 From: AgoraSecurity Date: Wed, 31 Aug 2016 11:29:04 -0500 Subject: [PATCH] Add validation of session type --- .../post/windows/gather/credentials/mdaemon_cred_collector.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/post/windows/gather/credentials/mdaemon_cred_collector.rb b/modules/post/windows/gather/credentials/mdaemon_cred_collector.rb index 314c6cce69..c5bd23d573 100644 --- a/modules/post/windows/gather/credentials/mdaemon_cred_collector.rb +++ b/modules/post/windows/gather/credentials/mdaemon_cred_collector.rb @@ -33,6 +33,10 @@ class MetasploitModule < Msf::Post end def run + if session.type != 'meterpreter' + print_error ('Only meterpreter sessions are supported by this post module') + return + end progfiles_env = session.sys.config.getenvs('SYSTEMDRIVE', 'HOMEDRIVE', 'ProgramFiles', 'ProgramFiles(x86)', 'ProgramW6432') locations = [] progfiles_env.each do |_k, v|