Module: Msf::Module::UI::Message

Includes:
Verbose
Included in:
Msf::Module::UI, Post::Windows::TaskScheduler
Defined in:
lib/msf/core/module/ui/message.rb

Overview

Methods for print messages with status indicators

Defined Under Namespace

Modules: Verbose

Instance Method Summary collapse

Methods included from Verbose

#vprint_error, #vprint_good, #vprint_status, #vprint_warning

Instance Method Details



7
8
9
# File 'lib/msf/core/module/ui/message.rb', line 7

def print_error(msg='')
  super(print_prefix + msg)
end


13
14
15
# File 'lib/msf/core/module/ui/message.rb', line 13

def print_good(msg='')
  super(print_prefix + msg)
end


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/msf/core/module/ui/message.rb', line 17

def print_prefix
  prefix = ''
  if datastore['TimestampOutput'] ||
      (framework && framework.datastore['TimestampOutput'])
    prefix << "[#{Time.now.strftime("%Y.%m.%d-%H:%M:%S")}] "

    xn ||= datastore['ExploitNumber']
    xn ||= framework.datastore['ExploitNumber']
    if xn.is_a?(Integer)
      prefix << "[%04d] " % xn
    end

  end
  prefix
end


33
34
35
# File 'lib/msf/core/module/ui/message.rb', line 33

def print_status(msg='')
  super(print_prefix + msg)
end


37
38
39
# File 'lib/msf/core/module/ui/message.rb', line 37

def print_warning(msg='')
  super(print_prefix + msg)
end