comment and variable name changes

git-svn-id: https://beef.googlecode.com/svn/trunk@529 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
wade@bindshell.net
2010-11-15 12:25:58 +00:00
parent 32584b6f0f
commit f504adb1e8

View File

@@ -6,26 +6,28 @@ module Console
# Generates banner # Generates banner
# #
def self.generate def self.generate
# set the pre-string for output
detail_tab = ' ' * 1 + '--[ '
# get the configuration information
@configuration = BeEF::Configuration.instance @configuration = BeEF::Configuration.instance
version = BeEF::Configuration.instance.get('beef_version') version = BeEF::Configuration.instance.get('beef_version')
beef_host = @configuration.get("http_public") || @configuration.get("http_host") beef_host = @configuration.get("http_public") || @configuration.get("http_host")
if beef_host == '0.0.0.0' # create an array of the interfaces the framework is listening on
zcs_hosts = Socket.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] } if beef_host == '0.0.0.0' # the framework will listen on all interfaces
zcs_hosts = zcs_hosts << "127.0.0.1" interfaces = Socket.getaddrinfo(Socket.gethostname, 'www', Socket::AF_INET, Socket::SOCK_STREAM).map { |x| x[3] }
else interfaces = interfaces << "127.0.0.1"
zcs_hosts = [beef_host] else # the framework will listen on only one interface
interfaces = [beef_host]
end end
detail_tab = ' ' * 1 + '--[ '
# output the banner to the console
puts puts
puts " -=[ BeEF " + "v#{version} ]=-\n\n" puts " -=[ BeEF v#{version} ]=-\n\n"
puts detail_tab + "Modules: #{BeEF::Models::CommandModule.all.length}" 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
zcs_hosts.map do |host|
puts detail_tab puts detail_tab
puts detail_tab + "Hook URL: http://#{host}:#{@configuration.get("http_port")}#{@configuration.get("hook_file")}" 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 + "UI URL: http://#{host}:#{@configuration.get("http_port")}#{@configuration.get("http_panel_path")}"