Add beef.hardware.isTouchEnabled()
This commit is contained in:
@@ -2061,6 +2061,7 @@ beef.browser = {
|
||||
var os_name = beef.os.getName();
|
||||
var hw_name = beef.hardware.getName();
|
||||
var cpu_type = beef.hardware.cpuType();
|
||||
var touch_enabled = (beef.hardware.isTouchEnabled()) ? "Yes" : "No";
|
||||
var browser_platform = (typeof(navigator.platform) != "undefined" && navigator.platform != "") ? navigator.platform : null;
|
||||
var browser_type = JSON.stringify(beef.browser.type(), function (key, value) {
|
||||
if (value == true) return value; else if (typeof value == 'object') return value; else return;
|
||||
@@ -2092,6 +2093,7 @@ beef.browser = {
|
||||
if (os_name) details['OsName'] = os_name;
|
||||
if (hw_name) details['Hardware'] = hw_name;
|
||||
if (cpu_type) details['CPU'] = cpu_type;
|
||||
if (touch_enabled) details['TouchEnabled'] = touch_enabled;
|
||||
if (date_stamp) details['DateStamp'] = date_stamp;
|
||||
if (browser_platform) details['BrowserPlatform'] = browser_platform;
|
||||
if (browser_type) details['BrowserType'] = browser_type;
|
||||
|
||||
@@ -26,6 +26,11 @@ beef.hardware = {
|
||||
return "32-bit";
|
||||
},
|
||||
|
||||
isTouchEnabled: function() {
|
||||
if ('ontouchstart' in document) return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
isVirtualMachine: function() {
|
||||
if (screen.width % 2 || screen.height % 2) return true;
|
||||
return false;
|
||||
|
||||
@@ -279,6 +279,14 @@ module BeEF
|
||||
self.err_msg "Invalid value for CPU returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store the value for TouchEnabled
|
||||
touch_enabled = get_param(@data['results'], 'TouchEnabled')
|
||||
if BeEF::Filters.is_valid_yes_no?(touch_enabled)
|
||||
BD.set(session_id, 'TouchEnabled', touch_enabled)
|
||||
else
|
||||
self.err_msg "Invalid value for TouchEnabled returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store whether the browser has session cookies enabled
|
||||
has_session_cookies = get_param(@data['results'], 'hasSessionCookies')
|
||||
if BeEF::Filters.is_valid_yes_no?(has_session_cookies)
|
||||
|
||||
@@ -98,7 +98,8 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
['Host', 'Operating System', 'OsName'],
|
||||
['Host', 'Hardware', 'Hardware'],
|
||||
['Host', 'CPU', 'CPU'],
|
||||
['Host', 'Screen Size', 'ScreenSize']
|
||||
['Host', 'Screen Size', 'ScreenSize'],
|
||||
['Host', 'Touch Screen', 'TouchEnabled']
|
||||
]
|
||||
|
||||
# set and add the return values for each browser property
|
||||
|
||||
@@ -314,7 +314,8 @@ class ShellInterface
|
||||
['Host', 'Operating System', 'OsName'],
|
||||
['Host', 'Hardware', 'Hardware'],
|
||||
['Host', 'CPU', 'CPU'],
|
||||
['Host', 'Screen Size', 'ScreenSize']
|
||||
['Host', 'Screen Size', 'ScreenSize'],
|
||||
['Host', 'Touch Screen', 'TouchEnabled']
|
||||
]
|
||||
|
||||
# set and add the return values for each browser property
|
||||
|
||||
Reference in New Issue
Block a user