Skip to content

Commit 9642612

Browse files
committed
Fix: Handle full-location redirects in send_request_cgi
- Resolved an issue where redirects with full-location URLs were not properly handled by `send_request_cgi`. - Implemented a quick solution for now; open to suggestions for a more robust approach. - Tested behavior without proxy interference, as Burp previously masked the issue.
1 parent fabced5 commit 9642612

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/exploits/multi/http/wso2_api_manager_file_upload_rce.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,22 @@ def authenticate
160160
while res.redirect?
161161
loop_dectector += 1
162162
res = send_request_cgi(
163-
'uri' => res.redirection.to_s,
163+
'uri' => "#{res.redirection.path}?#{res.redirection.query}",
164164
'method' => 'GET',
165165
'headers' => {
166166
'Connection' => 'keep-alive'
167167
},
168168
'keep_cookies' => true
169169
)
170+
170171
if res&.get_cookies && res.get_cookies.match(/sessionNonceCookie-(.*)=/)
172+
vprint_status('Got session nonce')
171173
nounce = ::Regexp.last_match(1)
172174
end
173175
break if nounce
174176

175177
fail_with(Failure::UnexpectedReply, 'Loop detected') if loop_dectector > 3
178+
176179
end
177180

178181
auth_data = {
@@ -192,7 +195,7 @@ def authenticate
192195
while res.redirect?
193196
loop_dectector += 1
194197
res = send_request_cgi(
195-
'uri' => res.redirection.to_s,
198+
'uri' => "#{res.redirection.path}?#{res.redirection.query}",
196199
'method' => 'GET',
197200
'headers' => {
198201
'Connection' => 'keep-alive'

0 commit comments

Comments
 (0)