Added "Has WebSockets" to initialization / details tab
git-svn-id: https://beef.googlecode.com/svn/trunk@1237 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -564,6 +564,7 @@ beef.browser = {
|
||||
var vbscript_enabled=(beef.browser.hasVBScript())? "Yes" : "No";
|
||||
var has_flash = (beef.browser.hasFlash())? "Yes" : "No";
|
||||
var has_googlegears=(beef.browser.hasGoogleGears())? "Yes":"No";
|
||||
var has_web_socket=(beef.browser.hasWebSocket())? "Yes":"No";
|
||||
var has_session_cookies = (beef.browser.cookie.hasSessionCookies("cookie"))? "Yes":"No";
|
||||
var has_persistent_cookies = (beef.browser.cookie.hasPersistentCookies("cookie"))? "Yes":"No";
|
||||
|
||||
@@ -583,6 +584,7 @@ beef.browser = {
|
||||
if(java_enabled) details['JavaEnabled'] = java_enabled
|
||||
if(vbscript_enabled) details['VBScriptEnabled'] = vbscript_enabled
|
||||
if(has_flash) details['HasFlash'] = has_flash
|
||||
if(has_web_socket) details['HasWebSocket'] = has_web_socket
|
||||
if(has_googlegears) details['HasGoogleGears'] = has_googlegears
|
||||
if(has_session_cookies) details["hasSessionCookies"] = has_session_cookies;
|
||||
if(has_persistent_cookies) details["hasPersistentCookies"] = has_persistent_cookies;
|
||||
@@ -627,7 +629,16 @@ beef.browser = {
|
||||
}
|
||||
return results;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the zombie has Web Sockets enabled.
|
||||
* @return: {Boolean} true or false.
|
||||
*
|
||||
* */
|
||||
hasWebSocket: function() {
|
||||
if (!!window.WebSocket) return true; else return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the zombie has Google Gears installed.
|
||||
* @return: {Boolean} true or false.
|
||||
|
||||
@@ -316,6 +316,21 @@ 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 HasWebSocket
|
||||
has_web_socket = BD.get(zombie_session, 'HasWebSocket')
|
||||
if not has_web_socket.nil?
|
||||
encoded_has_web_socket = CGI.escapeHTML(has_web_socket)
|
||||
encoded_has_web_socket_hash = { 'Has WebSockets' => encoded_has_web_socket }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_has_web_socket_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the return values for hasSessionCookies
|
||||
has_session_cookies = BD.get(zombie_session, 'hasSessionCookies')
|
||||
if not has_session_cookies.nil?
|
||||
|
||||
@@ -525,6 +525,21 @@ class ShellInterface
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the yes|no value for HasWebSocket
|
||||
has_web_socket = BD.get(self.targetsession, 'HasWebSocket')
|
||||
if not has_web_socket.nil?
|
||||
encoded_has_web_socket = CGI.escapeHTML(has_web_socket)
|
||||
encoded_has_web_socket_hash = { 'Has GoogleGears' => encoded_has_web_socket }
|
||||
|
||||
page_name_row = {
|
||||
'category' => 'Browser Hook Initialisation',
|
||||
'data' => encoded_has_web_socket_hash,
|
||||
'from' => 'Initialisation'
|
||||
}
|
||||
|
||||
summary_grid_hash['results'].push(page_name_row) # add the row
|
||||
end
|
||||
|
||||
# set and add the return values for hasSessionCookies
|
||||
has_session_cookies = BD.get(self.targetsession, 'hasSessionCookies')
|
||||
if not has_session_cookies.nil?
|
||||
@@ -573,4 +588,4 @@ class ShellInterface
|
||||
|
||||
end
|
||||
|
||||
end end end
|
||||
end end end
|
||||
|
||||
@@ -228,6 +228,17 @@ module Initialization
|
||||
print_error "Invalid value for HasGoogleGears returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store the yes|no value for HasWebSocket
|
||||
begin
|
||||
has_web_socket = get_param(@data['results'], 'HasWebSocket')
|
||||
if not has_web_socket.nil?
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Invalid value for HasWebSocket" if not BeEF::Filters.is_valid_yes_no?(has_web_socket)
|
||||
BD.set(session_id, 'HasWebSocket', has_web_socket)
|
||||
end
|
||||
rescue
|
||||
print_error "Invalid value for HasWebSocket returned from the hook browser's initial connection."
|
||||
end
|
||||
|
||||
# get and store whether the browser has session cookies enabled
|
||||
begin
|
||||
has_session_cookies = get_param(@data['results'], 'hasSessionCookies')
|
||||
|
||||
Reference in New Issue
Block a user