From a5448056599a2d2ae062059a8b135af8352e25de Mon Sep 17 00:00:00 2001 From: Jack Heysel Date: Thu, 5 Dec 2024 18:18:06 -0800 Subject: [PATCH 1/2] Fix query in reconfig_redirect_opts! --- lib/msf/core/exploit/remote/http_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/remote/http_client.rb b/lib/msf/core/exploit/remote/http_client.rb index 4d578e6b85f7..b3febbc7ebf6 100644 --- a/lib/msf/core/exploit/remote/http_client.rb +++ b/lib/msf/core/exploit/remote/http_client.rb @@ -499,7 +499,7 @@ def reconfig_redirect_opts!(res, opts) end # Don't forget any GET parameters - opts['query'] ||= location.query if location.query + opts['query'] = location.query if location.query end # From c7b96f89b0dbae37056976005efc5c23c17199a4 Mon Sep 17 00:00:00 2001 From: Jack Heysel Date: Thu, 5 Dec 2024 18:24:12 -0800 Subject: [PATCH 2/2] Unset opts query if no location.query --- lib/msf/core/exploit/remote/http_client.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/remote/http_client.rb b/lib/msf/core/exploit/remote/http_client.rb index b3febbc7ebf6..bdb7db2f78e4 100644 --- a/lib/msf/core/exploit/remote/http_client.rb +++ b/lib/msf/core/exploit/remote/http_client.rb @@ -499,7 +499,11 @@ def reconfig_redirect_opts!(res, opts) end # Don't forget any GET parameters - opts['query'] = location.query if location.query + if location.query + opts['query'] = location.query + else + opts['query'] = '' + end end #