diff --git a/modules/exploits/multi/misc/java_jdwp_debugger.rb b/modules/exploits/multi/misc/java_jdwp_debugger.rb index a9a7e53498..b42d0fab0d 100644 --- a/modules/exploits/multi/misc/java_jdwp_debugger.rb +++ b/modules/exploits/multi/misc/java_jdwp_debugger.rb @@ -685,15 +685,16 @@ class MetasploitModule < Msf::Exploit::Remote when 'linux' path = temp_path || '/tmp/' payload_exe = "#{path}#{payload_exe}" - if @os.downcase =~ /win/ - print_warning("#{@os} system detected but using Linux target...") - end + when 'osx' + path = temp_path || '/tmp/' + payload_exe = "#{path}#{payload_exe}" when 'win' path = temp_path || './' payload_exe = "#{path}#{payload_exe}.exe" - unless @os.downcase =~ /win/ - print_warning("#{@os} system detected but using Windows target...") - end + end + + if @os.downcase =~ target['Platform'] + print_warning("#{@os} system detected but using #{target['Platform']} target...") end return payload_exe, pl_exe