all important banner commit

git-svn-id: file:///home/svn/incoming/trunk@2751 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-07-14 07:13:01 +00:00
parent d62566a68f
commit 5d67d54002
5 changed files with 167 additions and 1 deletions

View File

@ -3,5 +3,6 @@ module Ui
end
end
require 'msf/ui/banner'
require 'msf/ui/driver'
require 'msf/ui/console'

120
lib/msf/ui/banner.rb Normal file
View File

@ -0,0 +1,120 @@
module Msf
module Ui
###
#
# Banner
# ------
#
# Module that contains some most excellent banners.
#
###
module Banner
Logos =
[
'
## ### ## ##
## ## #### ###### #### ##### ##### ## #### ######
####### ## ## ## ## ## ## ## ## ## ## ### ##
####### ###### ## ##### #### ## ## ## ## ## ## ##
## # ## ## ## ## ## ## ##### ## ## ## ## ##
## ## #### ### ##### ##### ## #### #### #### ###
##
',
'
_ _ _ _
| | | | (_) |
_ __ ___ ___| |_ __ _ ___ _ __ | | ___ _| |_
| \'_ ` _ \ / _ \ __/ _` / __| \'_ \| |/ _ \| | __|
| | | | | | __/ || (_| \__ \ |_) | | (_) | | |_
|_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__|
| |
|_|
',
# jbl
'
__. .__. .__. __.
_____ _____/ |______ ____________ | | ____ |__|/ |_
/ \_/ __ \ __\__ \ / ___/\____ \| | / _ \| \ __\
| Y Y \ ___/| | / __ \_\___ \ | |_> > |_( <_> ) || |
|__|_| /\___ >__| (____ /____ >| __/|____/\____/|__||__|
\/ \/ \/ \/ |__|
',
# colossal
'
888 888 d8b888
888 888 Y8P888
888 888 888
88888b.d88b. .d88b. 888888 8888b. .d8888b 88888b. 888 .d88b. 888888888
888 "888 "88bd8P Y8b888 "88b88K 888 "88b888d88""88b888888
888 888 88888888888888 .d888888"Y8888b.888 888888888 888888888
888 888 888Y8b. Y88b. 888 888 X88888 d88P888Y88..88P888Y88b.
888 888 888 "Y8888 "Y888"Y888888 88888P\'88888P" 888 "Y88P" 888 "Y888
888
888
888
',
'
o 8 o o
8 8 8
ooYoYo. .oPYo. o8P .oPYo. .oPYo. .oPYo. 8 .oPYo. o8 o8P
8\' 8 8 8oooo8 8 .oooo8 Yb.. 8 8 8 8 8 8 8
8 8 8 8. 8 8 8 \'Yb. 8 8 8 8 8 8 8
8 8 8 `Yooo\' 8 `YooP8 `YooP\' 8YooP\' 8 `YooP\' 8 8
..:..:..:.....:::..::.....::.....:8.....:..:.....::..::..:
::::::::::::::::::::::::::::::::::8:::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
',
'
_ _
_ | | (_)_
____ ____| |_ ____ ___ ____ | | ___ _| |_
| \ / _ ) _)/ _ |/___) _ \| |/ _ \| | _)
| | | ( (/ /| |_( ( | |___ | | | | | |_| | | |__
|_|_|_|\____)\___)_||_(___/| ||_/|_|\___/|_|\___)
|_|
',
'
____________
< metasploit >
------------
\ ,__,
\ (oo)____
(__) )\
||--|| *
',
'
_
| | o
_ _ _ _ _|_ __, , _ | | __ _|_
/ |/ |/ | |/ | / | / \_|/ \_|/ / \_| |
| | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
/|
\|
',
'
# # ###### ##### ## #### ##### # #### # #####
## ## # # # # # # # # # # # #
# ## # ##### # # # #### # # # # # # #
# # # # ###### # ##### # # # # #
# # # # # # # # # # # # # #
# # ###### # # # #### # ###### #### # #
',
'
| | _) |
__ `__ \ _ \ __| _` | __| __ \ | _ \ | __|
| | | __/ | ( |\__ \ | | | ( | | |
_| _| _|\___|\__|\__,_|____/ .__/ _|\___/ _|\__|
_|
'
]
def self.to_s
Logos[rand(Logos.length)]
end
end
end
end

View File

@ -51,6 +51,18 @@ class Core
# Display one of the fabulous banners
#
def cmd_banner(*args)
banner = Banner.to_s + "\n\n"
banner += " =[ msf v#{Msf::Framework::Version}\n"
banner += "+ -- --=[ "
banner += "#{framework.stats.num_exploits} exploits - "
banner += "#{framework.stats.num_payloads} payloads\n"
banner += " =[ "
banner += "#{framework.stats.num_encoders} encoders - "
banner += "#{framework.stats.num_nops} nops"
banner += "\n\n"
# Display the banner
print(banner)
end
#

View File

@ -34,6 +34,27 @@ class Driver < Msf::Ui::Driver
# Initialize the super
super
# Process things before we actually display the prompt and get rocking
on_startup
end
#
# Called before things actually get rolling such that banners can be
# displayed, scripts can be processed, and other fun can be had.
#
def on_startup
# Prevent output from being displayed for now
self.disable_output = true
# Run a few commands to start things off
run_single("search #{File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'modules')}")
# Re-enable output
self.disable_output = false
# Build the banner message
run_single("banner")
end
#

View File

@ -29,6 +29,7 @@ module Shell
# Set the stop flag to false
self.stop_flag = false
self.disable_output = false
# Initialize the prompt
self.init_prompt = prompt
@ -119,6 +120,7 @@ module Shell
# Returns colorized text if it's supported, otherwise an empty string
#
def colorize(*color)
# This check is busted atm...
#return (supports_color? == false) ? '' : Rex::Ui::Text::Color.ansi(color)
return Rex::Ui::Text::Color.ansi(*color)
end
@ -128,21 +130,31 @@ module Shell
#
def print_error(msg)
return if (disable_output == true)
output.print_error(msg)
end
def print_status(msg)
return if (disable_output == true)
output.print_status(msg)
end
def print_line(msg)
return if (disable_output == true)
output.print_line(msg)
end
def print(msg)
return if (disable_output == true)
output.print(msg)
end
attr_accessor :disable_output
protected
#