1236 lines
44 KiB
HTML
1236 lines
44 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
|
<title>
|
|||
|
|
Module: Msf::ModuleManager::Loading
|
|||
|
|
|
|||
|
|
— 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::Loading";
|
|||
|
|
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 (L)</a> »
|
|||
|
|
<span class='title'><span class='object_link'><a href="../../Msf.html" title="Msf (module)">Msf</a></span></span> » <span class='title'><span class='object_link'><a href="../ModuleManager.html" title="Msf::ModuleManager (class)">ModuleManager</a></span></span>
|
|||
|
|
»
|
|||
|
|
<span class="title">Loading</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>Module: Msf::ModuleManager::Loading
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h1>
|
|||
|
|
<div class="box_info">
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Extended by:</dt>
|
|||
|
|
<dd>ActiveSupport::Concern</dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Included in:</dt>
|
|||
|
|
<dd><span class='object_link'><a href="../ModuleManager.html" title="Msf::ModuleManager (class)">Msf::ModuleManager</a></span></dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Defined in:</dt>
|
|||
|
|
<dd>lib/msf/core/module_manager/loading.rb</dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<h2>Overview</h2><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Project</p>
|
|||
|
|
|
|||
|
|
<p>Deals with loading modules for the <span class='object_link'><a href="../ModuleManager.html" title="Msf::ModuleManager (class)">Msf::ModuleManager</a></span></p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<h2>
|
|||
|
|
Constant Summary
|
|||
|
|
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|||
|
|
</h2>
|
|||
|
|
|
|||
|
|
<dl class="constants">
|
|||
|
|
|
|||
|
|
<dt id="LOADER_CLASSES-constant" class="">LOADER_CLASSES =
|
|||
|
|
<div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Classes that can be used to load modules.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</dt>
|
|||
|
|
<dd><pre class="code"><span class='lbracket'>[</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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader.html" title="Msf::Modules::Loader (module)">Loader</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Directory.html" title="Msf::Modules::Loader::Directory (class)">Directory</a></span></span><span class='comma'>,</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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader.html" title="Msf::Modules::Loader (module)">Loader</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Executable.html" title="Msf::Modules::Loader::Executable (class)">Executable</a></span></span> <span class='comment'># TODO: XXX: When this is the first loader we can load normal exploits, but not payloads
|
|||
|
|
</span><span class='rbracket'>]</span></pre></dd>
|
|||
|
|
|
|||
|
|
<dt id="DIRECTORY_BY_TYPE-constant" class="">DIRECTORY_BY_TYPE =
|
|||
|
|
<div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Maps module type directory to its module type.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</dt>
|
|||
|
|
<dd><pre class="code"><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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader.html" title="Msf::Modules::Loader (module)">Loader</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Base.html" title="Msf::Modules::Loader::Base (class)">Base</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Base.html#DIRECTORY_BY_TYPE-constant" title="Msf::Modules::Loader::Base::DIRECTORY_BY_TYPE (constant)">DIRECTORY_BY_TYPE</a></span></span></pre></dd>
|
|||
|
|
|
|||
|
|
<dt id="TYPE_BY_DIRECTORY-constant" class="">TYPE_BY_DIRECTORY =
|
|||
|
|
|
|||
|
|
</dt>
|
|||
|
|
<dd><pre class="code"><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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader.html" title="Msf::Modules::Loader (module)">Loader</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Base.html" title="Msf::Modules::Loader::Base (class)">Base</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Loader/Base.html#TYPE_BY_DIRECTORY-constant" title="Msf::Modules::Loader::Base::TYPE_BY_DIRECTORY (constant)">TYPE_BY_DIRECTORY</a></span></span></pre></dd>
|
|||
|
|
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|||
|
|
<ul class="summary">
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#module_load_error_by_path-instance_method" title="#module_load_error_by_path (instance method)">#<strong>module_load_error_by_path</strong> ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Returns the value of attribute module_load_error_by_path.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#module_load_warnings-instance_method" title="#module_load_warnings (instance method)">#<strong>module_load_warnings</strong> ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Returns the value of attribute module_load_warnings.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<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="#file_changed%3F-instance_method" title="#file_changed? (instance method)">#<strong>file_changed?</strong>(path) ⇒ Boolean </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="protected ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#get_module_error-instance_method" title="#get_module_error (instance method)">#<strong>get_module_error</strong>(module_reference_name, type) ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="note title protected">protected</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Get a specific modules errors from the supplied module_reference_name and type.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#load_error_by_name-instance_method" title="#load_error_by_name (instance method)">#<strong>load_error_by_name</strong>(name) ⇒ error </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Return errors associated with the supplied reference name.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="protected ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#load_modules-instance_method" title="#load_modules (instance method)">#<strong>load_modules</strong>(path, options = {}) ⇒ Hash{String => Integer} </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="note title protected">protected</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Load all of the modules from the supplied directory or archive.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="protected ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#loaders-instance_method" title="#loaders (instance method)">#<strong>loaders</strong> ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="note title protected">protected</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Return list of <span class='object_link'><a href="#LOADER_CLASSES-constant" title="Msf::ModuleManager::Loading::LOADER_CLASSES (constant)">LOADER_CLASSES</a></span> instances that load modules into this module manager.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#on_module_load-instance_method" title="#on_module_load (instance method)">#<strong>on_module_load</strong>(class_or_module, type, reference_name, info = {}) ⇒ void </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Called when a module is initially loaded such that it can be categorized accordingly.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div id="instance_attr_details" class="attr_details">
|
|||
|
|
<h2>Instance Attribute Details</h2>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span id="module_load_error_by_path=-instance_method"></span>
|
|||
|
|
<div class="method_details first">
|
|||
|
|
<h3 class="signature first" id="module_load_error_by_path-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>module_load_error_by_path</strong> ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns the value of attribute module_load_error_by_path.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
90
|
|||
|
|
91
|
|||
|
|
92</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 90</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_load_error_by_path'>module_load_error_by_path</span>
|
|||
|
|
<span class='ivar'>@module_load_error_by_path</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span id="module_load_warnings=-instance_method"></span>
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="module_load_warnings-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>module_load_warnings</strong> ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns the value of attribute module_load_warnings.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
90
|
|||
|
|
91
|
|||
|
|
92</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 90</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_load_warnings'>module_load_warnings</span>
|
|||
|
|
<span class='ivar'>@module_load_warnings</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="file_changed?-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>file_changed?</strong>(path) ⇒ <tt>Boolean</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
28
|
|||
|
|
29
|
|||
|
|
30
|
|||
|
|
31
|
|||
|
|
32
|
|||
|
|
33
|
|||
|
|
34
|
|||
|
|
35
|
|||
|
|
36
|
|||
|
|
37
|
|||
|
|
38
|
|||
|
|
39
|
|||
|
|
40
|
|||
|
|
41
|
|||
|
|
42
|
|||
|
|
43
|
|||
|
|
44
|
|||
|
|
45
|
|||
|
|
46
|
|||
|
|
47
|
|||
|
|
48
|
|||
|
|
49
|
|||
|
|
50
|
|||
|
|
51
|
|||
|
|
52
|
|||
|
|
53
|
|||
|
|
54</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 28</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_file_changed?'>file_changed?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_changed'>changed</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_module_info'>module_info</span> <span class='op'>=</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='lbracket'>[</span><span class='id identifier rubyid_path'>path</span><span class='rbracket'>]</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># if uncached then it counts as changed
|
|||
|
|
</span> <span class='comment'># Payloads can't be cached due to stage/stager matching
|
|||
|
|
</span> <span class='kw'>if</span> <span class='id identifier rubyid_module_info'>module_info</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='id identifier rubyid_module_info'>module_info</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>==</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="../../Msf.html#MODULE_PAYLOAD-constant" title="Msf::MODULE_PAYLOAD (constant)">MODULE_PAYLOAD</a></span></span>
|
|||
|
|
<span class='id identifier rubyid_changed'>changed</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='kw'>else</span>
|
|||
|
|
<span class='kw'>begin</span>
|
|||
|
|
<span class='id identifier rubyid_current_modification_time'>current_modification_time</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_mtime'>mtime</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|||
|
|
<span class='kw'>rescue</span> <span class='op'>::</span><span class='const'>Errno</span><span class='op'>::</span><span class='const'>ENOENT</span>
|
|||
|
|
<span class='comment'># if the file does not exist now, that's a change
|
|||
|
|
</span> <span class='id identifier rubyid_changed'>changed</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='kw'>else</span>
|
|||
|
|
<span class='id identifier rubyid_cached_modification_time'>cached_modification_time</span> <span class='op'>=</span> <span class='id identifier rubyid_module_info'>module_info</span><span class='lbracket'>[</span><span class='symbol'>:modification_time</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># if the file's modification time's different from the cache, then it's changed
|
|||
|
|
</span> <span class='kw'>if</span> <span class='id identifier rubyid_current_modification_time'>current_modification_time</span> <span class='op'>!=</span> <span class='id identifier rubyid_cached_modification_time'>cached_modification_time</span>
|
|||
|
|
<span class='id identifier rubyid_changed'>changed</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_changed'>changed</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="get_module_error-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>get_module_error</strong>(module_reference_name, type) ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Get a specific modules errors from the supplied module_reference_name and type</p>
|
|||
|
|
|
|||
|
|
<p>These @params will the be used to loop through ‘module_info_by_path` [Hash] to check for any matching modules paths. This path becomes the key and returns the associated error.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>module_reference_name</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>e.g. 'scanner/msmail/host_id'</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>type</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>this will be the type of module e.g. 'auxiliary'</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
186
|
|||
|
|
187
|
|||
|
|
188
|
|||
|
|
189
|
|||
|
|
190
|
|||
|
|
191
|
|||
|
|
192
|
|||
|
|
193</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 186</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_module_error'>get_module_error</span><span class='lparen'>(</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_module_info_by_path'>module_info_by_path</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_mod_path'>mod_path</span><span class='comma'>,</span> <span class='id identifier rubyid_module_value'>module_value</span><span class='op'>|</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_module_value'>module_value</span><span class='lbracket'>[</span><span class='symbol'>:reference_name</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_module_reference_name'>module_reference_name</span> <span class='op'>&&</span> <span class='id identifier rubyid_module_value'>module_value</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_type'>type</span>
|
|||
|
|
<span class='kw'>return</span> <span class='id identifier rubyid_module_load_error_by_path'>module_load_error_by_path</span><span class='lbracket'>[</span><span class='id identifier rubyid_mod_path'>mod_path</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>nil</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="load_error_by_name-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>load_error_by_name</strong>(name) ⇒ <tt>error</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Return errors associated with 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>e.g. 'auxiliary/scanner/msmail/host_id' It may optionally be prefixed with a "<type>/", in which case we will pass it to 'get_module_error(module_reference_name, 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>error</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>which will return either an error or nil.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
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</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 64</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_load_error_by_name'>load_error_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>return</span> <span class='id identifier rubyid_load_error_by_name'>load_error_by_name</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='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='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='kw'>if</span> <span class='const'><span class='object_link'><a href="#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="#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_error'>error</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_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_error'>error</span> <span class='op'>=</span> <span class='id identifier rubyid_get_module_error'>get_module_error</span><span class='lparen'>(</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>else</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_module_reference_name'>module_reference_name</span> <span class='op'>=</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='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='id identifier rubyid_load_error_by_name'>load_error_by_name</span><span class='lparen'>(</span><span class='id identifier rubyid_module_reference_name'>module_reference_name</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_error'>error</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='id identifier rubyid_error'>error</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="load_modules-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>load_modules</strong>(path, options = {}) ⇒ <tt>Hash{String => Integer}</tt> <span class="extras">(protected)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Load all of the modules from the supplied directory or archive</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>path</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>Path to a directory</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>options</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
|||
|
|
<ul class="option">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
<span class="name">:force</span>
|
|||
|
|
<span class="type">(<tt>Boolean</tt>)</span>
|
|||
|
|
<span class="default">
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
— <div class='inline'>
|
|||
|
|
<p>Whether the force loading the modules even if they are unchanged and already loaded.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
<span class="name">:modules</span>
|
|||
|
|
<span class="type">(<tt>Array</tt>)</span>
|
|||
|
|
<span class="default">
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
— <div class='inline'>
|
|||
|
|
<p>An array of regex patterns to search for specific modules</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Hash{String => Integer}</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>Maps module type to number of modules loaded</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
163
|
|||
|
|
164
|
|||
|
|
165
|
|||
|
|
166
|
|||
|
|
167
|
|||
|
|
168
|
|||
|
|
169
|
|||
|
|
170
|
|||
|
|
171
|
|||
|
|
172
|
|||
|
|
173
|
|||
|
|
174
|
|||
|
|
175
|
|||
|
|
176
|
|||
|
|
177</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 163</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_load_modules'>load_modules</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_assert_valid_keys'>assert_valid_keys</span><span class='lparen'>(</span><span class='symbol'>:force</span><span class='comma'>,</span> <span class='symbol'>:whitelist</span><span class='comma'>,</span> <span class='symbol'>:recalculate</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_count_by_type'>count_by_type</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_loaders'>loaders</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_loader'>loader</span><span class='op'>|</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_loader'>loader</span><span class='period'>.</span><span class='id identifier rubyid_loadable?'>loadable?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_count_by_type'>count_by_type</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_loader'>loader</span><span class='period'>.</span><span class='id identifier rubyid_load_modules'>load_modules</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_prev'>prev</span><span class='comma'>,</span> <span class='id identifier rubyid_now'>now</span><span class='op'>|</span>
|
|||
|
|
<span class='id identifier rubyid_prev'>prev</span> <span class='op'>+</span> <span class='id identifier rubyid_now'>now</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_count_by_type'>count_by_type</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="loaders-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>loaders</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Return list of <span class='object_link'><a href="#LOADER_CLASSES-constant" title="Msf::ModuleManager::Loading::LOADER_CLASSES (constant)">LOADER_CLASSES</a></span> instances that load modules into this module manager</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
145
|
|||
|
|
146
|
|||
|
|
147
|
|||
|
|
148
|
|||
|
|
149
|
|||
|
|
150
|
|||
|
|
151
|
|||
|
|
152
|
|||
|
|
153</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 145</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_loaders'>loaders</span>
|
|||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_instance_variable_defined?'>instance_variable_defined?</span> <span class='symbol'>:@loaders</span>
|
|||
|
|
<span class='ivar'>@loaders</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#LOADER_CLASSES-constant" title="Msf::ModuleManager::Loading::LOADER_CLASSES (constant)">LOADER_CLASSES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</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='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
|||
|
|
<span class='rbrace'>}</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='ivar'>@loaders</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="on_module_load-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>on_module_load</strong>(class_or_module, type, reference_name, info = {}) ⇒ <tt>void</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|||
|
|
<p>Called when a module is initially loaded such that it can be categorized accordingly.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
<p class="tag_title">Parameters:</p>
|
|||
|
|
<ul class="param">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>class_or_module</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Class<<span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Msf::Module</a></span>></tt>, <tt>::Module</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>either a module Class or a payload Module.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>type</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The module type.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>reference_name</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'></span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The module reference name.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
<span class='name'>info</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Hash{String => Array}</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>additional information about the module</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<p class="tag_title">Options Hash (<tt>info</tt>):</p>
|
|||
|
|
<ul class="option">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
<span class="name">'files'</span>
|
|||
|
|
<span class="type">(<tt>Array<String></tt>)</span>
|
|||
|
|
<span class="default">
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
— <div class='inline'>
|
|||
|
|
<p>List of paths to the ruby source files where <code>class_or_module</code> is defined.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
<span class="name">'paths'</span>
|
|||
|
|
<span class="type">(<tt>Array<String></tt>)</span>
|
|||
|
|
<span class="default">
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
— <div class='inline'>
|
|||
|
|
<p>List of module reference names.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
<span class="name">'type'</span>
|
|||
|
|
<span class="type">(<tt>String</tt>)</span>
|
|||
|
|
<span class="default">
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
— <div class='inline'>
|
|||
|
|
<p>The module type, should match positional <code>type</code> argument.</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
106
|
|||
|
|
107
|
|||
|
|
108
|
|||
|
|
109
|
|||
|
|
110
|
|||
|
|
111
|
|||
|
|
112
|
|||
|
|
113
|
|||
|
|
114
|
|||
|
|
115
|
|||
|
|
116
|
|||
|
|
117
|
|||
|
|
118
|
|||
|
|
119
|
|||
|
|
120
|
|||
|
|
121
|
|||
|
|
122
|
|||
|
|
123
|
|||
|
|
124
|
|||
|
|
125
|
|||
|
|
126
|
|||
|
|
127
|
|||
|
|
128
|
|||
|
|
129
|
|||
|
|
130
|
|||
|
|
131
|
|||
|
|
132
|
|||
|
|
133
|
|||
|
|
134
|
|||
|
|
135
|
|||
|
|
136
|
|||
|
|
137
|
|||
|
|
138
|
|||
|
|
139
|
|||
|
|
140</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/loading.rb', line 106</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_on_module_load'>on_module_load</span><span class='lparen'>(</span><span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_reference_name'>reference_name</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</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='id identifier rubyid_module_set'>module_set</span><span class='period'>.</span><span class='id identifier rubyid_add_module'>add_module</span><span class='lparen'>(</span><span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='comma'>,</span> <span class='id identifier rubyid_reference_name'>reference_name</span><span class='comma'>,</span> <span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>files</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
|||
|
|
<span class='id identifier rubyid_cache_in_memory'>cache_in_memory</span><span class='lparen'>(</span>
|
|||
|
|
<span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='comma'>,</span>
|
|||
|
|
<span class='symbol'>:path</span> <span class='op'>=></span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span>
|
|||
|
|
<span class='symbol'>:reference_name</span> <span class='op'>=></span> <span class='id identifier rubyid_reference_name'>reference_name</span><span class='comma'>,</span>
|
|||
|
|
<span class='symbol'>:type</span> <span class='op'>=></span> <span class='id identifier rubyid_type'>type</span>
|
|||
|
|
<span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># Automatically subscribe a wrapper around this module to the necessary
|
|||
|
|
</span> <span class='comment'># event providers based on whatever events it wishes to receive.
|
|||
|
|
</span> <span class='id identifier rubyid_auto_subscribe_module'>auto_subscribe_module</span><span class='lparen'>(</span><span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># Notify the framework that a module was loaded
|
|||
|
|
</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_on_module_load'>on_module_load</span><span class='lparen'>(</span><span class='id identifier rubyid_reference_name'>reference_name</span><span class='comma'>,</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='comment'># Clear and add aliases, if any (payloads cannot)
|
|||
|
|
</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:realname</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_aliased_as'>aliased_as</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inv_aliases'>inv_aliases</span><span class='lbracket'>[</span><span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span><span class='rbracket'>]</span>
|
|||
|
|
<span class='id identifier rubyid_aliased_as'>aliased_as</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_a'>a</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_delete'>delete</span> <span class='id identifier rubyid_a'>a</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inv_aliases'>inv_aliases</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:aliases</span>
|
|||
|
|
<span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</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_a'>a</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='id identifier rubyid_a'>a</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inv_aliases'>inv_aliases</span><span class='lbracket'>[</span><span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span> <span class='kw'>unless</span> <span class='id identifier rubyid_class_or_module'>class_or_module</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</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:01:46 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>
|