Added Detect Scripts Support to initialization and details 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: Java Enabled: No VBScript Enabled: No Has Flash: Yes Has GoogleGears: No Fixes Issue 383 # https://code.google.com/p/beef/issues/detail?id=383 git-svn-id: https://beef.googlecode.com/svn/trunk@1069 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -538,8 +538,11 @@ beef.browser = {
|
||||
var internal_hostname = beef.net.local.getLocalHostname();
|
||||
var screen_params = beef.browser.getScreenParams();
|
||||
var window_size = beef.browser.getWindowSize();
|
||||
var java_enabled = (beef.browser.hasJava())? "Yes" : "No";
|
||||
var vbscript_enabled=(beef.browser.hasVBScript())? "Yes" : "No";
|
||||
var has_flash = (beef.browser.hasFlash())? "Yes" : "No";
|
||||
var has_googlegears=(beef.browser.hasGoogleGears())? "Yes":"No";
|
||||
|
||||
|
||||
if(browser_name) details["BrowserName"] = browser_name;
|
||||
if(browser_version) details["BrowserVersion"] = browser_version;
|
||||
if(browser_reported_name) details["BrowserReportedName"] = browser_reported_name;
|
||||
@@ -551,7 +554,11 @@ beef.browser = {
|
||||
if(internal_hostname) details['InternalHostname'] = internal_hostname;
|
||||
if(screen_params) details['ScreenParams'] = screen_params;
|
||||
if(window_size) details['WindowSize'] = window_size;
|
||||
|
||||
if(java_enabled) details['JavaEnabled'] = java_enabled
|
||||
if(vbscript_enabled) details['VBScriptEnabled'] = vbscript_enabled
|
||||
if(has_flash) details['HasFlash'] = has_flash
|
||||
if(has_googlegears) details['HasGoogleGears'] = has_googlegears
|
||||
|
||||
return details;
|
||||
},
|
||||
|
||||
|
||||
@@ -223,6 +223,65 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for JavaEnabled
|
||||
java_enabled = BD.get(zombie_session, 'JavaEnabled')
|
||||
if not java_enabled.nil?
|
||||
encoded_java_enabled = CGI.escapeHTML(java_enabled)
|
||||
encoded_java_enabled_hash = { 'Java Enabled' => encoded_java_enabled }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_java_enabled_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for VBScriptEnabled
|
||||
vbscript_enabled = BD.get(zombie_session, 'VBScriptEnabled')
|
||||
if not vbscript_enabled.nil?
|
||||
encoded_vbscript_enabled = CGI.escapeHTML(vbscript_enabled)
|
||||
encoded_vbscript_enabled_hash = { 'VBScript Enabled' => encoded_vbscript_enabled }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_vbscript_enabled_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for HasFlash
|
||||
has_flash = BD.get(zombie_session, 'HasFlash')
|
||||
if not has_flash.nil?
|
||||
encoded_has_flash = CGI.escapeHTML(has_flash)
|
||||
encoded_has_flash_hash = { 'Has Flash' => encoded_has_flash }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_has_flash_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for HasGoogleGears
|
||||
has_googlegears = BD.get(zombie_session, 'HasGoogleGears')
|
||||
if not has_googlegears.nil?
|
||||
encoded_has_googlegears = CGI.escapeHTML(has_googlegears)
|
||||
encoded_has_googlegears_hash = { 'Has GoogleGears' => encoded_has_googlegears }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_has_googlegears_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
@body = summary_grid_hash.to_json
|
||||
end
|
||||
|
||||
@@ -117,6 +117,38 @@ module Initialization
|
||||
BD.set(session_id, 'WindowSize', window_size)
|
||||
end
|
||||
|
||||
# get and store the yes|no value for JavaEnabled
|
||||
java_enabled = get_param(@data['results'], 'JavaEnabled')
|
||||
if java_enabled.nil? or java_enabled !~ /^(Yes|No)$/
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Invalid value for JavaEnabled"
|
||||
else
|
||||
BD.set(session_id, 'JavaEnabled', java_enabled)
|
||||
end
|
||||
|
||||
# get and store the yes|no value for VBScriptEnabled
|
||||
vbscript_enabled = get_param(@data['results'], 'VBScriptEnabled')
|
||||
if vbscript_enabled.nil? or vbscript_enabled !~ /^(Yes|No)$/
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Invalid value for VBScriptEnabled"
|
||||
else
|
||||
BD.set(session_id, 'VBScriptEnabled', vbscript_enabled)
|
||||
end
|
||||
|
||||
# get and store the yes|no value for HasFlash
|
||||
has_flash = get_param(@data['results'], 'HasFlash')
|
||||
if has_flash.nil? or has_flash !~ /^(Yes|No)$/
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Invalid value for HasFlash"
|
||||
else
|
||||
BD.set(session_id, 'HasFlash', has_flash)
|
||||
end
|
||||
|
||||
# get and store the yes|no value for HasGoogleGears
|
||||
has_googlegears = get_param(@data['results'], 'HasGoogleGears')
|
||||
if has_googlegears.nil? or has_googlegears !~ /^(Yes|No)$/
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Invalid value for HasGoogleGears"
|
||||
else
|
||||
BD.set(session_id, 'HasGoogleGears', has_googlegears)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_param(query, key)
|
||||
|
||||
Reference in New Issue
Block a user