Fix startup banners for public host/port
This commit is contained in:
@@ -32,7 +32,7 @@ module Banners
|
||||
version = config.get('beef.version')
|
||||
print_info "Browser Exploitation Framework (BeEF) #{version}"
|
||||
data = "Twit: @beefproject\n"
|
||||
data += "Site: http://beefproject.com\n"
|
||||
data += "Site: https://beefproject.com\n"
|
||||
data += "Blog: http://blog.beefproject.com\n"
|
||||
data += "Wiki: https://github.com/beefproject/beef/wiki\n"
|
||||
print_more data
|
||||
@@ -48,9 +48,8 @@ module Banners
|
||||
def print_network_interfaces_count
|
||||
# get the configuration information
|
||||
configuration = BeEF::Core::Configuration.instance
|
||||
version = BeEF::Core::Configuration.instance.get('beef.version')
|
||||
beef_host = configuration.get("beef.http.public") || configuration.get("beef.http.host")
|
||||
|
||||
beef_host = configuration.get('beef.http.host')
|
||||
|
||||
# create an array of the interfaces the framework is listening on
|
||||
if beef_host == '0.0.0.0' # the framework will listen on all interfaces
|
||||
interfaces = Socket.ip_address_list.map {|x| x.ip_address if x.ipv4?}
|
||||
@@ -58,13 +57,13 @@ module Banners
|
||||
else # the framework will listen on only one interface
|
||||
interfaces = [beef_host]
|
||||
end
|
||||
|
||||
|
||||
self.interfaces = interfaces
|
||||
|
||||
|
||||
# output the banner to the console
|
||||
print_info "#{interfaces.count} network interfaces were detected."
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Prints the route to the network interfaces beef has been deployed on.
|
||||
# Looks like that:
|
||||
@@ -78,20 +77,31 @@ module Banners
|
||||
#
|
||||
def print_network_interfaces_routes
|
||||
configuration = BeEF::Core::Configuration.instance
|
||||
prototxt = configuration.get("beef.http.https.enable") == true ? "https" : "http"
|
||||
|
||||
self.interfaces.map do |host| # display the important URLs on each interface from the interfaces array
|
||||
print_success "running on network interface: #{host}"
|
||||
port = configuration.get("beef.http.public_port") || configuration.get("beef.http.port")
|
||||
data = "Hook URL: #{prototxt}://#{host}:#{port}#{configuration.get("beef.http.hook_file")}\n"
|
||||
if configuration.get("beef.extension.admin_ui.enable")
|
||||
data += "UI URL: #{prototxt}://#{host}:#{port}#{configuration.get("beef.http.web_ui_basepath")}/panel\n"
|
||||
end
|
||||
|
||||
proto = configuration.get("beef.http.https.enable") == true ? 'https' : 'http'
|
||||
hook_file = configuration.get("beef.http.hook_file")
|
||||
admin_ui = configuration.get("beef.extension.admin_ui.enable") ? true : false
|
||||
web_ui_basepath = configuration.get("beef.http.web_ui_basepath")
|
||||
|
||||
# display the hook URL and Admin UI URL on each interface from the interfaces array
|
||||
self.interfaces.map do |host|
|
||||
print_info "running on network interface: #{host}"
|
||||
port = configuration.get("beef.http.port")
|
||||
data = "Hook URL: #{proto}://#{host}:#{port}#{hook_file}\n"
|
||||
data += "UI URL: #{proto}://#{host}:#{port}#{web_ui_basepath}/panel\n" if admin_ui
|
||||
print_more data
|
||||
end
|
||||
|
||||
# display the public hook URL and Admin UI URL
|
||||
if configuration.get("beef.http.public")
|
||||
host = configuration.get('beef.http.public')
|
||||
port = configuration.get("beef.http.public_port") || configuration.get('beef.http.port')
|
||||
print_info 'Public:'
|
||||
data = "Hook URL: #{proto}://#{host}:#{port}#{hook_file}\n"
|
||||
data += "UI URL: #{proto}://#{host}:#{port}#{web_ui_basepath}/panel\n" if admin_ui
|
||||
print_more data
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Print loaded extensions
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user