mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-29 18:07:27 +01:00
Store the http request in the http response object when Rex::HTTP::Client.send_recv() is used. Let Anemone store the request as well, passing it into the Page object for further analysis.
git-svn-id: file:///home/svn/framework3/trunk@11023 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
510f61ac37
commit
54f3563c7e
@ -7,3 +7,4 @@ This snapshot of Anemone has been modified for use within the Metasploit Framewo
|
||||
* Addition of a Rex::Proto::HTTP version of anemone/http
|
||||
* Handle Rex::Proto::HTTP headers (not arrays)
|
||||
* Disable freeze_options() since it can recurse into the framework/module options
|
||||
* Addition of a page.request accessor to store the associated raw request
|
||||
|
@ -29,7 +29,9 @@ module Anemone
|
||||
attr_accessor :referer
|
||||
# Response time of the request for this page in milliseconds
|
||||
attr_accessor :response_time
|
||||
|
||||
# Storage for the original HTTP request that generated this response
|
||||
attr_accessor :request
|
||||
|
||||
#
|
||||
# Create a new page
|
||||
#
|
||||
|
@ -40,13 +40,16 @@ module Anemone
|
||||
pages = []
|
||||
get(url, referer) do |response, code, location, redirect_to, response_time|
|
||||
|
||||
pages << Page.new(location, :body => response.body.dup,
|
||||
page = Page.new(location, :body => response.body.dup,
|
||||
:code => code,
|
||||
:headers => response.headers,
|
||||
:referer => referer,
|
||||
:depth => depth,
|
||||
:redirect_to => redirect_to,
|
||||
:response_time => response_time)
|
||||
# Store the associated raw HTTP request
|
||||
page.request = response.request
|
||||
pages << page
|
||||
end
|
||||
|
||||
return pages
|
||||
|
@ -328,7 +328,9 @@ class Client
|
||||
def send_recv(req, t = -1, persist=false)
|
||||
@pipeline = persist
|
||||
send_request(req)
|
||||
read_response(t)
|
||||
res = read_response(t)
|
||||
res.request = req.to_s
|
||||
res
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -74,12 +74,17 @@ class Response < Packet
|
||||
"HTTP\/#{proto} #{code}#{(message and message.length > 0) ? ' ' + message : ''}\r\n"
|
||||
end
|
||||
|
||||
attr_accessor :code
|
||||
#
|
||||
# Used to store a copy of the original request
|
||||
#
|
||||
attr_accessor :request
|
||||
|
||||
|
||||
attr_accessor :code
|
||||
attr_accessor :message
|
||||
attr_accessor :proto
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user