Issue #666 Proxy now uses forge_request, allowing cross domaian requests, for instances where SOP bypass is available

This commit is contained in:
Mike Haworth
2012-05-13 13:08:13 +12:00
parent 6eacf97b80
commit 1fd66bce1e
2 changed files with 13 additions and 10 deletions

View File

@@ -176,9 +176,9 @@ beef.net = {
$j.ajaxSetup({
dataType: dataType
});
}else{ //GET, HEAD, ...
}else if ( beef.browser.isIE() ) { //set dataType script when GET, HEAD, for IE only
$j.ajaxSetup({
dataType: 'script'
dataType: 'script'
});
}
@@ -286,8 +286,13 @@ beef.net = {
});
}
// this is required for bugs in IE so data can be transfered back to the server
if ( beef.browser.isIE() ) {
dataType = 'script'
}
$j.ajax({type: method,
dataType: 'script', // this is required for bugs in IE so data can be transfered back to the server
dataType: dataType,
url: url,
headers: headers,
timeout: (timeout * 1000),
@@ -324,11 +329,9 @@ beef.net = {
complete: function(xhr, textStatus) {
// cross-domain request
if (cross_domain) {
response.status_code = -1;
response.status_text = "crossdomain";
response.port_status = "crossdomain";
response.response_body = "ERROR: Cross Domain Request. The request was sent however it is impossible to view the response.\n";
response.headers = "ERROR: Cross Domain Request. The request was sent however it is impossible to view the response.\n";
response.status_code = xhr.status;
response.status_text = textStatus;
response.headers = xhr.getAllResponseHeaders();
} else {
// same-domain request
response.status_code = xhr.status;

View File

@@ -82,10 +82,10 @@ module BeEF
:path => uri.path,
:request_date => Time.now,
:hooked_browser_id => self.get_tunneling_proxy,
:allow_cross_domain => "false"
:allow_cross_domain => "true"
)
http.save
print_debug("[PROXY] --> Forwarding request ##{http.id}: domain[#{http.domain}:#{http.port}], method[#{http.method}], path[#{http.path}]")
print_debug("[PROXY] --> Forwarding request ##{http.id}: domain[#{http.domain}:#{http.port}], method[#{http.method}], path[#{http.path}], cross domain[#{http.allow_cross_domain}]")
# Wait for the HTTP response to be stored in the db.
# TODO: re-implement this with EventMachine or with the Observer pattern.