diff --git a/core/main/client/browser.js b/core/main/client/browser.js index 597a6ec16..72847ac06 100644 --- a/core/main/client/browser.js +++ b/core/main/client/browser.js @@ -536,6 +536,9 @@ beef.browser = { var os_name = beef.os.getName(); var internal_ip = beef.net.local.getLocalAddress(); var internal_hostname = beef.net.local.getLocalHostname(); + var screen_params = beef.browser.getScreenParams(); + var window_size = beef.browser.getWindowSize(); + if(browser_name) details["BrowserName"] = browser_name; if(browser_version) details["BrowserVersion"] = browser_version; @@ -546,6 +549,8 @@ beef.browser = { if(os_name) details['OsName'] = os_name; if(internal_ip) details['InternalIP'] = internal_ip; if(internal_hostname) details['InternalHostname'] = internal_hostname; + if(screen_params) details['ScreenParams'] = screen_params; + if(window_size) details['WindowSize'] = window_size; return details; }, @@ -744,4 +749,4 @@ beef.browser = { }; -beef.regCmp('beef.browser'); \ No newline at end of file +beef.regCmp('beef.browser'); diff --git a/extensions/admin_ui/controllers/modules/modules.rb b/extensions/admin_ui/controllers/modules/modules.rb index eb41728ff..8f2a2fd76 100644 --- a/extensions/admin_ui/controllers/modules/modules.rb +++ b/extensions/admin_ui/controllers/modules/modules.rb @@ -192,7 +192,38 @@ class Modules < BeEF::Extension::AdminUI::HttpController summary_grid_hash['results'].push(page_name_row) # add the row end - + + # set and add the zombie screen size and color depth + screen_params = BD.get(zombie_session, 'ScreenParams') + if not screen_params.nil? + encoded_screen_params = CGI.escapeHTML(screen_params) + encoded_screen_params_hash = { 'Screen Params' => encoded_screen_params } + + page_name_row = { + 'category' => 'Browser Hook Initialisation', + 'data' => encoded_screen_params_hash, + 'from' => 'Initialisation' + } + + summary_grid_hash['results'].push(page_name_row) # add the row + end + + # set and add the zombie browser window size + window_size = BD.get(zombie_session, 'WindowSize') + if not window_size.nil? + encoded_window_size = CGI.escapeHTML(window_size) + encoded_window_size_hash = { 'Window Size' => encoded_window_size } + + page_name_row = { + 'category' => 'Browser Hook Initialisation', + 'data' => encoded_window_size_hash, + 'from' => 'Initialisation' + } + + summary_grid_hash['results'].push(page_name_row) # add the row + end + + @body = summary_grid_hash.to_json end diff --git a/extensions/initialization/handler.rb b/extensions/initialization/handler.rb index f8d193cd7..f695bc9e9 100644 --- a/extensions/initialization/handler.rb +++ b/extensions/initialization/handler.rb @@ -100,6 +100,23 @@ module Initialization raise WEBrick::HTTPStatus::BadRequest, "Invalid internal host name" if not BeEF::Filters.is_valid_hostname?(host_name) BD.set(session_id, 'InternalHostname', internal_hostname) end + + # get and store the zombie screen size and color depth + screen_params = get_param(@data['results'], 'ScreenParams') + if screen_params.nil? + raise WEBrick::HTTPStatus::BadRequest, "Invalid screen size and color depth" + else + BD.set(session_id, 'ScreenParams', screen_params) + end + + # get and store the window size + window_size = get_param(@data['results'], 'WindowSize') + if window_size.nil? + raise WEBrick::HTTPStatus::BadRequest, "Invalid window size" + else + BD.set(session_id, 'WindowSize', window_size) + end + end def get_param(query, key) @@ -110,4 +127,4 @@ module Initialization end end -end \ No newline at end of file +end