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
#
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")}"