From a9e276f50a50515f57397115f1bb4917b744db2f Mon Sep 17 00:00:00 2001 From: bcoles Date: Sat, 18 Feb 2012 17:43:20 +1030 Subject: [PATCH] Added Detect Firebug module. Fixes issue 497 Moved Detect Software module from Browser to Host category --- modules/browser/detect_firebug/command.js | 21 +++++++++++++++ modules/browser/detect_firebug/config.yaml | 26 +++++++++++++++++++ modules/browser/detect_firebug/module.rb | 24 +++++++++++++++++ .../detect_software/command.js | 0 .../detect_software/config.yaml | 5 ++-- .../detect_software/module.rb | 0 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 modules/browser/detect_firebug/command.js create mode 100644 modules/browser/detect_firebug/config.yaml create mode 100644 modules/browser/detect_firebug/module.rb rename modules/{browser => host}/detect_software/command.js (100%) rename modules/{browser => host}/detect_software/config.yaml (74%) rename modules/{browser => host}/detect_software/module.rb (100%) diff --git a/modules/browser/detect_firebug/command.js b/modules/browser/detect_firebug/command.js new file mode 100644 index 000000000..f706692f1 --- /dev/null +++ b/modules/browser/detect_firebug/command.js @@ -0,0 +1,21 @@ +// +// Copyright 2012 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 result = "Not Installed"; + if (window.console && (window.console.firebug || window.console.exception)) result = "Installed"; + beef.net.send("<%= @command_url %>", <%= @command_id %>, "firebug="+result); +}); + diff --git a/modules/browser/detect_firebug/config.yaml b/modules/browser/detect_firebug/config.yaml new file mode 100644 index 000000000..8188b0ea3 --- /dev/null +++ b/modules/browser/detect_firebug/config.yaml @@ -0,0 +1,26 @@ +# +# Copyright 2012 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: + detect_firebug: + enable: true + category: "Browser" + name: "Detect FireBug" + description: "This module checks if the Mozilla Firefox Firebug extension is installed." + authors: ["bcoles"] + target: + working: ["FF"] + not_working: ["All"] diff --git a/modules/browser/detect_firebug/module.rb b/modules/browser/detect_firebug/module.rb new file mode 100644 index 000000000..326d375d2 --- /dev/null +++ b/modules/browser/detect_firebug/module.rb @@ -0,0 +1,24 @@ +# +# Copyright 2012 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 Detect_firebug < BeEF::Core::Command + + def post_execute + content = {} + content['firebug'] = @datastore['firebug'] if not @datastore['firebug'].nil? + save content + end + +end diff --git a/modules/browser/detect_software/command.js b/modules/host/detect_software/command.js similarity index 100% rename from modules/browser/detect_software/command.js rename to modules/host/detect_software/command.js diff --git a/modules/browser/detect_software/config.yaml b/modules/host/detect_software/config.yaml similarity index 74% rename from modules/browser/detect_software/config.yaml rename to modules/host/detect_software/config.yaml index aa0f1a855..67f543cbc 100644 --- a/modules/browser/detect_software/config.yaml +++ b/modules/host/detect_software/config.yaml @@ -4,9 +4,10 @@ beef: module: Detect_software: enable: true - category: "Browser" + category: "Host" name: "Detect Software" - description: "Detects software installed on the host (IE only)" + description: "Detects software installed on the host (Internet Explorer only)" authors: ["mh"] target: working: ["IE"] + not_working: ["All"] diff --git a/modules/browser/detect_software/module.rb b/modules/host/detect_software/module.rb similarity index 100% rename from modules/browser/detect_software/module.rb rename to modules/host/detect_software/module.rb