From f504adb1e8a4059552fe6e4be4a5e91af0945fc9 Mon Sep 17 00:00:00 2001 From: "wade@bindshell.net" Date: Mon, 15 Nov 2010 12:25:58 +0000 Subject: [PATCH] comment and variable name changes git-svn-id: https://beef.googlecode.com/svn/trunk@529 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- lib/console/banner.rb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/console/banner.rb b/lib/console/banner.rb index 34934e1bd..c1c29fc1b 100644 --- a/lib/console/banner.rb +++ b/lib/console/banner.rb @@ -6,26 +6,28 @@ module Console # Generates banner # def self.generate + + # set the pre-string for output + detail_tab = ' ' * 1 + '--[ ' + + # get the configuration information @configuration = BeEF::Configuration.instance - version = BeEF::Configuration.instance.get('beef_version') - beef_host = @configuration.get("http_public") || @configuration.get("http_host") - if beef_host == '0.0.0.0' - zcs_hosts = Socket.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] } - zcs_hosts = zcs_hosts << "127.0.0.1" - else - zcs_hosts = [beef_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.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] } + interfaces = interfaces << "127.0.0.1" + else # the framework will listen on only one interface + interfaces = [beef_host] end - - detail_tab = ' ' * 1 + '--[ ' + # output the banner to the console puts - puts " -=[ BeEF " + "v#{version} ]=-\n\n" - puts detail_tab + "Modules: #{BeEF::Models::CommandModule.all.length}" - - zcs_hosts.map do |host| + puts " -=[ BeEF v#{version} ]=-\n\n" + puts detail_tab + "Modules: #{BeEF::Models::CommandModule.all.length}" # output the number of modules available + interfaces.map do |host| # display the important URLs on each interface from the interfaces array puts detail_tab puts detail_tab + "Hook URL: http://#{host}:#{@configuration.get("http_port")}#{@configuration.get("hook_file")}" puts detail_tab + "UI URL: http://#{host}:#{@configuration.get("http_port")}#{@configuration.get("http_panel_path")}"