1420 lines
56 KiB
HTML
1420 lines
56 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::Cache
|
||
|
|
|
||
|
|
— 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::Cache";
|
||
|
|
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 (C)</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">Cache</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::Cache
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</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/cache.rb</dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<h2>Overview</h2><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Concerns the module cache maintained by 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="MEMORY-constant" class="">MEMORY =
|
||
|
|
|
||
|
|
</dt>
|
||
|
|
<dd><pre class="code"><span class='symbol'>:memory</span></pre></dd>
|
||
|
|
|
||
|
|
<dt id="FILESYSTEM-constant" class="">FILESYSTEM =
|
||
|
|
|
||
|
|
</dt>
|
||
|
|
<dd><pre class="code"><span class='symbol'>:filesystem</span></pre></dd>
|
||
|
|
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<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="#module_info_by_path-instance_method" title="#module_info_by_path (instance method)">#<strong>module_info_by_path</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="note title protected">protected</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></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="#cache_empty%3F-instance_method" title="#cache_empty? (instance method)">#<strong>cache_empty?</strong> ⇒ true, false </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns whether the cache is empty.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#cache_in_memory-instance_method" title="#cache_in_memory (instance method)">#<strong>cache_in_memory</strong>(class_or_module, options = {}) ⇒ void </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Updates the in-memory cache so that <span class='object_link'><a href="Loading.html#file_changed%3F-instance_method" title="Msf::ModuleManager::Loading#file_changed? (method)">Loading#file_changed?</a></span> will report <code>false</code> if the module is loaded again.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="protected ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#get_parent_path-instance_method" title="#get_parent_path (instance method)">#<strong>get_parent_path</strong>(module_path, type) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="note title protected">protected</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#load_cached_module-instance_method" title="#load_cached_module (instance method)">#<strong>load_cached_module</strong>(type, reference_name, cache_type: Msf::ModuleManager::Cache::MEMORY) ⇒ false, true </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Forces loading of the module with the given type and module reference name from the cache.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="protected ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#module_info_by_path_from_database!-instance_method" title="#module_info_by_path_from_database! (instance method)">#<strong>module_info_by_path_from_database!</strong>(allowed_paths = [""]) ⇒ Hash{String => Hash{Symbol => Object}} </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="note title protected">protected</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Return a module info from Msf::Modules::Metadata::Obj.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#refresh_cache_from_database-instance_method" title="#refresh_cache_from_database (instance method)">#<strong>refresh_cache_from_database</strong>(allowed_paths = [""]) ⇒ void </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Refreshes the in-memory cache from the database cache.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#refresh_cache_from_module_files-instance_method" title="#refresh_cache_from_module_files (instance method)">#<strong>refresh_cache_from_module_files</strong>(module_class_or_instance = nil) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#try_load_module-instance_method" title="#try_load_module (instance method)">#<strong>try_load_module</strong>(parent_path, type, reference_name, cached_metadata: nil) ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>True if loaded, false otherwise.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<div id="instance_attr_details" class="attr_details">
|
||
|
|
<h2>Instance Attribute Details</h2>
|
||
|
|
|
||
|
|
|
||
|
|
<span id="module_info_by_path=-instance_method"></span>
|
||
|
|
<div class="method_details first">
|
||
|
|
<h3 class="signature first" id="module_info_by_path-instance_method">
|
||
|
|
|
||
|
|
#<strong>module_info_by_path</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
159
|
||
|
|
160
|
||
|
|
161</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 159</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_info_by_path'>module_info_by_path</span>
|
||
|
|
<span class='ivar'>@module_info_by_path</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="cache_empty?-instance_method">
|
||
|
|
|
||
|
|
#<strong>cache_empty?</strong> ⇒ <tt>true</tt>, <tt>false</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns whether the cache is empty</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
<p class="tag_title">Returns:</p>
|
||
|
|
<ul class="return">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>true</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if the cache has no entries.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if the cache has any entries.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
17
|
||
|
|
18
|
||
|
|
19</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 17</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_cache_empty?'>cache_empty?</span>
|
||
|
|
<span class='id identifier rubyid_module_info_by_path'>module_info_by_path</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="cache_in_memory-instance_method">
|
||
|
|
|
||
|
|
#<strong>cache_in_memory</strong>(class_or_module, options = {}) ⇒ <tt>void</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<div class="note notetag">
|
||
|
|
<strong>Note:</strong>
|
||
|
|
<div class='inline'>
|
||
|
|
<p>path, reference_name, and type must be passed as options because when <code>class_or_module</code> is a payload Module, those attributes will either not be set or not exist on the module.</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
||
|
|
<p>Updates the in-memory cache so that <span class='object_link'><a href="Loading.html#file_changed%3F-instance_method" title="Msf::ModuleManager::Loading#file_changed? (method)">Loading#file_changed?</a></span> will report <code>false</code> if the module is loaded again.</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'>options</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>Hash{Symbol => String}</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">:path</span>
|
||
|
|
<span class="type">(<tt>String</tt>)</span>
|
||
|
|
<span class="default">
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
— <div class='inline'>
|
||
|
|
<p>the path to the file from which <code>class_or_module</code> was loaded.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
<span class="name">:reference_name</span>
|
||
|
|
<span class="type">(<tt>String</tt>)</span>
|
||
|
|
<span class="default">
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
— <div class='inline'>
|
||
|
|
<p>the reference name for <code>class_or_module</code>.</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</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
|
||
|
|
<p class="tag_title">Raises:</p>
|
||
|
|
<ul class="raise">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>KeyError</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>unless <code>:path</code> is given.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>KeyError</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>unless <code>:reference_name</code> is given.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>KeyError</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>unless <code>:type</code> is given.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
39
|
||
|
|
40
|
||
|
|
41
|
||
|
|
42
|
||
|
|
43
|
||
|
|
44
|
||
|
|
45
|
||
|
|
46
|
||
|
|
47
|
||
|
|
48
|
||
|
|
49
|
||
|
|
50
|
||
|
|
51
|
||
|
|
52
|
||
|
|
53
|
||
|
|
54
|
||
|
|
55
|
||
|
|
56
|
||
|
|
57
|
||
|
|
58
|
||
|
|
59
|
||
|
|
60
|
||
|
|
61
|
||
|
|
62
|
||
|
|
63
|
||
|
|
64
|
||
|
|
65
|
||
|
|
66
|
||
|
|
67
|
||
|
|
68</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 39</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</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='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'>:path</span><span class='comma'>,</span> <span class='symbol'>:reference_name</span><span class='comma'>,</span> <span class='symbol'>:type</span><span class='rparen'>)</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span>
|
||
|
|
|
||
|
|
<span class='kw'>begin</span>
|
||
|
|
<span class='id identifier rubyid_modification_time'>modification_time</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='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ENOENT</span> <span class='op'>=></span> <span class='id identifier rubyid_error'>error</span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Could not find the modification of time of </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='tstring_end'>"</span></span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'><<</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'><<</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Call stack:</span><span class='tstring_end'>"</span></span>
|
||
|
|
<span class='id identifier rubyid_log_lines'>log_lines</span> <span class='op'>+=</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_log_message'>log_message</span> <span class='op'>=</span> <span class='id identifier rubyid_log_lines'>log_lines</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'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_elog'><span class='object_link'><a href="../../top-level-namespace.html#elog-instance_method" title="#elog (method)">elog</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_log_message'>log_message</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='id identifier rubyid_parent_path'>parent_path</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_module_parent'>module_parent</span><span class='period'>.</span><span class='id identifier rubyid_parent_path'>parent_path</span>
|
||
|
|
<span class='id identifier rubyid_reference_name'>reference_name</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:reference_name</span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:type</span><span class='rparen'>)</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='op'>=</span> <span class='lbrace'>{</span>
|
||
|
|
<span class='symbol'>:modification_time</span> <span class='op'>=></span> <span class='id identifier rubyid_modification_time'>modification_time</span><span class='comma'>,</span>
|
||
|
|
<span class='symbol'>:parent_path</span> <span class='op'>=></span> <span class='id identifier rubyid_parent_path'>parent_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='rbrace'>}</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="get_parent_path-instance_method">
|
||
|
|
|
||
|
|
#<strong>get_parent_path</strong>(module_path, type) ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
209
|
||
|
|
210
|
||
|
|
211
|
||
|
|
212
|
||
|
|
213
|
||
|
|
214
|
||
|
|
215</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 209</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_get_parent_path'>get_parent_path</span><span class='lparen'>(</span><span class='id identifier rubyid_module_path'>module_path</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
||
|
|
<span class='comment'># The load path is the directory above the type directory (e.g. everything
|
||
|
|
</span> <span class='comment'># before "/exploits/" in the module's absolute path).
|
||
|
|
</span> <span class='id identifier rubyid_type_dir'>type_dir</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='op'>::</span><span class='const'>SEPARATOR</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'>Mdm</span><span class='op'>::</span><span class='const'>Module</span><span class='op'>::</span><span class='const'>Detail</span><span class='op'>::</span><span class='const'>DIRECTORY_BY_TYPE</span><span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='op'>::</span><span class='const'>SEPARATOR</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
||
|
|
<span class='id identifier rubyid_idx'>idx</span> <span class='op'>=</span> <span class='id identifier rubyid_module_path'>module_path</span><span class='period'>.</span><span class='id identifier rubyid_rindex'>rindex</span><span class='lparen'>(</span><span class='id identifier rubyid_type_dir'>type_dir</span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_idx'>idx</span> <span class='op'>?</span> <span class='id identifier rubyid_module_path'>module_path</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_module_path'>module_path</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="load_cached_module-instance_method">
|
||
|
|
|
||
|
|
#<strong>load_cached_module</strong>(type, reference_name, cache_type: Msf::ModuleManager::Cache::MEMORY) ⇒ <tt>false</tt>, <tt>true</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Forces loading of the module with the given type and module reference name from the cache.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
<p class="tag_title">Parameters:</p>
|
||
|
|
<ul class="param">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>type</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>the type of the module.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>reference_name</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>the module reference name.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
<p class="tag_title">Returns:</p>
|
||
|
|
<ul class="return">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if a module with the given type and reference name does not exist in the cache.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if :force is false and parent_path has not changed.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if exception encountered while parsing module content</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if the module is incompatible with the Core or API version.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if the module does not implement a Metasploit class.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>false</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if the module's is_usable method returns false.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>true</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>if all those condition pass and the module is successfully loaded.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
76
|
||
|
|
77
|
||
|
|
78
|
||
|
|
79
|
||
|
|
80
|
||
|
|
81
|
||
|
|
82
|
||
|
|
83
|
||
|
|
84
|
||
|
|
85
|
||
|
|
86
|
||
|
|
87
|
||
|
|
88
|
||
|
|
89
|
||
|
|
90
|
||
|
|
91
|
||
|
|
92
|
||
|
|
93
|
||
|
|
94
|
||
|
|
95
|
||
|
|
96
|
||
|
|
97</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 76</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_load_cached_module'>load_cached_module</span><span class='lparen'>(</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='label'>cache_type:</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="../ModuleManager.html" title="Msf::ModuleManager (class)">ModuleManager</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Msf::ModuleManager::Cache (module)">Cache</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#MEMORY-constant" title="Msf::ModuleManager::Cache::MEMORY (constant)">MEMORY</a></span></span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_cached_metadata'>cached_metadata</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
||
|
|
|
||
|
|
<span class='kw'>case</span> <span class='id identifier rubyid_cache_type'>cache_type</span>
|
||
|
|
<span class='kw'>when</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="../ModuleManager.html" title="Msf::ModuleManager (class)">ModuleManager</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Msf::ModuleManager::Cache (module)">Cache</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#FILESYSTEM-constant" title="Msf::ModuleManager::Cache::FILESYSTEM (constant)">FILESYSTEM</a></span></span>
|
||
|
|
<span class='id identifier rubyid_cached_metadata'>cached_metadata</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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata.html" title="Msf::Modules::Metadata (module)">Metadata</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata/Cache.html" title="Msf::Modules::Metadata::Cache (class)">Cache</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_get_module_reference'>get_module_reference</span><span class='lparen'>(</span><span class='label'>type:</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='label'>reference_name:</span> <span class='id identifier rubyid_reference_name'>reference_name</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_cached_metadata'>cached_metadata</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_parent_path'>parent_path</span> <span class='op'>=</span> <span class='id identifier rubyid_get_parent_path'>get_parent_path</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_metadata'>cached_metadata</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>when</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="../ModuleManager.html" title="Msf::ModuleManager (class)">ModuleManager</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Msf::ModuleManager::Cache (module)">Cache</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#MEMORY-constant" title="Msf::ModuleManager::Cache::MEMORY (constant)">MEMORY</a></span></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='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_inner_info'>inner_info</span><span class='op'>|</span>
|
||
|
|
<span class='id identifier rubyid_inner_info'>inner_info</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'>and</span> <span class='id identifier rubyid_inner_info'>inner_info</span><span class='lbracket'>[</span><span class='symbol'>:reference_name</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_reference_name'>reference_name</span>
|
||
|
|
<span class='rbrace'>}</span>
|
||
|
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_module_info'>module_info</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_parent_path'>parent_path</span> <span class='op'>=</span> <span class='id identifier rubyid_module_info'>module_info</span><span class='lbracket'>[</span><span class='symbol'>:parent_path</span><span class='rbracket'>]</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cache_type'>cache_type</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not a valid cache type.</span><span class='tstring_end'>"</span></span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_try_load_module'>try_load_module</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_path'>parent_path</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='label'>cached_metadata:</span> <span class='id identifier rubyid_cached_metadata'>cached_metadata</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="module_info_by_path_from_database!-instance_method">
|
||
|
|
|
||
|
|
#<strong>module_info_by_path_from_database!</strong>(allowed_paths = [""]) ⇒ <tt>Hash{String => Hash{Symbol => Object}}</tt> <span class="extras">(protected)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<div class="note notetag">
|
||
|
|
<strong>Note:</strong>
|
||
|
|
<div class='inline'>
|
||
|
|
<p>Also sets <a href="module_reference_name">module_set(module_type)</a> to nil if it is not already set.</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<p>Return a module info from Msf::Modules::Metadata::Obj.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
<p class="tag_title">Returns:</p>
|
||
|
|
<ul class="return">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>Hash{String => Hash{Symbol => Object}}</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>Maps path (Mdm::Module::Detail#file) to module information. Module information is a Hash derived from Mdm::Module::Detail. It includes :modification_time, :parent_path, :type, :reference_name.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
168
|
||
|
|
169
|
||
|
|
170
|
||
|
|
171
|
||
|
|
172
|
||
|
|
173
|
||
|
|
174
|
||
|
|
175
|
||
|
|
176
|
||
|
|
177
|
||
|
|
178
|
||
|
|
179
|
||
|
|
180
|
||
|
|
181
|
||
|
|
182
|
||
|
|
183
|
||
|
|
184
|
||
|
|
185
|
||
|
|
186
|
||
|
|
187
|
||
|
|
188
|
||
|
|
189
|
||
|
|
190
|
||
|
|
191
|
||
|
|
192
|
||
|
|
193
|
||
|
|
194
|
||
|
|
195
|
||
|
|
196
|
||
|
|
197
|
||
|
|
198
|
||
|
|
199
|
||
|
|
200
|
||
|
|
201
|
||
|
|
202
|
||
|
|
203
|
||
|
|
204
|
||
|
|
205
|
||
|
|
206
|
||
|
|
207</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 168</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_module_info_by_path_from_database!'>module_info_by_path_from_database!</span><span class='lparen'>(</span><span class='id identifier rubyid_allowed_paths'>allowed_paths</span><span class='op'>=</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</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='id identifier rubyid_allowed_paths'>allowed_paths</span> <span class='op'>=</span> <span class='id identifier rubyid_allowed_paths'>allowed_paths</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_metadata'>metadata</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="../Modules.html" title="Msf::Modules (module)">Modules</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata.html" title="Msf::Modules::Metadata (module)">Metadata</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata/Cache.html" title="Msf::Modules::Metadata::Cache (class)">Cache</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_get_metadata'>get_metadata</span>
|
||
|
|
<span class='id identifier rubyid_metadata'>metadata</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_module_metadata'>module_metadata</span><span class='op'>|</span>
|
||
|
|
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='id identifier rubyid_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
|
||
|
|
<span class='id identifier rubyid_reference_name'>reference_name</span> <span class='op'>=</span> <span class='id identifier rubyid_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_ref_name'>ref_name</span>
|
||
|
|
|
||
|
|
<span class='comment'># Skip cached modules that are not in our allowed load paths
|
||
|
|
</span> <span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_allowed_paths'>allowed_paths</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_parent_path'>parent_path</span> <span class='op'>=</span> <span class='id identifier rubyid_get_parent_path'>get_parent_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</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='lbracket'>[</span><span class='id identifier rubyid_path'>path</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</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='comma'>,</span>
|
||
|
|
<span class='symbol'>:parent_path</span> <span class='op'>=></span> <span class='id identifier rubyid_parent_path'>parent_path</span><span class='comma'>,</span>
|
||
|
|
<span class='symbol'>:modification_time</span> <span class='op'>=></span> <span class='id identifier rubyid_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_mod_time'>mod_time</span>
|
||
|
|
<span class='rbrace'>}</span>
|
||
|
|
<span class='id identifier rubyid_module_metadata'>module_metadata</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_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_fullname'>fullname</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_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_fullname'>fullname</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_module_metadata'>module_metadata</span><span class='period'>.</span><span class='id identifier rubyid_aliases'>aliases</span> <span class='kw'>unless</span> <span class='id identifier rubyid_module_metadata'>module_metadata</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='id identifier rubyid_typed_module_set'>typed_module_set</span> <span class='op'>=</span> <span class='id identifier rubyid_module_set'>module_set</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
||
|
|
|
||
|
|
<span class='comment'># Don't want to trigger as {Msf::ModuleSet#create} so check for
|
||
|
|
</span> <span class='comment'># key instead of using ||= which would call {Msf::ModuleSet#[]}
|
||
|
|
</span> <span class='comment'># which would potentially call {Msf::ModuleSet#create}.
|
||
|
|
</span> <span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_typed_module_set'>typed_module_set</span>
|
||
|
|
<span class='kw'>unless</span> <span class='id identifier rubyid_typed_module_set'>typed_module_set</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_reference_name'>reference_name</span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_typed_module_set'>typed_module_set</span><span class='lbracket'>[</span><span class='id identifier rubyid_reference_name'>reference_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</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='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="refresh_cache_from_database-instance_method">
|
||
|
|
|
||
|
|
#<strong>refresh_cache_from_database</strong>(allowed_paths = [""]) ⇒ <tt>void</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
||
|
|
<p>Refreshes the in-memory cache from the database cache.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
151
|
||
|
|
152
|
||
|
|
153</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 151</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_refresh_cache_from_database'>refresh_cache_from_database</span><span class='lparen'>(</span><span class='id identifier rubyid_allowed_paths'>allowed_paths</span><span class='op'>=</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_info_by_path_from_database!'>module_info_by_path_from_database!</span><span class='lparen'>(</span><span class='id identifier rubyid_allowed_paths'>allowed_paths</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="refresh_cache_from_module_files-instance_method">
|
||
|
|
|
||
|
|
|
||
|
|
<span class="overload">#<strong>refresh_cache_from_module_files</strong> ⇒ <tt>void</tt> </span>
|
||
|
|
|
||
|
|
<span class="overload">#<strong>refresh_cache_from_module_files</strong>(module_class_or_instance) ⇒ <tt>void</tt> </span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
<p class="tag_title">Overloads:</p>
|
||
|
|
<ul class="overload">
|
||
|
|
|
||
|
|
|
||
|
|
<li class="overload_item">
|
||
|
|
<span class="signature">#<strong>refresh_cache_from_module_files</strong> ⇒ <tt>void</tt> </span>
|
||
|
|
<div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
||
|
|
<p>Rebuilds module metadata store and in-memory cache for all modules.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="overload_item">
|
||
|
|
<span class="signature">#<strong>refresh_cache_from_module_files</strong>(module_class_or_instance) ⇒ <tt>void</tt> </span>
|
||
|
|
<div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
||
|
|
<p>Rebuilds database and in-memory cache for given module_class_or_instance.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
128
|
||
|
|
129
|
||
|
|
130
|
||
|
|
131
|
||
|
|
132
|
||
|
|
133
|
||
|
|
134
|
||
|
|
135
|
||
|
|
136
|
||
|
|
137
|
||
|
|
138
|
||
|
|
139
|
||
|
|
140
|
||
|
|
141
|
||
|
|
142
|
||
|
|
143
|
||
|
|
144
|
||
|
|
145
|
||
|
|
146</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 128</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_refresh_cache_from_module_files'>refresh_cache_from_module_files</span><span class='lparen'>(</span><span class='id identifier rubyid_module_class_or_instance'>module_class_or_instance</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_module_class_or_instance'>module_class_or_instance</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/Metadata.html" title="Msf::Modules::Metadata (module)">Metadata</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata/Cache.html" title="Msf::Modules::Metadata::Cache (class)">Cache</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_refresh_metadata_instance'>refresh_metadata_instance</span><span class='lparen'>(</span><span class='id identifier rubyid_module_class_or_instance'>module_class_or_instance</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='id identifier rubyid_module_sets'>module_sets</span> <span class='op'>=</span>
|
||
|
|
<span class='lbracket'>[</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exploit</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_exploits'>exploits</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>auxiliary</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_auxiliary'>auxiliary</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>post</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>payload</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_payloads'>payloads</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>encoder</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_encoders'>encoders</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>nop</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_nops'>nops</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
||
|
|
<span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>evasion</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_evasion'>evasion</span><span class='rbracket'>]</span>
|
||
|
|
<span class='rbracket'>]</span>
|
||
|
|
<span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_payloads'>payloads</span><span class='period'>.</span><span class='id identifier rubyid_recalculate'>recalculate</span> <span class='comment'># Ensure all payloads are calculated before refreshing metadata
|
||
|
|
</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/Metadata.html" title="Msf::Modules::Metadata (module)">Metadata</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Modules/Metadata/Cache.html" title="Msf::Modules::Metadata::Cache (class)">Cache</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_refresh_metadata'>refresh_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_module_sets'>module_sets</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='id identifier rubyid_refresh_cache_from_database'>refresh_cache_from_database</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_module_paths'>module_paths</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="try_load_module-instance_method">
|
||
|
|
|
||
|
|
#<strong>try_load_module</strong>(parent_path, type, reference_name, cached_metadata: nil) ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns True if loaded, false otherwise.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
<p class="tag_title">Parameters:</p>
|
||
|
|
<ul class="param">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>parent_path</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>Root directory to load modules from</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>reference_name</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>THe module reference name, without the type prefix</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>type</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>Such as auxiliary, exploit, etc</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>cached_metadata</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>nil</tt>, <tt><span class='object_link'><a href="../Modules/Metadata/Obj.html" title="Msf::Modules::Metadata::Obj (class)">Msf::Modules::Metadata::Obj</a></span></tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
||
|
|
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
<p class="tag_title">Returns:</p>
|
||
|
|
<ul class="return">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>True if loaded, false otherwise</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
104
|
||
|
|
105
|
||
|
|
106
|
||
|
|
107
|
||
|
|
108
|
||
|
|
109
|
||
|
|
110
|
||
|
|
111
|
||
|
|
112
|
||
|
|
113
|
||
|
|
114
|
||
|
|
115
|
||
|
|
116</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/module_manager/cache.rb', line 104</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_try_load_module'>try_load_module</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_path'>parent_path</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='label'>cached_metadata:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_loaded'>loaded</span> <span class='op'>=</span> <span class='kw'>false</span>
|
||
|
|
<span class='comment'># XXX borked
|
||
|
|
</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_module?'>loadable_module?</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_path'>parent_path</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='label'>cached_metadata:</span> <span class='id identifier rubyid_cached_metadata'>cached_metadata</span><span class='rparen'>)</span>
|
||
|
|
<span class='id identifier rubyid_loaded'>loaded</span> <span class='op'>=</span> <span class='id identifier rubyid_loader'>loader</span><span class='period'>.</span><span class='id identifier rubyid_load_module'>load_module</span><span class='lparen'>(</span><span class='id identifier rubyid_parent_path'>parent_path</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='label'>force:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>cached_metadata:</span> <span class='id identifier rubyid_cached_metadata'>cached_metadata</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_loaded'>loaded</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_loaded'>loaded</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="footer">
|
||
|
|
Generated on Fri May 8 17:01:36 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>
|