Add 'beef.browser.hasSilverlight()'
Add 'modules/browser/detect_silverlight'
This commit is contained in:
@@ -988,6 +988,7 @@ return !!window.devicePixelRatio && !!window.history.replaceState && window.navi
|
||||
var has_googlegears=(beef.browser.hasGoogleGears())? "Yes":"No";
|
||||
var has_web_socket=(beef.browser.hasWebSocket())? "Yes":"No";
|
||||
var has_activex = (beef.browser.hasActiveX())? "Yes":"No";
|
||||
var has_silverlight = (beef.browser.hasSilverlight())? "Yes":"No";
|
||||
var has_session_cookies = (beef.browser.cookie.hasSessionCookies("cookie"))? "Yes":"No";
|
||||
var has_persistent_cookies = (beef.browser.cookie.hasPersistentCookies("cookie"))? "Yes":"No";
|
||||
|
||||
@@ -1016,6 +1017,7 @@ return !!window.devicePixelRatio && !!window.history.replaceState && window.navi
|
||||
if(has_web_socket) details['HasWebSocket'] = has_web_socket
|
||||
if(has_googlegears) details['HasGoogleGears'] = has_googlegears
|
||||
if(has_activex) details['HasActiveX'] = has_activex;
|
||||
if(has_silverlight) details['HasSilverlight'] = has_silverlight;
|
||||
if(has_session_cookies) details["hasSessionCookies"] = has_session_cookies;
|
||||
if(has_persistent_cookies) details["hasPersistentCookies"] = has_persistent_cookies;
|
||||
|
||||
@@ -1023,12 +1025,32 @@ return !!window.devicePixelRatio && !!window.history.replaceState && window.navi
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns boolean value depending on whether the browser support ActiveX
|
||||
* Returns boolean value depending on whether the browser supports ActiveX
|
||||
*/
|
||||
hasActiveX: function() {
|
||||
return !!window.ActiveXObject;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns boolean value depending on whether the browser supports Silverlight
|
||||
*/
|
||||
hasSilverlight: function() {
|
||||
var result = false;
|
||||
|
||||
try {
|
||||
if (beef.browser.isIE()) {
|
||||
var slControl = new ActiveXObject('AgControl.AgControl');
|
||||
result = true;
|
||||
} else if (navigator.plugins["Silverlight Plug-In"]) {
|
||||
result = true;
|
||||
}
|
||||
} catch (e) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns array of results, whether or not the target zombie has visited the specified URL
|
||||
*/
|
||||
|
||||
@@ -255,6 +255,14 @@ module BeEF
|
||||
self.err_msg "Invalid value for HasActiveX returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store the yes|no value for HasSilverlight
|
||||
has_silverlight = get_param(@data['results'], 'HasSilverlight')
|
||||
if BeEF::Filters.is_valid_yes_no?(has_silverlight)
|
||||
BD.set(session_id, 'HasSilverlight', has_silverlight)
|
||||
else
|
||||
self.err_msg "Invalid value for Silverlight returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store the value for CPU
|
||||
cpu_type = get_param(@data['results'], 'CPU')
|
||||
if !cpu_type.nil?
|
||||
|
||||
@@ -405,6 +405,21 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
'from' => 'Initialization'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for HasSilverlight
|
||||
has_silverlight = BD.get(zombie_session, 'HasSilverlight')
|
||||
if not has_silverlight.nil?
|
||||
encoded_has_silverlight = CGI.escapeHTML(has_silverlight)
|
||||
encoded_has_silverlight_hash = { 'Has Silverlight' => encoded_has_silverlight }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser',
|
||||
'data' => encoded_has_silverlight_hash,
|
||||
'from' => 'Initialization'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
|
||||
@@ -617,6 +617,21 @@ class ShellInterface
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for HasSilverlight
|
||||
has_silverlight = BD.get(zombie_session, 'HasSilverlight')
|
||||
if not has_silverlight.nil?
|
||||
encoded_has_silverlight = CGI.escapeHTML(has_silverlight)
|
||||
encoded_has_silverlight_hash = { 'Has Silverlight' => encoded_has_silverlight }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser',
|
||||
'data' => encoded_has_silverlight_hash,
|
||||
'from' => 'Initialization'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the value for CPU
|
||||
cpu_type = BD.get(zombie_session, 'CPU')
|
||||
if not cpu_type.nil?
|
||||
|
||||
14
modules/browser/detect_silverlight/command.js
Normal file
14
modules/browser/detect_silverlight/command.js
Normal 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
|
||||
//
|
||||
|
||||
beef.execute(function() {
|
||||
|
||||
var result = (beef.browser.hasSilverlight())? "Yes" : "No";
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, "silverlight="+result);
|
||||
|
||||
});
|
||||
|
||||
15
modules/browser/detect_silverlight/config.yaml
Normal file
15
modules/browser/detect_silverlight/config.yaml
Normal 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_silverlight:
|
||||
enable: true
|
||||
category: "Browser"
|
||||
name: "Detect Silverlight"
|
||||
description: "This module will check if the browser has Silverlight support."
|
||||
authors: ["bcoles"]
|
||||
target:
|
||||
working: ["ALL"]
|
||||
14
modules/browser/detect_silverlight/module.rb
Normal file
14
modules/browser/detect_silverlight/module.rb
Normal 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_silverlight < BeEF::Core::Command
|
||||
|
||||
def post_execute
|
||||
content = {}
|
||||
content['silverlight'] = @datastore['silverlight']
|
||||
save content
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user