From a676f600d64f18c327dd7554fb0f81a6a40460db Mon Sep 17 00:00:00 2001 From: h00die Date: Sat, 30 Sep 2017 15:45:52 -0400 Subject: [PATCH] fixes to more modules --- modules/post/multi/escalate/metasploit_pcaplog.rb | 1 + modules/post/multi/gather/enum_vbox.rb | 1 + modules/post/multi/gather/lastpass_creds.rb | 2 +- modules/post/multi/gather/remmina_creds.rb | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/post/multi/escalate/metasploit_pcaplog.rb b/modules/post/multi/escalate/metasploit_pcaplog.rb index 826aa5f99f..857b600303 100644 --- a/modules/post/multi/escalate/metasploit_pcaplog.rb +++ b/modules/post/multi/escalate/metasploit_pcaplog.rb @@ -61,6 +61,7 @@ class MetasploitModule < Msf::Post def run print_status "Setting up the victim's /tmp dir" + fail_with(Failure::NotFound, '/etc/passwd not found on system') unless file_exist?('/etc/passwd') initial_size = read_file("/etc/passwd").lines.count print_status "/etc/passwd is currently #{initial_size} lines long" i = 0 diff --git a/modules/post/multi/gather/enum_vbox.rb b/modules/post/multi/gather/enum_vbox.rb index d4208723b5..1dc3c6664e 100644 --- a/modules/post/multi/gather/enum_vbox.rb +++ b/modules/post/multi/gather/enum_vbox.rb @@ -55,6 +55,7 @@ class MetasploitModule < Msf::Post end end + return nil unless res vprint_status(res) store_path = store_loot('virtualbox_vms', "text/plain", session, res, "virtualbox_vms.txt", "Virtualbox Virtual Machines") print_good("#{peer} - File successfully retrieved and saved on #{store_path}") diff --git a/modules/post/multi/gather/lastpass_creds.rb b/modules/post/multi/gather/lastpass_creds.rb index 20f4421b30..bce2c6125e 100644 --- a/modules/post/multi/gather/lastpass_creds.rb +++ b/modules/post/multi/gather/lastpass_creds.rb @@ -194,7 +194,7 @@ class MetasploitModule < Msf::Post when /windows/ user_profiles |= grab_user_profiles else - print_error "OS not recognized: #{os}" + print_error "OS not recognized: #{session.platform}" end user_profiles end diff --git a/modules/post/multi/gather/remmina_creds.rb b/modules/post/multi/gather/remmina_creds.rb index e393f41be6..ee01add2b1 100644 --- a/modules/post/multi/gather/remmina_creds.rb +++ b/modules/post/multi/gather/remmina_creds.rb @@ -67,7 +67,7 @@ class MetasploitModule < Msf::Post user_dirs = enum_user_directories if user_dirs.empty? print_error('No user directories found') - return + return creds end vprint_status("Searching for Remmina creds in #{user_dirs.size} user directories")