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:
bcoles@gmail.com
2011-08-26 13:28:53 +00:00
parent 2bfd396af8
commit 7a4b07ef2e
4 changed files with 54 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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