Skip to content

Commit

Permalink
Merge pull request #1971 from justinsteven/pass_query_string_through_…
Browse files Browse the repository at this point in the history
…proxy

Include URI query string in proxied requests
  • Loading branch information
bcoles authored Jan 26, 2021
2 parents f8e41a9 + 75bd2f8 commit 2517235
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/proxy/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def handle_request socket
tolerant_parser = URI::Parser.new(:UNRESERVED => BeEF::Core::Configuration.instance.get("beef.extension.requester.uri_unreserved_chars"))
uri = tolerant_parser.parse(url.to_s)

uri_path_and_qs = uri.query.nil? ? uri.path : "#{uri.path}?#{uri.query}"

# extensions/requester/api/hook.rb parses raw_request to find port and path
raw_request = [method, uri.path, version].join(' ') + "\r\n"
raw_request = [method, uri_path_and_qs, version].join(' ') + "\r\n"
content_length = 0

loop do
Expand Down Expand Up @@ -127,7 +129,7 @@ def handle_request socket
:proto => proto,
:domain => uri.host,
:port => uri.port,
:path => uri.path,
:path => uri_path_and_qs,
:request_date => Time.now,
:hooked_browser_id => self.get_tunneling_proxy,
:allow_cross_domain => "true"
Expand Down

0 comments on commit 2517235

Please sign in to comment.