Augmented beef.net.request to support port_status
Only "open" and "closed" are supported currently Part of issue 286 git-svn-id: https://beef.googlecode.com/svn/trunk@1177 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -195,19 +195,21 @@ beef.net = {
|
||||
//function on success
|
||||
success: function(data, textStatus, xhr){
|
||||
var end_time = new Date().getTime();
|
||||
response.status_code = textStatus;
|
||||
response.status_code = textStatus;
|
||||
response.response_body = data;
|
||||
response.port_status = "open";
|
||||
response.was_timedout = false;
|
||||
response.duration = (end_time - start_time);
|
||||
},
|
||||
},
|
||||
//function on failure
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
var end_time = new Date().getTime();
|
||||
if (textStatus == "timeout"){response.was_timedout = true;}
|
||||
if (textStatus == "timeout"){response.was_timedout = true; response.port_status = "closed"; } else { response.port_status = "open"; }
|
||||
response.status_code = jqXHR.status;
|
||||
response.response_body = jqXHR.responseText;
|
||||
response.status_code = textStatus;
|
||||
response.duration = (end_time - start_time);
|
||||
},
|
||||
},
|
||||
//function on completion
|
||||
complete: function(transport) {
|
||||
response.status_code = transport.status;
|
||||
@@ -281,27 +283,28 @@ beef.net = {
|
||||
//function on success
|
||||
success: function(data, textStatus, xhr){
|
||||
var end_time = new Date().getTime();
|
||||
response.status_code = xhr.status;
|
||||
response.status_text = textStatus;
|
||||
response.status_code = xhr.status;
|
||||
response.status_text = textStatus;
|
||||
response.response_body = data;
|
||||
response.port_status = "open";
|
||||
response.was_timedout = false;
|
||||
response.duration = (end_time - start_time);
|
||||
},
|
||||
},
|
||||
//function on failure
|
||||
error: function(xhr, textStatus, errorThrown){
|
||||
error: function(xhr, textStatus, errorThrown){
|
||||
var end_time = new Date().getTime();
|
||||
if (textStatus == "timeout"){response.was_timedout = true;}
|
||||
if (textStatus == "timeout"){response.was_timedout = true; response.port_status = "closed"; } else { response.port_status = "open"; }
|
||||
response.response_body = xhr.responseText;
|
||||
response.status_code = xhr.status;
|
||||
response.status_text = textStatus;
|
||||
response.status_text = textStatus;
|
||||
response.duration = (end_time - start_time);
|
||||
},
|
||||
},
|
||||
//function on completion
|
||||
complete: function(xhr, textStatus) {
|
||||
response.status_code = xhr.status;
|
||||
response.status_text = textStatus;
|
||||
response.headers = xhr.getAllResponseHeaders();
|
||||
callback(response, requestid);
|
||||
response.status_text = textStatus;
|
||||
response.headers = xhr.getAllResponseHeaders();
|
||||
callback(response, requestid);
|
||||
}
|
||||
});
|
||||
return response;
|
||||
|
||||
@@ -36,6 +36,7 @@ beef.net.requester = {
|
||||
response_data:res.response_body,
|
||||
response_status_code: res.status_code,
|
||||
response_status_text: res.status_text,
|
||||
response_port_status: res.port_status,
|
||||
response_headers: res.headers});
|
||||
}
|
||||
);
|
||||
@@ -43,4 +44,4 @@ beef.net.requester = {
|
||||
}
|
||||
};
|
||||
|
||||
beef.regCmp('beef.net.requester');
|
||||
beef.regCmp('beef.net.requester');
|
||||
|
||||
@@ -125,7 +125,8 @@ class Requester < BeEF::Extension::AdminUI::HttpController
|
||||
'request_date' => http.request_date,
|
||||
'response_date' => http.response_date,
|
||||
'response_status_code' => http.response_status_code,
|
||||
'response_status_text' => http.response_status_text
|
||||
'response_status_text' => http.response_status_text,
|
||||
'response_port_status' => http.response_port_status
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,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'],
|
||||
fields: ['domain', '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: {
|
||||
@@ -107,6 +107,7 @@ ZombieTab_Requester = function(zombie) {
|
||||
{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: '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'}
|
||||
|
||||
@@ -67,6 +67,7 @@ module Requester
|
||||
http_db.response_headers = @data['results']['response_headers']
|
||||
http_db.response_status_code = @data['results']['response_status_code']
|
||||
http_db.response_status_text = @data['results']['response_status_text']
|
||||
http_db.response_port_status = @data['results']['response_port_status']
|
||||
http_db.response_data = @data['results']['response_data']
|
||||
http_db.response_date = Time.now
|
||||
http_db.has_ran = true
|
||||
|
||||
@@ -42,6 +42,9 @@ module Models
|
||||
# The http response code. Human-readable code: success, error, ecc..
|
||||
property :response_status_text, Text, :lazy => true
|
||||
|
||||
# The port status. closed, open or not http
|
||||
property :response_port_status, Text, :lazy => true
|
||||
|
||||
# The XHR Http response raw headers
|
||||
property :response_headers, Text, :lazy => true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user