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
|
|
|
|
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
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.modules.using_cache ?
|
|
|
|
framework.modules.cached_counts[MODULE_ENCODER] :
|
|
|
|
framework.encoders.length
|
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
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.modules.using_cache ?
|
|
|
|
framework.modules.cached_counts[MODULE_EXPLOIT] :
|
|
|
|
framework.exploits.length
|
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
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.modules.using_cache ?
|
|
|
|
framework.modules.cached_counts[MODULE_NOP] :
|
|
|
|
framework.nops.length
|
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
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.modules.using_cache ?
|
|
|
|
framework.modules.cached_counts[MODULE_PAYLOAD] :
|
|
|
|
framework.payloads.length
|
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
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.modules.using_cache ?
|
|
|
|
framework.modules.cached_counts[MODULE_AUX] :
|
|
|
|
framework.auxiliary.length
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the number of stages in the framework.
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_payload_stages
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.payloads.stages.length
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the number of stagers in the framework.
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_payload_stagers
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.payloads.stagers.length
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
2005-11-15 15:11:43 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the number of singles in the framework.
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def num_payload_singles
|
2006-02-21 03:10:58 +00:00
|
|
|
framework.payloads.singles.length
|
2005-07-14 06:34:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|