Module: Msf::Ui::Banner

Defined in:
lib/msf/ui/banner.rb

Overview

Module that contains some most excellent banners.

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.readfile(fname) ⇒ Object

Returns a random metasploit logo.


32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/msf/ui/banner.rb', line 32

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

.to_sObject


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/msf/ui/banner.rb', line 46

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