diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 9d3cc9beb..8b6fabf4d 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -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; diff --git a/core/main/client/hardware.js b/core/main/client/hardware.js index 936d4c712..c607599ef 100644 --- a/core/main/client/hardware.js +++ b/core/main/client/hardware.js @@ -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; diff --git a/core/main/handlers/browserdetails.rb b/core/main/handlers/browserdetails.rb index 97761aa5d..bf36bcd73 100644 --- a/core/main/handlers/browserdetails.rb +++ b/core/main/handlers/browserdetails.rb @@ -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) diff --git a/extensions/admin_ui/controllers/modules/modules.rb b/extensions/admin_ui/controllers/modules/modules.rb index 79ed04767..da13e62bf 100644 --- a/extensions/admin_ui/controllers/modules/modules.rb +++ b/extensions/admin_ui/controllers/modules/modules.rb @@ -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 diff --git a/extensions/console/lib/shellinterface.rb b/extensions/console/lib/shellinterface.rb index 68fe1b5f0..72798a756 100644 --- a/extensions/console/lib/shellinterface.rb +++ b/extensions/console/lib/shellinterface.rb @@ -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