Manually merged Windows Media Player detection from @gcattani

Fix issue #833

Fix issue #847
This commit is contained in:
bcoles
2013-03-17 03:30:12 +10:30
parent f3f624e9a4
commit c98d9a4300
9 changed files with 100 additions and 1 deletions

View File

@@ -964,6 +964,47 @@ beef.browser = {
},
/**
* Checks if the zombie has the Windows Media Player plugin installed.
* @return: {Boolean} true or false.
*
* @example: if ( beef.browser.hasWMP() ) { ... }
*/
hasWMP:function () {
var wmp = false;
// Not Internet Explorer
if (!this.type().IE) {
for (i = 0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name.indexOf("Windows Media Player") >= 0) {
wmp = true;
}
}
// Internet Explorer
} else {
try {
var wmp_test = new ActiveXObject('WMPlayer.OCX');
} catch (e) {
}
if (wmp_test) {
wmp = true;
}
}
return wmp;
},
/**
* Checks if VLC is installed
* @return: {Boolean} true or false
@@ -1401,6 +1442,7 @@ beef.browser = {
var has_silverlight = (beef.browser.hasSilverlight()) ? "Yes" : "No";
var has_quicktime = (beef.browser.hasQuickTime()) ? "Yes" : "No";
var has_realplayer = (beef.browser.hasRealPlayer()) ? "Yes" : "No";
var has_wmp = (beef.browser.hasWMP()) ? "Yes" : "No";
var has_vlc = (beef.browser.hasVLC()) ? "Yes" : "No";
var has_foxit = (beef.browser.hasFoxit()) ? "Yes" : "No";
try{
@@ -1446,7 +1488,8 @@ beef.browser = {
if (has_silverlight) details['HasSilverlight'] = has_silverlight;
if (has_quicktime) details['HasQuickTime'] = has_quicktime;
if (has_realplayer) details['HasRealPlayer'] = has_realplayer;
if (has_vlc) details['HasVLC'] = has_vlc ;
if (has_wmp) details['HasWMP'] = has_wmp;
if (has_vlc) details['HasVLC'] = has_vlc;
if (has_foxit) details['HasFoxit'] = has_foxit;
return details;

View File

@@ -287,6 +287,14 @@ module BeEF
self.err_msg "Invalid value for HasRealPlayer returned from the hook browser's initial connection."
end
# get and store the yes|no value for HasWMP
has_wmp = get_param(@data['results'], 'HasWMP')
if BeEF::Filters.is_valid_yes_no?(has_wmp)
BD.set(session_id, 'HasWMP', has_wmp)
else
self.err_msg "Invalid value for HasWMP returned from the hook browser's initial connection."
end
# get and store the yes|no value for HasVLC
has_vlc = get_param(@data['results'], 'HasVLC')
if BeEF::Filters.is_valid_yes_no?(has_vlc)

View File

@@ -83,6 +83,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
['Browser Components', 'Web Sockets', 'HasWebSocket'],
['Browser Components', 'QuickTime', 'HasQuickTime'],
['Browser Components', 'RealPlayer', 'HasRealPlayer'],
['Browser Components', 'Windows Media Player','HasWMP'],
['Browser Components', 'VLC', 'HasVLC'],
['Browser Components', 'Foxit Reader', 'HasFoxit'],
['Browser Components', 'ActiveX', 'HasActiveX'],

View File

@@ -92,6 +92,7 @@ module BeEF
has_silverlight = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasSilverlight')
has_quicktime = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasQuickTime')
has_realplayer = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasRealPlayer')
has_wmp = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasWMP')
has_vlc = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasVLC')
has_foxit = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'HasFoxit')
date_stamp = BeEF::Core::Models::BrowserDetails.get(hooked_browser.session, 'DateStamp')
@@ -115,6 +116,7 @@ module BeEF
'has_activex' => has_activex,
'has_silverlight' => has_silverlight,
'has_quicktime' => has_quicktime,
'has_wmp' => has_wmp,
'has_vlc' => has_vlc,
'has_foxit' => has_foxit,
'has_realplayer' => has_realplayer,

View File

@@ -28,6 +28,7 @@ var ZombiesMgr = function(zombies_tree_lists) {
var has_googlegears = zombie_array[index]["has_googlegears"];
var has_java = zombie_array[index]["has_java"];
var has_activex = zombie_array[index]["has_activex"];
var has_wmp = zombie_array[index]["has_wmp"];
var has_vlc = zombie_array[index]["has_vlc"];
var has_foxit = zombie_array[index]["has_foxit"];
var has_silverlight = zombie_array[index]["has_silverlight"];
@@ -51,6 +52,7 @@ var ZombiesMgr = function(zombies_tree_lists) {
balloon_text+= "<br/>ActiveX: " + has_activex;
balloon_text+= "<br/>Silverlight: " + has_silverlight;
balloon_text+= "<br/>QuickTime: " + has_quicktime;
balloon_text+= "<br/>Windows MediaPlayer: " + has_wmp;
balloon_text+= "<br/>VLC: " + has_vlc;
balloon_text+= "<br/>Foxit: " + has_foxit;
balloon_text+= "<br/>RealPlayer: " + has_realplayer;

View File

@@ -299,6 +299,7 @@ class ShellInterface
['Browser Components', 'Web Sockets', 'HasWebSocket'],
['Browser Components', 'QuickTime', 'HasQuickTime'],
['Browser Components', 'RealPlayer', 'HasRealPlayer'],
['Browser Components', 'Windows Media Player','HasWMP'],
['Browser Components', 'VLC', 'HasVLC'],
['Browser Components', 'Foxit', 'HasFoxit'],
['Browser Components', 'ActiveX', 'HasActiveX'],

View File

@@ -0,0 +1,13 @@
//
// Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
var result = ( beef.browser.hasWMP() )? "Yes" : "No";
beef.net.send("<%= @command_url %>", <%= @command_id %>, "wmp="+result);
});

View File

@@ -0,0 +1,15 @@
#
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
beef:
module:
detect_wmp:
enable: true
category: "Browser"
name: "Detect Windows Media Player"
description: "This module will check if the browser has the Windows Media Player plugin installed."
authors: ["gcattani"]
target:
working: ["All"]

View File

@@ -0,0 +1,14 @@
#
# Copyright (c) 2006-2013 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Detect_wmp < BeEF::Core::Command
def post_execute
content = {}
content['wmp'] = @datastore['wmp']
save content
end
end