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
|
|
|
|
|
|
|
|
Logos =
|
2013-01-10 01:54:08 +00:00
|
|
|
%w{
|
|
|
|
wake-up-neo.txt
|
|
|
|
cow-head.txt
|
|
|
|
r7-metasploit.txt
|
|
|
|
figlet.txt
|
|
|
|
i-heart-shells.txt
|
|
|
|
branded-longhorn.txt
|
|
|
|
cowsay.txt
|
|
|
|
3kom-superhack.txt
|
|
|
|
missile-command.txt
|
|
|
|
null-pointer-deref.txt
|
|
|
|
metasploit-shield.txt
|
|
|
|
ninja.txt
|
|
|
|
workflow.txt
|
|
|
|
}
|
2011-07-21 18:58:54 +00:00
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
|
|
|
# Returns a random metasploit logo.
|
|
|
|
#
|
2013-01-10 01:54:08 +00:00
|
|
|
|
|
|
|
def self.readfile(fname)
|
|
|
|
base = File.expand_path(File.dirname(__FILE__))
|
2013-01-10 02:38:14 +00:00
|
|
|
pathname = File.join(base, "logos", fname)
|
2013-01-10 04:32:53 +00:00
|
|
|
fdata = "<< Missing banner: #{fname} >>"
|
2013-01-10 02:38:14 +00:00
|
|
|
begin
|
2013-01-10 04:32:53 +00:00
|
|
|
raise ArgumentError unless File.readable?(pathname)
|
|
|
|
raise ArgumentError unless File.stat(pathname).size < 4096
|
2013-01-10 02:38:14 +00:00
|
|
|
fdata = File.open(pathname) {|f| f.read f.stat.size}
|
2013-01-10 04:32:53 +00:00
|
|
|
rescue SystemCallError, ArgumentError
|
|
|
|
nil
|
2013-01-10 02:38:14 +00:00
|
|
|
end
|
2013-01-10 04:32:53 +00:00
|
|
|
return fdata
|
2013-01-10 01:54:08 +00:00
|
|
|
end
|
|
|
|
|
2011-04-02 15:51:48 +00:00
|
|
|
def self.to_s
|
2011-07-23 01:01:38 +00:00
|
|
|
if ENV['GOCOW']
|
2013-01-10 02:38:14 +00:00
|
|
|
case rand(3)
|
2011-07-23 01:01:38 +00:00
|
|
|
when 0
|
2013-01-10 01:54:08 +00:00
|
|
|
self.readfile Logos[1]
|
2011-07-23 01:01:38 +00:00
|
|
|
when 1
|
2013-01-10 01:54:08 +00:00
|
|
|
self.readfile Logos[5]
|
2013-01-10 02:38:14 +00:00
|
|
|
when 2
|
|
|
|
self.readfile Logos[6]
|
2011-07-23 01:01:38 +00:00
|
|
|
end
|
|
|
|
else
|
2013-01-10 01:54:08 +00:00
|
|
|
self.readfile Logos[rand(Logos.length)]
|
2011-07-23 01:01:38 +00:00
|
|
|
end
|
2005-07-14 07:13:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-04-01 15:12:53 +00:00
|
|
|
end
|
|
|
|
|