Added port column to Requester History tab

git-svn-id: https://beef.googlecode.com/svn/trunk@1214 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
bcoles@gmail.com
2011-08-19 14:49:43 +00:00
parent 4b7983163e
commit 72c6bf87b0
4 changed files with 20 additions and 22 deletions

View File

@@ -85,6 +85,7 @@ class Requester < BeEF::Extension::AdminUI::HttpController
:request => raw_request,
:method => request.request_method,
:domain => request.host,
:port => request.port,
:path => request.unparsed_uri,
:request_date => Time.now,
:hooked_browser_id => zombie.id
@@ -119,6 +120,7 @@ class Requester < BeEF::Extension::AdminUI::HttpController
history << {
'id' => http.id,
'domain' => http.domain,
'port' => http.port,
'path' => http.path,
'has_ran' => http.has_ran,
'method' => http.method,
@@ -154,6 +156,7 @@ class Requester < BeEF::Extension::AdminUI::HttpController
'response' => http_db.response_data,
'response_headers' => http_db.response_headers,
'domain' => http_db.domain,
'port' => http_db.port,
'path' => http_db.path,
'date' => http_db.request_date,
'has_ran' => http_db.has_ran

View File

@@ -74,7 +74,7 @@ ZombieTab_Requester = function(zombie) {
autoLoad: false,
root: 'history',
fields: ['domain', 'method', 'request_date', 'response_date','id', 'has_ran', 'path','response_status_code', 'response_status_text', 'response_port_status'],
fields: ['domain', 'port', 'method', 'request_date', 'response_date','id', 'has_ran', 'path','response_status_code', 'response_status_text', 'response_port_status'],
sortInfo: {field: 'request_date', direction: 'DESC'},
baseParams: {
@@ -133,14 +133,15 @@ ZombieTab_Requester = function(zombie) {
columns: [
{header: 'Id', width: 10, sortable: true, dataIndex: 'id', hidden:true},
{header: 'Domain', sortable: true, dataIndex: 'domain'},
{header: 'Method', width: 30, sortable: true, dataIndex: 'method'},
{header: 'Port', width: 30, sortable: true, dataIndex: 'port'},
{header: 'Method', width: 30, sortable: true, dataIndex: 'method'},
{header: 'Path', sortable: true, dataIndex: 'path'},
{header: 'Res Code', width: 35, sortable: true, dataIndex: 'response_status_code'},
{header: 'Res TextCode', width: 35, sortable: true, dataIndex: 'response_status_text'},
{header: 'Port Status', width: 35, sortable: true, dataIndex: 'response_port_status'},
{header: 'Res Code', width: 35, sortable: true, dataIndex: 'response_status_code'},
{header: 'Res TextCode', width: 35, sortable: true, dataIndex: 'response_status_text'},
{header: 'Port Status', width: 35, sortable: true, dataIndex: 'response_port_status'},
{header: 'Processed', width: 30, sortable: true, dataIndex: 'has_ran'},
{header: 'Req Date', width: 50, sortable: true, dataIndex: 'request_date'},
{header: 'Res Date', width: 50, sortable: true, dataIndex: 'response_date'}
{header: 'Res Date', width: 50, sortable: true, dataIndex: 'response_date'}
],
@@ -250,12 +251,9 @@ ZombieTab_Requester = function(zombie) {
if(!value) {
value = "GET /demos/secret_page.html HTTP/1.1\n";
if(zombie.domain) {
value += "Host: "+zombie.domain.split(':')[0]+"\n";
} else {
value += "Host: \n";
}
if (zombie.domain) value += "Host: "+zombie.domain+"\n";
else value += "Host: \n";
}
form.get('raw-request-zombie-'+zombie.session).value = value;

View File

@@ -49,19 +49,13 @@ module Zombie
raise 'Invalid hostport' if not BeEF::Filters.nums_only?(hostport) #check the target hostport
end
# Append port to domain string if not 80 or 443
if req.port != 80 or req.port != 443
domain = req.host.to_s + ':' + req.port.to_s
else
domain = req.host.to_s
end
# Saves the new HTTP request to the db for processing by browser.
# IDs are created and incremented automatically by DataMapper.
http = H.new(
:request => req,
:method => req.request_method.to_s,
:domain => domain,
:domain => req.host,
:port => req.port,
:path => req.path.to_s,
:request_date => Time.now,
:hooked_browser_id => hooked_browser_id
@@ -70,7 +64,7 @@ module Zombie
# Starts a new thread scoped to this Handler instance, in order to minimize performance degradation
# while waiting for the HTTP response to be stored in the db.
print_info("[PROXY] Thread started in order to process request ##{http.id} to [#{req.path.to_s}] on domain [#{domain}]")
print_info("[PROXY] Thread started in order to process request ##{http.id} to [#{req.path.to_s}] on domain [#{req.host}:#{req.port}]")
@response_thread = Thread.new do
while !H.first(:id => http.id).has_ran
sleep 0.5
@@ -79,7 +73,7 @@ module Zombie
end
@response_thread.join
print_info("[PROXY] Response for request ##{http.id} to [#{req.path.to_s}] on domain [#{domain}] correctly processed")
print_info("[PROXY] Response for request ##{http.id} to [#{req.path.to_s}] on domain [#{req.host}:#{req.port}] correctly processed")
res.body = @response['response_data']

View File

@@ -57,6 +57,9 @@ module Models
# The domain on which perform the request.
property :domain, Text, :lazy => false
# The port on which perform the request.
property :port, Text, :lazy => false
# Boolean value to say if the request was cross-domain
property :has_ran, Boolean, :default => false