Class: Msf::Simple::Statistics

Inherits:
Object
  • Object
show all
Includes:
Framework::Offspring
Defined in:
lib/msf/base/simple/statistics.rb

Overview

This class provides an interface to various statistics about the framework instance.

Instance Attribute Summary

Attributes included from Framework::Offspring

#framework

Instance Method Summary collapse

Constructor Details

#initialize(framework) ⇒ Statistics

Initializes the framework statistics.



17
18
19
# File 'lib/msf/base/simple/statistics.rb', line 17

def initialize(framework)
  self.framework = framework
end

Instance Method Details

#num_auxiliaryObject

Returns the number of auxiliary modules in the framework.



56
57
58
59
# File 'lib/msf/base/simple/statistics.rb', line 56

def num_auxiliary
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:auxiliary]
end

#num_encodersObject

Returns the number of encoders in the framework.



24
25
26
27
# File 'lib/msf/base/simple/statistics.rb', line 24

def num_encoders
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:encoder]
end

#num_evasionObject



69
70
71
72
# File 'lib/msf/base/simple/statistics.rb', line 69

def num_evasion
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:evasion]
end

#num_exploitsObject

Returns the number of exploits in the framework.



32
33
34
35
# File 'lib/msf/base/simple/statistics.rb', line 32

def num_exploits
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:exploit]
end

#num_nopsObject

Returns the number of NOP generators in the framework.



40
41
42
43
# File 'lib/msf/base/simple/statistics.rb', line 40

def num_nops
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:nop]
end

#num_payloadsObject

Returns the number of payloads in the framework.



48
49
50
51
# File 'lib/msf/base/simple/statistics.rb', line 48

def num_payloads
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:payload]
end

#num_postObject

Returns the number of post modules in the framework.



64
65
66
67
# File 'lib/msf/base/simple/statistics.rb', line 64

def num_post
  ensure_stats_loaded
  Msf::Modules::Metadata::Cache.instance.module_counts[:post]
end