Added Screen Details to initialization and default tab

M      extensions/admin_ui/controllers/modules/modules.rb
M      extensions/initialization/handler.rb
M      core/main/client/browser.js

Example output on details tab:

Screen Params: {"width"=>1024, "height"=>768, "colordepth"==>24}
Window Size: {"width"=>1024, "height"=>640}



git-svn-id: https://beef.googlecode.com/svn/trunk@1067 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
bcoles@gmail.com
2011-07-16 07:14:23 +00:00
parent fff1039c41
commit 6b00485b97
3 changed files with 56 additions and 3 deletions

View File

@@ -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');
beef.regCmp('beef.browser');

View File

@@ -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

View File

@@ -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
end