Skip to content

Commit d65ca81

Browse files
Add validation of session type
1 parent 7852ef7 commit d65ca81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/post/windows/gather/credentials/mdaemon_cred_collector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def initialize(info = {})
3333
end
3434

3535
def run
36+
if session.type != 'meterpreter'
37+
print_error ('Only meterpreter sessions are supported by this post module')
38+
return
39+
end
3640
progfiles_env = session.sys.config.getenvs('SYSTEMDRIVE', 'HOMEDRIVE', 'ProgramFiles', 'ProgramFiles(x86)', 'ProgramW6432')
3741
locations = []
3842
progfiles_env.each do |_k, v|

0 commit comments

Comments
 (0)