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