2012-06-29 00:18:28 -05:00
|
|
|
# -*- coding: binary -*-
|
2005-07-14 06:34:58 +00:00
|
|
|
module Msf
|
|
|
|
|
module Simple
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
|
#
|
|
|
|
|
# This class provides an interface to various statistics about the
|
|
|
|
|
# framework instance.
|
|
|
|
|
#
|
|
|
|
|
###
|
|
|
|
|
class Statistics
|
|
|
|
|
include Msf::Framework::Offspring
|
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
|
|
|
|
# Initializes the framework statistics.
|
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def initialize(framework)
|
|
|
|
|
self.framework = framework
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.update_stats
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
|
|
|
|
# Returns the number of encoders in the framework.
|
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_encoders
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:encoder]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
|
|
|
|
# Returns the number of exploits in the framework.
|
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_exploits
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:exploit]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Returns the number of NOP generators in the framework.
|
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_nops
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:nop]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
|
|
|
|
# Returns the number of payloads in the framework.
|
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_payloads
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:payload]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
|
|
|
|
#
|
2006-01-24 03:59:44 +00:00
|
|
|
# Returns the number of auxiliary modules in the framework.
|
2005-11-15 15:11:43 +00:00
|
|
|
#
|
2006-01-24 03:59:44 +00:00
|
|
|
def num_auxiliary
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:auxiliary]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
2011-05-04 08:50:38 +00:00
|
|
|
#
|
|
|
|
|
# Returns the number of post modules in the framework.
|
|
|
|
|
#
|
|
|
|
|
def num_post
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:post]
|
2011-05-04 08:50:38 +00:00
|
|
|
end
|
|
|
|
|
|
2018-08-02 11:54:38 -05:00
|
|
|
def num_evasion
|
2023-07-06 16:15:34 +01:00
|
|
|
Msf::Modules::Metadata::Cache.instance.module_counts[:evasion]
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
2011-05-04 08:50:38 +00:00
|
|
|
end
|