2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2005-07-14 07:13:01 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Module that contains some most excellent banners.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
module Banner
|
|
|
|
|
2013-08-30 21:28:33 +00:00
|
|
|
Logos =
|
|
|
|
%w{
|
|
|
|
branded-longhorn.txt
|
|
|
|
cow-head.txt
|
|
|
|
cowsay.txt
|
|
|
|
figlet.txt
|
|
|
|
i-heart-shells.txt
|
|
|
|
metasploit-shield.txt
|
|
|
|
missile-command.txt
|
|
|
|
ninja.txt
|
|
|
|
null-pointer-deref.txt
|
|
|
|
r7-metasploit.txt
|
|
|
|
wake-up-neo.txt
|
|
|
|
workflow.txt
|
|
|
|
3kom-superhack.txt
|
|
|
|
}
|
2011-07-21 18:58:54 +00:00
|
|
|
|
2013-08-30 21:28:33 +00:00
|
|
|
#
|
|
|
|
# Returns a random metasploit logo.
|
|
|
|
#
|
|
|
|
def self.readfile(fname)
|
|
|
|
base = File.expand_path(File.dirname(__FILE__))
|
|
|
|
pathname = File.join(base, "logos", fname)
|
|
|
|
fdata = "<< Missing banner: #{fname} >>"
|
|
|
|
begin
|
|
|
|
raise ArgumentError unless File.readable?(pathname)
|
|
|
|
raise ArgumentError unless File.stat(pathname).size < 4096
|
|
|
|
fdata = File.open(pathname) {|f| f.read f.stat.size}
|
|
|
|
rescue SystemCallError, ArgumentError
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
return fdata
|
|
|
|
end
|
2013-01-10 01:54:08 +00:00
|
|
|
|
2013-08-30 21:28:33 +00:00
|
|
|
def self.to_s
|
|
|
|
# Easter egg (always a cow themed logo): export/set GOCOW=1
|
|
|
|
if ENV['GOCOW']
|
|
|
|
case rand(3)
|
|
|
|
when 0
|
|
|
|
# branded-longhorn
|
|
|
|
self.readfile Logos[0]
|
|
|
|
when 1
|
|
|
|
# cow-head
|
|
|
|
self.readfile Logos[1]
|
|
|
|
else
|
|
|
|
# cowsay
|
|
|
|
self.readfile Logos[2]
|
|
|
|
end
|
|
|
|
else
|
|
|
|
self.readfile Logos[rand(Logos.length)]
|
|
|
|
end
|
|
|
|
end
|
2005-07-14 07:13:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-04-01 15:12:53 +00:00
|
|
|
end
|