From 87667c2a5f844f0f45eb1c78ce82453329e4aa33 Mon Sep 17 00:00:00 2001 From: "vitaly.osipov@gmail.com" Date: Mon, 15 Nov 2010 10:22:33 +0000 Subject: [PATCH] fixes issue 55 git-svn-id: https://beef.googlecode.com/svn/trunk@525 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- lib/console/banner.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/console/banner.rb b/lib/console/banner.rb index 4704fc3a6..b1b965a7f 100644 --- a/lib/console/banner.rb +++ b/lib/console/banner.rb @@ -11,26 +11,26 @@ module Console version = BeEF::Configuration.instance.get('beef_version') beef_host = @configuration.get("http_public") || @configuration.get("http_host") - hook_uri = "http://#{beef_host}:" - hook_uri += "#{@configuration.get("http_port")}" - hook_uri += "#{@configuration.get("hook_file")}" - - ui_uri = "http://#{beef_host}:" - ui_uri += "#{@configuration.get("http_port")}" - ui_uri += "#{@configuration.get("http_panel_path")}" - demo_uri = "http://#{beef_host}:" - demo_uri += "#{@configuration.get("http_port")}" - demo_uri += "#{@configuration.get("http_demo_path")}" + if beef_host == '0.0.0.0' + zcs_hosts = Socket.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] } + else + zcs_hosts = [beef_host] + end detail_tab = ' ' * 1 + '--[ ' puts puts " -=[ BeEF " + "v#{version} ]=-\n\n" puts detail_tab + "Modules: #{BeEF::Models::CommandModule.all.length}" - puts detail_tab + "Hook URL: #{hook_uri}" - puts detail_tab + "UI URL: #{ui_uri}" - puts detail_tab + "Demo URL: #{demo_uri}" + + zcs_hosts.map do |host| + 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")}" + puts detail_tab + "Demo URL: http://#{host}:#{@configuration.get("http_port")}#{@configuration.get("http_demo_path")}" + end + puts end