From 41289e5f1da5701485c9c813bcda74f7c45e3c74 Mon Sep 17 00:00:00 2001 From: "wade@bindshell.net" Date: Thu, 21 Apr 2011 23:09:40 +0000 Subject: [PATCH] Adding debug modules git-svn-id: https://beef.googlecode.com/svn/trunk@916 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- .../debug/test_return_ascii_chars/command.js | 10 ++++++ .../debug/test_return_ascii_chars/config.yaml | 10 ++++++ .../debug/test_return_ascii_chars/module.rb | 32 +++++++++++++++++++ .../debug/test_return_long_string/command.js | 15 +++++++++ .../debug/test_return_long_string/config.yaml | 10 ++++++ .../debug/test_return_long_string/module.rb | 32 +++++++++++++++++++ 6 files changed, 109 insertions(+) create mode 100644 modules/debug/test_return_ascii_chars/command.js create mode 100644 modules/debug/test_return_ascii_chars/config.yaml create mode 100644 modules/debug/test_return_ascii_chars/module.rb create mode 100644 modules/debug/test_return_long_string/command.js create mode 100644 modules/debug/test_return_long_string/config.yaml create mode 100644 modules/debug/test_return_long_string/module.rb diff --git a/modules/debug/test_return_ascii_chars/command.js b/modules/debug/test_return_ascii_chars/command.js new file mode 100644 index 000000000..3a776b87b --- /dev/null +++ b/modules/debug/test_return_ascii_chars/command.js @@ -0,0 +1,10 @@ +beef.execute(function() { + + var str = ''; + for (var i=32; i<=127;i++) str += String.fromCharCode(i); + + console.log(str); + beef.net.send("<%= @command_url %>", <%= @command_id %>, str); + +}); + diff --git a/modules/debug/test_return_ascii_chars/config.yaml b/modules/debug/test_return_ascii_chars/config.yaml new file mode 100644 index 000000000..570e58361 --- /dev/null +++ b/modules/debug/test_return_ascii_chars/config.yaml @@ -0,0 +1,10 @@ +beef: + module: + Test_return_ascii_chars: + enable: true + category: "Debug" + name: "Return Ascii Chars" + description: "This module will return the set of ascii chars." + authors: ["wade"] + target: + working: ["ALL"] diff --git a/modules/debug/test_return_ascii_chars/module.rb b/modules/debug/test_return_ascii_chars/module.rb new file mode 100644 index 000000000..ec096c760 --- /dev/null +++ b/modules/debug/test_return_ascii_chars/module.rb @@ -0,0 +1,32 @@ +class Test_return_ascii_chars < BeEF::Core::Command + + def initialize + super({ + 'Name' => 'Return Ascii Chars', + 'Description' => %Q{ + This module will return the set of ascii chars. + }, + 'Category' => 'Debug', + 'Data' => [ +# {'name' => 'repeat', 'ui_label' => 'Times to repeat', 'value' =>'1024'}, +# {'name' => 'repeat_string', 'ui_label' => 'String to repeat', 'value' =>'\u00AE'} + ], + 'Author' => ['wade'], + 'File' => __FILE__ + }) + + set_target({ + 'verified_status' => VERIFIED_WORKING, + 'browser_name' => ALL + }) + + use_template! + end + + def callback + content = {} + content['Result String'] = @datastore['result_string'] + save content + end + +end diff --git a/modules/debug/test_return_long_string/command.js b/modules/debug/test_return_long_string/command.js new file mode 100644 index 000000000..2f2f05156 --- /dev/null +++ b/modules/debug/test_return_long_string/command.js @@ -0,0 +1,15 @@ +beef.execute(function() { + + var repeat_value = "<%= @repeat_string %>"; + var iterations = <%= @repeat %>; + var str = ""; + + for (var i = 0; i < iterations; i++) { + str += repeat_value; + } + + console.log(str); + beef.net.send("<%= @command_url %>", <%= @command_id %>, str); + +}); + diff --git a/modules/debug/test_return_long_string/config.yaml b/modules/debug/test_return_long_string/config.yaml new file mode 100644 index 000000000..d8aa2bcb7 --- /dev/null +++ b/modules/debug/test_return_long_string/config.yaml @@ -0,0 +1,10 @@ +beef: + module: + Test_return_long_string: + enable: true + category: "Debug" + name: "Test Returning Results" + description: "This module will return a string of the specified length." + authors: ["wade"] + target: + working: ["ALL"] diff --git a/modules/debug/test_return_long_string/module.rb b/modules/debug/test_return_long_string/module.rb new file mode 100644 index 000000000..cf1e62da5 --- /dev/null +++ b/modules/debug/test_return_long_string/module.rb @@ -0,0 +1,32 @@ +class Test_return_long_string < BeEF::Core::Command + + def initialize + super({ + 'Name' => 'Return Long String', + 'Description' => %Q{ + This module will return a string of the specified length. + }, + 'Category' => 'Debug', + 'Data' => [ + {'name' => 'repeat', 'ui_label' => 'Times to repeat', 'value' =>'1024'}, + {'name' => 'repeat_string', 'ui_label' => 'String to repeat', 'value' =>'\u00AE'} + ], + 'Author' => ['wade'], + 'File' => __FILE__ + }) + + set_target({ + 'verified_status' => VERIFIED_WORKING, + 'browser_name' => ALL + }) + + use_template! + end + + def callback + content = {} + content['Result String'] = @datastore['result_string'] + save content + end + +end