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

Includes:
Verbose
Included in:
Msf::Module::UI, Post::Windows::TaskScheduler, Rex::Proto::MSSQL::ClientMixin
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
10
# File 'lib/msf/core/module/ui/message.rb', line 7

def print_error(msg='', prefix: nil)
  msg_prefix = prefix.nil? ? print_prefix : prefix
  super(msg_prefix + msg)
end


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

def print_good(msg='', prefix: nil)
  msg_prefix = prefix.nil? ? print_prefix : prefix
  super(msg_prefix + msg)
end


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

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


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

def print_status(msg='', prefix: nil)
  msg_prefix = prefix.nil? ? print_prefix : prefix
  super(msg_prefix + msg)
end


40
41
42
43
# File 'lib/msf/core/module/ui/message.rb', line 40

def print_warning(msg='', prefix: nil)
  msg_prefix = prefix.nil? ? print_prefix : prefix
  super(msg_prefix + msg)
end