diff --git a/modules/auxiliary/admin/smb/delete_file.rb b/modules/auxiliary/admin/smb/delete_file.rb index 8b864eef87..2a17e475ae 100644 --- a/modules/auxiliary/admin/smb/delete_file.rb +++ b/modules/auxiliary/admin/smb/delete_file.rb @@ -59,6 +59,7 @@ class Metasploit3 < Msf::Auxiliary # If there's no exception raised at this point, we assume the file has been removed. print_good("#{peer}: Deleted: #{remote_path}") rescue Rex::Proto::SMB::Exceptions::ErrorCode => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer}: Cannot delete #{remote_path}: #{e.message}") end end @@ -68,6 +69,7 @@ class Metasploit3 < Msf::Auxiliary begin smb_delete_files rescue Rex::Proto::SMB::Exceptions::LoginError => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer}: Unable to login: #{e.message}") end end diff --git a/modules/auxiliary/admin/smb/download_file.rb b/modules/auxiliary/admin/smb/download_file.rb index 01da8340df..5aca3e917b 100644 --- a/modules/auxiliary/admin/smb/download_file.rb +++ b/modules/auxiliary/admin/smb/download_file.rb @@ -68,6 +68,7 @@ class Metasploit3 < Msf::Auxiliary path = store_loot("smb.shares.file", "application/octet-stream", rhost, data, fname) print_good("#{peer}: #{remote_path} saved as: #{path}") rescue Rex::Proto::SMB::Exceptions::ErrorCode => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer} Unable to download #{remote_path}: #{e.message}") end end @@ -77,6 +78,7 @@ class Metasploit3 < Msf::Auxiliary begin smb_download rescue Rex::Proto::SMB::Exceptions::LoginError => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer} Unable to login: #{e.message}") end end diff --git a/modules/auxiliary/admin/smb/upload_file.rb b/modules/auxiliary/admin/smb/upload_file.rb index a196868936..523bbddfa1 100644 --- a/modules/auxiliary/admin/smb/upload_file.rb +++ b/modules/auxiliary/admin/smb/upload_file.rb @@ -72,10 +72,12 @@ class Metasploit3 < Msf::Auxiliary print_good("#{peer}: #{local_path} uploaded to #{remote_path}") rescue Rex::Proto::SMB::Exceptions::ErrorCode => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer} Unable to upload #{local_path} to #{remote_path} : #{e.message}") end end rescue Rex::Proto::SMB::Exceptions::LoginError => e + elog("#{e.class} #{e.message}\n#{e.backtrace * "\n"}") print_error("#{peer} Unable to login: #{e.message}") end end