1061 lines
45 KiB
HTML
1061 lines
45 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>
|
|
Class: Msf::ModuleManager
|
|
|
|
— Documentation by YARD 0.9.37
|
|
|
|
</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
|
|
|
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
pathId = "Msf::ModuleManager";
|
|
relpath = '../';
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div class="nav_wrap">
|
|
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
<div id="resizer"></div>
|
|
</div>
|
|
|
|
<div id="main" tabindex="-1">
|
|
<div id="header">
|
|
<div id="menu">
|
|
|
|
<a href="../_index.html">Index (M)</a> »
|
|
<span class='title'><span class='object_link'><a href="../Msf.html" title="Msf (module)">Msf</a></span></span>
|
|
»
|
|
<span class="title">ModuleManager</span>
|
|
|
|
</div>
|
|
|
|
<div id="search">
|
|
|
|
<a class="full_list_link" id="class_list_link"
|
|
href="../class_list.html">
|
|
|
|
<svg width="24" height="24">
|
|
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
</svg>
|
|
</a>
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div id="content"><h1>Class: Msf::ModuleManager
|
|
|
|
|
|
|
|
</h1>
|
|
<div class="box_info">
|
|
|
|
<dl>
|
|
<dt>Inherits:</dt>
|
|
<dd>
|
|
<span class="inheritName">Object</span>
|
|
|
|
<ul class="fullTree">
|
|
<li>Object</li>
|
|
|
|
<li class="next">Msf::ModuleManager</li>
|
|
|
|
</ul>
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
<dt>Includes:</dt>
|
|
<dd>Enumerable, <span class='object_link'><a href="Framework/Offspring.html" title="Msf::Framework::Offspring (module)">Framework::Offspring</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html" title="Msf::ModuleManager::Cache (module)">Cache</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html" title="Msf::ModuleManager::Loading (module)">Loading</a></span>, <span class='object_link'><a href="ModuleManager/ModulePaths.html" title="Msf::ModuleManager::ModulePaths (module)">ModulePaths</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html" title="Msf::ModuleManager::ModuleSets (module)">ModuleSets</a></span>, <span class='object_link'><a href="ModuleManager/Reloading.html" title="Msf::ModuleManager::Reloading (module)">Reloading</a></span></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
<dt>Defined in:</dt>
|
|
<dd>lib/msf/core/module_manager.rb</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<h2>Overview</h2><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<div class="note todo">
|
|
<strong>TODO:</strong>
|
|
<div class='inline'>
|
|
<p>add unload support</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<p>Upper management decided to throw in some middle management because the modules were getting out of hand. This bad boy takes care of the work of managing the interaction with modules in terms of loading and instantiation.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><h2>Defined Under Namespace</h2>
|
|
<p class="children">
|
|
|
|
|
|
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ModuleManager/Cache.html" title="Msf::ModuleManager::Cache (module)">Cache</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html" title="Msf::ModuleManager::Loading (module)">Loading</a></span>, <span class='object_link'><a href="ModuleManager/ModulePaths.html" title="Msf::ModuleManager::ModulePaths (module)">ModulePaths</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html" title="Msf::ModuleManager::ModuleSets (module)">ModuleSets</a></span>, <span class='object_link'><a href="ModuleManager/Reloading.html" title="Msf::ModuleManager::Reloading (module)">Reloading</a></span>
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h2>Constant Summary</h2>
|
|
|
|
<h3 class="inherited">Constants included
|
|
from <span class='object_link'><a href="ModuleManager/Loading.html" title="Msf::ModuleManager::Loading (module)">Loading</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Loading.html#DIRECTORY_BY_TYPE-constant" title="Msf::ModuleManager::Loading::DIRECTORY_BY_TYPE (constant)">Loading::DIRECTORY_BY_TYPE</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#LOADER_CLASSES-constant" title="Msf::ModuleManager::Loading::LOADER_CLASSES (constant)">Loading::LOADER_CLASSES</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#TYPE_BY_DIRECTORY-constant" title="Msf::ModuleManager::Loading::TYPE_BY_DIRECTORY (constant)">Loading::TYPE_BY_DIRECTORY</a></span></p>
|
|
|
|
|
|
|
|
<h3 class="inherited">Constants included
|
|
from <span class='object_link'><a href="ModuleManager/Cache.html" title="Msf::ModuleManager::Cache (module)">Cache</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Cache.html#FILESYSTEM-constant" title="Msf::ModuleManager::Cache::FILESYSTEM (constant)">Cache::FILESYSTEM</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#MEMORY-constant" title="Msf::ModuleManager::Cache::MEMORY (constant)">Cache::MEMORY</a></span></p>
|
|
|
|
|
|
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
<ul class="summary">
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#aliases-instance_method" title="#aliases (instance method)">#<strong>aliases</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Returns the value of attribute aliases.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#inv_aliases-instance_method" title="#inv_aliases (instance method)">#<strong>inv_aliases</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Returns the value of attribute inv_aliases.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ModuleManager/ModuleSets.html" title="Msf::ModuleManager::ModuleSets (module)">ModuleSets</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/ModuleSets.html#enablement_by_type-instance_method" title="Msf::ModuleManager::ModuleSets#enablement_by_type (method)">#enablement_by_type</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#module_set_by_type-instance_method" title="Msf::ModuleManager::ModuleSets#module_set_by_type (method)">#module_set_by_type</a></span></p>
|
|
|
|
|
|
|
|
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ModuleManager/ModulePaths.html" title="Msf::ModuleManager::ModulePaths (module)">ModulePaths</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/ModulePaths.html#module_paths-instance_method" title="Msf::ModuleManager::ModulePaths#module_paths (method)">#module_paths</a></span></p>
|
|
|
|
|
|
|
|
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ModuleManager/Loading.html" title="Msf::ModuleManager::Loading (module)">Loading</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Loading.html#module_load_error_by_path-instance_method" title="Msf::ModuleManager::Loading#module_load_error_by_path (method)">#module_load_error_by_path</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#module_load_warnings-instance_method" title="Msf::ModuleManager::Loading#module_load_warnings (method)">#module_load_warnings</a></span></p>
|
|
|
|
|
|
|
|
<h3 class="inherited">Attributes included from <span class='object_link'><a href="ModuleManager/Cache.html" title="Msf::ModuleManager::Cache (module)">Cache</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Cache.html#module_info_by_path-instance_method" title="Msf::ModuleManager::Cache#module_info_by_path (method)">#module_info_by_path</a></span></p>
|
|
|
|
|
|
|
|
<h3 class="inherited">Attributes included from <span class='object_link'><a href="Framework/Offspring.html" title="Msf::Framework::Offspring (module)">Framework::Offspring</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="Framework/Offspring.html#framework-instance_method" title="Msf::Framework::Offspring#framework (method)">#framework</a></span></p>
|
|
|
|
|
|
|
|
<h2>
|
|
Instance Method Summary
|
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
</h2>
|
|
|
|
<ul class="summary">
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#[]-instance_method" title="#[] (instance method)">#<strong>[]</strong>(key) ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#auto_subscribe_module-instance_method" title="#auto_subscribe_module (instance method)">#<strong>auto_subscribe_module</strong>(klass) ⇒ void </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>This method automatically subscribes a module to whatever event providers it wishes to monitor.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#create-instance_method" title="#create (instance method)">#<strong>create</strong>(name, aliased_as: nil) ⇒ Msf::Module<sup>?</sup> </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Creates a module instance using the supplied reference name.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> {|name, mod_class| ... } ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Iterate over all modules in all sets.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(framework, types = Msf::MODULE_TYPES) ⇒ ModuleManager </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="note title constructor">constructor</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>A new instance of ModuleManager.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ModuleManager/Reloading.html" title="Msf::ModuleManager::Reloading (module)">Reloading</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Reloading.html#manual_reload-instance_method" title="Msf::ModuleManager::Reloading#manual_reload (method)">#manual_reload</a></span>, <span class='object_link'><a href="ModuleManager/Reloading.html#reload_module-instance_method" title="Msf::ModuleManager::Reloading#reload_module (method)">#reload_module</a></span>, <span class='object_link'><a href="ModuleManager/Reloading.html#reload_modules-instance_method" title="Msf::ModuleManager::Reloading#reload_modules (method)">#reload_modules</a></span>, <span class='object_link'><a href="ModuleManager/Reloading.html#reload_payload_module-instance_method" title="Msf::ModuleManager::Reloading#reload_payload_module (method)">#reload_payload_module</a></span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ModuleManager/ModuleSets.html" title="Msf::ModuleManager::ModuleSets (module)">ModuleSets</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/ModuleSets.html#auxiliary-instance_method" title="Msf::ModuleManager::ModuleSets#auxiliary (method)">#auxiliary</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#encoders-instance_method" title="Msf::ModuleManager::ModuleSets#encoders (method)">#encoders</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#evasion-instance_method" title="Msf::ModuleManager::ModuleSets#evasion (method)">#evasion</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#exploits-instance_method" title="Msf::ModuleManager::ModuleSets#exploits (method)">#exploits</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#init_module_set-instance_method" title="Msf::ModuleManager::ModuleSets#init_module_set (method)">#init_module_set</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#module_names-instance_method" title="Msf::ModuleManager::ModuleSets#module_names (method)">#module_names</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#module_set-instance_method" title="Msf::ModuleManager::ModuleSets#module_set (method)">#module_set</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#module_types-instance_method" title="Msf::ModuleManager::ModuleSets#module_types (method)">#module_types</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#nops-instance_method" title="Msf::ModuleManager::ModuleSets#nops (method)">#nops</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#payloads-instance_method" title="Msf::ModuleManager::ModuleSets#payloads (method)">#payloads</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#post-instance_method" title="Msf::ModuleManager::ModuleSets#post (method)">#post</a></span>, <span class='object_link'><a href="ModuleManager/ModuleSets.html#type_enabled%3F-instance_method" title="Msf::ModuleManager::ModuleSets#type_enabled? (method)">#type_enabled?</a></span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ModuleManager/ModulePaths.html" title="Msf::ModuleManager::ModulePaths (module)">ModulePaths</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/ModulePaths.html#add_module_path-instance_method" title="Msf::ModuleManager::ModulePaths#add_module_path (method)">#add_module_path</a></span>, <span class='object_link'><a href="ModuleManager/ModulePaths.html#remove_module_path-instance_method" title="Msf::ModuleManager::ModulePaths#remove_module_path (method)">#remove_module_path</a></span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ModuleManager/Loading.html" title="Msf::ModuleManager::Loading (module)">Loading</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Loading.html#file_changed%3F-instance_method" title="Msf::ModuleManager::Loading#file_changed? (method)">#file_changed?</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#get_module_error-instance_method" title="Msf::ModuleManager::Loading#get_module_error (method)">#get_module_error</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#load_error_by_name-instance_method" title="Msf::ModuleManager::Loading#load_error_by_name (method)">#load_error_by_name</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#load_modules-instance_method" title="Msf::ModuleManager::Loading#load_modules (method)">#load_modules</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#loaders-instance_method" title="Msf::ModuleManager::Loading#loaders (method)">#loaders</a></span>, <span class='object_link'><a href="ModuleManager/Loading.html#on_module_load-instance_method" title="Msf::ModuleManager::Loading#on_module_load (method)">#on_module_load</a></span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="ModuleManager/Cache.html" title="Msf::ModuleManager::Cache (module)">Cache</a></span></h3>
|
|
<p class="inherited"><span class='object_link'><a href="ModuleManager/Cache.html#cache_empty%3F-instance_method" title="Msf::ModuleManager::Cache#cache_empty? (method)">#cache_empty?</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#cache_in_memory-instance_method" title="Msf::ModuleManager::Cache#cache_in_memory (method)">#cache_in_memory</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#get_parent_path-instance_method" title="Msf::ModuleManager::Cache#get_parent_path (method)">#get_parent_path</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#load_cached_module-instance_method" title="Msf::ModuleManager::Cache#load_cached_module (method)">#load_cached_module</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#module_info_by_path_from_database!-instance_method" title="Msf::ModuleManager::Cache#module_info_by_path_from_database! (method)">#module_info_by_path_from_database!</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#refresh_cache_from_database-instance_method" title="Msf::ModuleManager::Cache#refresh_cache_from_database (method)">#refresh_cache_from_database</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#refresh_cache_from_module_files-instance_method" title="Msf::ModuleManager::Cache#refresh_cache_from_module_files (method)">#refresh_cache_from_module_files</a></span>, <span class='object_link'><a href="ModuleManager/Cache.html#try_load_module-instance_method" title="Msf::ModuleManager::Cache#try_load_module (method)">#try_load_module</a></span></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="constructor_details" class="method_details_list">
|
|
<h2>Constructor Details</h2>
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="initialize-instance_method">
|
|
|
|
#<strong>initialize</strong>(framework, types = Msf::MODULE_TYPES) ⇒ <tt><span class='object_link'><a href="" title="Msf::ModuleManager (class)">ModuleManager</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of ModuleManager.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>framework</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Framework.html" title="Msf::Framework (class)">Msf::Framework</a></span></tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The framework for which this instance is managing the modules.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>types</span>
|
|
|
|
|
|
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
|
|
|
|
<em class="default">(defaults to: <tt>Msf::MODULE_TYPES</tt>)</em>
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>List of module types to load. Defaults to all module types in <span class='object_link'><a href="../Msf.html#MODULE_TYPES-constant" title="Msf::MODULE_TYPES (constant)">Msf::MODULE_TYPES</a></span>.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
114
|
|
115
|
|
116
|
|
117
|
|
118
|
|
119
|
|
120
|
|
121
|
|
122
|
|
123
|
|
124
|
|
125
|
|
126
|
|
127
|
|
128
|
|
129
|
|
130
|
|
131
|
|
132
|
|
133
|
|
134
|
|
135
|
|
136
|
|
137</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 114</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_framework'>framework</span><span class='comma'>,</span> <span class='id identifier rubyid_types'>types</span><span class='op'>=</span><span class='const'>Msf</span><span class='op'>::</span><span class='const'>MODULE_TYPES</span><span class='rparen'>)</span>
|
|
<span class='comment'>#
|
|
</span> <span class='comment'># defaults
|
|
</span> <span class='comment'>#
|
|
</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_info_by_path'>module_info_by_path</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_enablement_by_type'>enablement_by_type</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_load_error_by_path'>module_load_error_by_path</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_load_warnings'>module_load_warnings</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_paths'>module_paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_set_by_type'>module_set_by_type</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inv_aliases'>inv_aliases</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_invert'>invert</span>
|
|
|
|
<span class='comment'>#
|
|
</span> <span class='comment'># from arguments
|
|
</span> <span class='comment'>#
|
|
</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_framework'>framework</span> <span class='op'>=</span> <span class='id identifier rubyid_framework'>framework</span>
|
|
|
|
<span class='id identifier rubyid_types'>types</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_type'>type</span><span class='op'>|</span>
|
|
<span class='id identifier rubyid_init_module_set'>init_module_set</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
|
<span class='rbrace'>}</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="instance_attr_details" class="attr_details">
|
|
<h2>Instance Attribute Details</h2>
|
|
|
|
|
|
<span id="aliases=-instance_method"></span>
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="aliases-instance_method">
|
|
|
|
#<strong>aliases</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns the value of attribute aliases.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
141
|
|
142
|
|
143</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 141</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_aliases'>aliases</span>
|
|
<span class='ivar'>@aliases</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="inv_aliases=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="inv_aliases-instance_method">
|
|
|
|
#<strong>inv_aliases</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns the value of attribute inv_aliases.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
141
|
|
142
|
|
143</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 141</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_inv_aliases'>inv_aliases</span>
|
|
<span class='ivar'>@inv_aliases</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="instance_method_details" class="method_details_list">
|
|
<h2>Instance Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="[]-instance_method">
|
|
|
|
#<strong>[]</strong>(key) ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
31
|
|
32
|
|
33
|
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
|
39
|
|
40
|
|
41</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 31</span>
|
|
|
|
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span>
|
|
|
|
<span class='id identifier rubyid_module_set'>module_set</span> <span class='op'>=</span> <span class='id identifier rubyid_module_set_by_type'>module_set_by_type</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span>
|
|
|
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_module_set'>module_set</span>
|
|
|
|
<span class='id identifier rubyid_module_reference_name'>module_reference_name</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_module_set'>module_set</span><span class='lbracket'>[</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='rbracket'>]</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="auto_subscribe_module-instance_method">
|
|
|
|
#<strong>auto_subscribe_module</strong>(klass) ⇒ <tt>void</tt> <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|
<p>This method automatically subscribes a module to whatever event providers it wishes to monitor. This can be used to allow modules to automatically execute or perform other tasks when certain events occur. For instance, when a new host is detected, other auxiliary modules may wish to run such that they can collect more information about the host that was detected.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>klass</span>
|
|
|
|
|
|
<span class='type'>(<tt>Class<<span class='object_link'><a href="Module.html" title="Msf::Module (class)">Msf::Module</a></span>></tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The module class</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
152
|
|
153
|
|
154
|
|
155
|
|
156
|
|
157
|
|
158
|
|
159
|
|
160
|
|
161
|
|
162
|
|
163
|
|
164
|
|
165
|
|
166
|
|
167
|
|
168
|
|
169
|
|
170
|
|
171</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 152</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_auto_subscribe_module'>auto_subscribe_module</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
|
|
|
|
<span class='comment'># If auto-subscription is enabled (which it is by default), figure out
|
|
</span> <span class='comment'># if it subscribes to any particular interfaces.
|
|
</span> <span class='id identifier rubyid_inst'>inst</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
|
|
<span class='comment'>#
|
|
</span> <span class='comment'># Exploit event subscriber check
|
|
</span> <span class='comment'>#
|
|
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ExploitEvent.html" title="Msf::ExploitEvent (module)">ExploitEvent</a></span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_add_exploit_subscriber'>add_exploit_subscriber</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_inst'>inst</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_inst'>inst</span> <span class='op'>:</span> <span class='lparen'>(</span><span class='id identifier rubyid_inst'>inst</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='comment'>#
|
|
</span> <span class='comment'># Session event subscriber check
|
|
</span> <span class='comment'>#
|
|
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SessionEvent.html" title="Msf::SessionEvent (module)">SessionEvent</a></span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_events'>events</span><span class='period'>.</span><span class='id identifier rubyid_add_session_subscriber'>add_session_subscriber</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_inst'>inst</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_inst'>inst</span> <span class='op'>:</span> <span class='lparen'>(</span><span class='id identifier rubyid_inst'>inst</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="create-instance_method">
|
|
|
|
#<strong>create</strong>(name, aliased_as: nil) ⇒ <tt><span class='object_link'><a href="Module.html" title="Msf::Module (class)">Msf::Module</a></span></tt><sup>?</sup>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Creates a module instance using the supplied reference name.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>name</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>A module reference name. It may optionally be prefixed with a "<type>/", in which case the module will be created from the <span class='object_link'><a href="ModuleSet.html" title="Msf::ModuleSet (class)">Msf::ModuleSet</a></span> for the given <type>. Otherwise, we step through all sets until we find one that matches.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Module.html" title="Msf::Module (class)">Msf::Module</a></span></tt>, <tt>nil</tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>Instance of the named module or nil if it could not be created.</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
51
|
|
52
|
|
53
|
|
54
|
|
55
|
|
56
|
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
|
62
|
|
63
|
|
64
|
|
65
|
|
66
|
|
67
|
|
68
|
|
69
|
|
70
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75
|
|
76
|
|
77
|
|
78
|
|
79
|
|
80
|
|
81
|
|
82
|
|
83
|
|
84
|
|
85
|
|
86
|
|
87
|
|
88
|
|
89
|
|
90
|
|
91
|
|
92
|
|
93
|
|
94
|
|
95
|
|
96</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 51</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>aliased_as:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
<span class='comment'># First, a direct alias check
|
|
</span> <span class='kw'>return</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>aliased_as:</span> <span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
|
|
|
|
<span class='comment'># Check to see if it has a module type prefix. If it does,
|
|
</span> <span class='comment'># try to load it from the specific module set for that type.
|
|
</span> <span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_potential_type_or_directory'>potential_type_or_directory</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
|
|
|
<span class='comment'># if first name is a type
|
|
</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="ModuleManager/Loading.html#DIRECTORY_BY_TYPE-constant" title="Msf::ModuleManager::Loading::DIRECTORY_BY_TYPE (constant)">DIRECTORY_BY_TYPE</a></span></span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='id identifier rubyid_potential_type_or_directory'>potential_type_or_directory</span>
|
|
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_potential_type_or_directory'>potential_type_or_directory</span>
|
|
<span class='comment'># if first name is a type directory
|
|
</span> <span class='kw'>else</span>
|
|
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ModuleManager/Loading.html#TYPE_BY_DIRECTORY-constant" title="Msf::ModuleManager::Loading::TYPE_BY_DIRECTORY (constant)">TYPE_BY_DIRECTORY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_potential_type_or_directory'>potential_type_or_directory</span><span class='rbracket'>]</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='id identifier rubyid_module_instance'>module_instance</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span>
|
|
<span class='id identifier rubyid_module_set'>module_set</span> <span class='op'>=</span> <span class='id identifier rubyid_module_set_by_type'>module_set_by_type</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span>
|
|
|
|
<span class='comment'># First element in names is the type, so skip it
|
|
</span> <span class='id identifier rubyid_module_reference_name'>module_reference_name</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='lbracket'>[</span><span class='int'>1</span> <span class='op'>..</span> <span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'><span class='object_link'><a href="../top-level-namespace.html#join-instance_method" title="#join (method)">join</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_module_instance'>module_instance</span> <span class='op'>=</span> <span class='id identifier rubyid_module_set'>module_set</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='rparen'>)</span>
|
|
<span class='kw'>else</span>
|
|
<span class='comment'># Then we don't have a type, so we have to step through each set
|
|
</span> <span class='comment'># to see if we can create this module.
|
|
</span> <span class='id identifier rubyid_module_set_by_type'>module_set_by_type</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_aliased'>aliased</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
|
<span class='id identifier rubyid_module_instance'>module_instance</span> <span class='op'>=</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_aliased'>aliased</span><span class='comma'>,</span> <span class='label'>aliased_as:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='kw'>else</span>
|
|
<span class='id identifier rubyid_module_reference_name'>module_reference_name</span> <span class='op'>=</span> <span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_module_instance'>module_instance</span> <span class='op'>=</span> <span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_module_instance'>module_instance</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_module_instance'>module_instance</span>
|
|
<span class='comment'># If the module instance is populated by one of the recursive `create`
|
|
</span> <span class='comment'># calls this field may be set and we'll want to keep its original value
|
|
</span> <span class='id identifier rubyid_module_instance'>module_instance</span><span class='period'>.</span><span class='id identifier rubyid_aliased_as'>aliased_as</span> <span class='op'>||=</span> <span class='id identifier rubyid_aliased_as'>aliased_as</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='id identifier rubyid_module_instance'>module_instance</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="each-instance_method">
|
|
|
|
#<strong>each</strong> {|name, mod_class| ... } ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Iterate over all modules in all sets</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Yield Parameters:</p>
|
|
<ul class="yieldparam">
|
|
|
|
<li>
|
|
|
|
<span class='name'>name</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The module's reference name</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<span class='name'>mod_class</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Module.html" title="Msf::Module (class)">Msf::Module</a></span></tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>A module class</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
103
|
|
104
|
|
105
|
|
106
|
|
107
|
|
108
|
|
109</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager.rb', line 103</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
|
|
<span class='id identifier rubyid_module_set_by_type'>module_set_by_type</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_set'>set</span><span class='op'>|</span>
|
|
<span class='id identifier rubyid_set'>set</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mod_class'>mod_class</span><span class='op'>|</span>
|
|
<span class='kw'>yield</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mod_class'>mod_class</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
Generated on Fri May 8 17:03:23 2026 by
|
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
0.9.37 (ruby-3.1.5).
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html> |