CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/base/simple/statistics.rb
Views: 11623
1
# -*- coding: binary -*-
2
module Msf
3
module Simple
4
5
###
6
#
7
# This class provides an interface to various statistics about the
8
# framework instance.
9
#
10
###
11
class Statistics
12
include Msf::Framework::Offspring
13
14
#
15
# Initializes the framework statistics.
16
#
17
def initialize(framework)
18
self.framework = framework
19
Msf::Modules::Metadata::Cache.instance.update_stats
20
end
21
22
#
23
# Returns the number of encoders in the framework.
24
#
25
def num_encoders
26
Msf::Modules::Metadata::Cache.instance.module_counts[:encoder]
27
end
28
29
#
30
# Returns the number of exploits in the framework.
31
#
32
def num_exploits
33
Msf::Modules::Metadata::Cache.instance.module_counts[:exploit]
34
end
35
36
#
37
# Returns the number of NOP generators in the framework.
38
#
39
def num_nops
40
Msf::Modules::Metadata::Cache.instance.module_counts[:nop]
41
end
42
43
#
44
# Returns the number of payloads in the framework.
45
#
46
def num_payloads
47
Msf::Modules::Metadata::Cache.instance.module_counts[:payload]
48
end
49
50
#
51
# Returns the number of auxiliary modules in the framework.
52
#
53
def num_auxiliary
54
Msf::Modules::Metadata::Cache.instance.module_counts[:auxiliary]
55
end
56
57
#
58
# Returns the number of post modules in the framework.
59
#
60
def num_post
61
Msf::Modules::Metadata::Cache.instance.module_counts[:post]
62
end
63
64
def num_evasion
65
Msf::Modules::Metadata::Cache.instance.module_counts[:evasion]
66
end
67
end
68
69
end
70
end
71
72