1252 lines
52 KiB
HTML
1252 lines
52 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>
|
||
Class: Msf::Exploit::Remote::Pkcs12::Storage
|
||
|
||
— 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::Exploit::Remote::Pkcs12::Storage";
|
||
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 (S)</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="../../../Exploit.html" title="Msf::Exploit (class)">Exploit</a></span></span> » <span class='title'><span class='object_link'><a href="../../Remote.html" title="Msf::Exploit::Remote (class)">Remote</a></span></span> » <span class='title'><span class='object_link'><a href="../Pkcs12.html" title="Msf::Exploit::Remote::Pkcs12 (module)">Pkcs12</a></span></span>
|
||
»
|
||
<span class="title">Storage</span>
|
||
|
||
</div>
|
||
|
||
<div id="search">
|
||
|
||
<a class="full_list_link" id="class_list_link"
|
||
href="../../../../class_list.html">
|
||
|
||
<svg width="24" height="24">
|
||
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
||
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
||
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
||
</svg>
|
||
</a>
|
||
|
||
</div>
|
||
<div class="clear"></div>
|
||
</div>
|
||
|
||
<div id="content"><h1>Class: Msf::Exploit::Remote::Pkcs12::Storage
|
||
|
||
|
||
|
||
</h1>
|
||
<div class="box_info">
|
||
|
||
<dl>
|
||
<dt>Inherits:</dt>
|
||
<dd>
|
||
<span class="inheritName">Object</span>
|
||
|
||
<ul class="fullTree">
|
||
<li>Object</li>
|
||
|
||
<li class="next">Msf::Exploit::Remote::Pkcs12::Storage</li>
|
||
|
||
</ul>
|
||
<a href="#" class="inheritanceTree">show all</a>
|
||
|
||
</dd>
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl>
|
||
<dt>Includes:</dt>
|
||
<dd><span class='object_link'><a href="../../../Auxiliary/Report.html" title="Msf::Auxiliary::Report (module)">Auxiliary::Report</a></span></dd>
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl>
|
||
<dt>Defined in:</dt>
|
||
<dd>lib/msf/core/exploit/remote/pkcs12/storage.rb</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
<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="#framework-instance_method" title="#framework (instance method)">#<strong>framework</strong> ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
<span class="note title readonly">readonly</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Returns the value of attribute framework.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#framework_module-instance_method" title="#framework_module (instance method)">#<strong>framework_module</strong> ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
<span class="note title readonly">readonly</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Returns the value of attribute framework_module.</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="#activate-instance_method" title="#activate (instance method)">#<strong>activate</strong>(ids:) ⇒ Array<StoredPkcs12> </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Mark Pkcs12(s) as active.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#deactivate-instance_method" title="#deactivate (instance method)">#<strong>deactivate</strong>(ids:) ⇒ Array<StoredPkcs12> </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Mark Pkcs12(s) as inactive.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(options = {}) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#filter_pkcs12-instance_method" title="#filter_pkcs12 (instance method)">#<strong>filter_pkcs12</strong>(options) ⇒ Array<Metasploit::Credential::Core> </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Return the raw stored pkcs12.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(framework: nil, framework_module: nil) ⇒ Storage </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
<span class="note title constructor">constructor</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>A new instance of Storage.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#pkcs12-instance_method" title="#pkcs12 (instance method)">#<strong>pkcs12</strong>(options = {}, &block) ⇒ Array<StoredPkcs12> </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Get stored pkcs12 matching the options query.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#read_pkcs12_cert_path-instance_method" title="#read_pkcs12_cert_path (instance method)">#<strong>read_pkcs12_cert_path</strong>(cert_path, cert_pass = '', workspace: nil) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#workspace-instance_method" title="#workspace (instance method)">#<strong>workspace</strong> ⇒ String </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>The name of the workspace in which to operate.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../Auxiliary/Report.html" title="Msf::Auxiliary::Report (module)">Auxiliary::Report</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="../../../Auxiliary/Report.html#active_db%3F-instance_method" title="Msf::Auxiliary::Report#active_db? (method)">#active_db?</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#create_cracked_credential-instance_method" title="Msf::Auxiliary::Report#create_cracked_credential (method)">#create_cracked_credential</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#create_credential-instance_method" title="Msf::Auxiliary::Report#create_credential (method)">#create_credential</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#create_credential_and_login-instance_method" title="Msf::Auxiliary::Report#create_credential_and_login (method)">#create_credential_and_login</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#create_credential_login-instance_method" title="Msf::Auxiliary::Report#create_credential_login (method)">#create_credential_login</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#db-instance_method" title="Msf::Auxiliary::Report#db (method)">#db</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#db_warning_given%3F-instance_method" title="Msf::Auxiliary::Report#db_warning_given? (method)">#db_warning_given?</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#get_client-instance_method" title="Msf::Auxiliary::Report#get_client (method)">#get_client</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#get_host-instance_method" title="Msf::Auxiliary::Report#get_host (method)">#get_host</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#inside_workspace_boundary%3F-instance_method" title="Msf::Auxiliary::Report#inside_workspace_boundary? (method)">#inside_workspace_boundary?</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#invalidate_login-instance_method" title="Msf::Auxiliary::Report#invalidate_login (method)">#invalidate_login</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#mytask-instance_method" title="Msf::Auxiliary::Report#mytask (method)">#mytask</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#myworkspace-instance_method" title="Msf::Auxiliary::Report#myworkspace (method)">#myworkspace</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#myworkspace_id-instance_method" title="Msf::Auxiliary::Report#myworkspace_id (method)">#myworkspace_id</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_auth_info-instance_method" title="Msf::Auxiliary::Report#report_auth_info (method)">#report_auth_info</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_client-instance_method" title="Msf::Auxiliary::Report#report_client (method)">#report_client</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_exploit-instance_method" title="Msf::Auxiliary::Report#report_exploit (method)">#report_exploit</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_host-instance_method" title="Msf::Auxiliary::Report#report_host (method)">#report_host</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_loot-instance_method" title="Msf::Auxiliary::Report#report_loot (method)">#report_loot</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_note-instance_method" title="Msf::Auxiliary::Report#report_note (method)">#report_note</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_service-instance_method" title="Msf::Auxiliary::Report#report_service (method)">#report_service</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_vuln-instance_method" title="Msf::Auxiliary::Report#report_vuln (method)">#report_vuln</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_web_form-instance_method" title="Msf::Auxiliary::Report#report_web_form (method)">#report_web_form</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_web_page-instance_method" title="Msf::Auxiliary::Report#report_web_page (method)">#report_web_page</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_web_site-instance_method" title="Msf::Auxiliary::Report#report_web_site (method)">#report_web_site</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#report_web_vuln-instance_method" title="Msf::Auxiliary::Report#report_web_vuln (method)">#report_web_vuln</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#store_cred-instance_method" title="Msf::Auxiliary::Report#store_cred (method)">#store_cred</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#store_local-instance_method" title="Msf::Auxiliary::Report#store_local (method)">#store_local</a></span>, <span class='object_link'><a href="../../../Auxiliary/Report.html#store_loot-instance_method" title="Msf::Auxiliary::Report#store_loot (method)">#store_loot</a></span></p>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../../../Metasploit/Framework/Require.html" title="Metasploit::Framework::Require (module)">Metasploit::Framework::Require</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="../../../../Metasploit/Framework/Require.html#optionally-class_method" title="Metasploit::Framework::Require.optionally (method)">optionally</a></span>, <span class='object_link'><a href="../../../../Metasploit/Framework/Require.html#optionally_active_record_railtie-class_method" title="Metasploit::Framework::Require.optionally_active_record_railtie (method)">optionally_active_record_railtie</a></span>, <span class='object_link'><a href="../../../../Metasploit/Framework/Require.html#optionally_include_metasploit_credential_creation-class_method" title="Metasploit::Framework::Require.optionally_include_metasploit_credential_creation (method)">optionally_include_metasploit_credential_creation</a></span>, <span class='object_link'><a href="../../../../Metasploit/Framework/Require.html#optionally_include_metasploit_credential_creation-instance_method" title="Metasploit::Framework::Require#optionally_include_metasploit_credential_creation (method)">#optionally_include_metasploit_credential_creation</a></span>, <span class='object_link'><a href="../../../../Metasploit/Framework/Require.html#optionally_require_metasploit_db_gem_engines-class_method" title="Metasploit::Framework::Require.optionally_require_metasploit_db_gem_engines (method)">optionally_require_metasploit_db_gem_engines</a></span></p>
|
||
<div id="constructor_details" class="method_details_list">
|
||
<h2>Constructor Details</h2>
|
||
|
||
<div class="method_details first">
|
||
<h3 class="signature first" id="initialize-instance_method">
|
||
|
||
#<strong>initialize</strong>(framework: nil, framework_module: nil) ⇒ <tt><span class='object_link'><a href="" title="Msf::Exploit::Remote::Pkcs12::Storage (class)">Storage</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns a new instance of Storage.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
14
|
||
15
|
||
16
|
||
17</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 14</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>framework:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>framework_module:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
<span class='ivar'>@framework</span> <span class='op'>=</span> <span class='id identifier rubyid_framework'>framework</span> <span class='op'>||</span> <span class='id identifier rubyid_framework_module'>framework_module</span><span class='op'>&.</span><span class='id identifier rubyid_framework'>framework</span>
|
||
<span class='ivar'>@framework_module</span> <span class='op'>=</span> <span class='id identifier rubyid_framework_module'>framework_module</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="instance_attr_details" class="attr_details">
|
||
<h2>Instance Attribute Details</h2>
|
||
|
||
|
||
<span id=""></span>
|
||
<div class="method_details first">
|
||
<h3 class="signature first" id="framework-instance_method">
|
||
|
||
#<strong>framework</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns the value of attribute framework.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
8
|
||
9
|
||
10</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 8</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_framework'>framework</span>
|
||
<span class='ivar'>@framework</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
|
||
<span id=""></span>
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="framework_module-instance_method">
|
||
|
||
#<strong>framework_module</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns the value of attribute framework_module.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
12
|
||
13
|
||
14</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 12</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_framework_module'>framework_module</span>
|
||
<span class='ivar'>@framework_module</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="activate-instance_method">
|
||
|
||
#<strong>activate</strong>(ids:) ⇒ <tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Mark Pkcs12(s) as active</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>ids</span>
|
||
|
||
|
||
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The list of pkcs12 IDs.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
148
|
||
149
|
||
150</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 148</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_activate'>activate</span><span class='lparen'>(</span><span class='label'>ids:</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_set_status'>set_status</span><span class='lparen'>(</span><span class='label'>ids:</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='label'>status:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>active</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="deactivate-instance_method">
|
||
|
||
#<strong>deactivate</strong>(ids:) ⇒ <tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Mark Pkcs12(s) as inactive</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>ids</span>
|
||
|
||
|
||
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The list of pkcs12 IDs.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
140
|
||
141
|
||
142</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 140</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_deactivate'>deactivate</span><span class='lparen'>(</span><span class='label'>ids:</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_set_status'>set_status</span><span class='lparen'>(</span><span class='label'>ids:</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='label'>status:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>inactive</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="delete-instance_method">
|
||
|
||
#<strong>delete</strong>(options = {}) ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
114
|
||
115
|
||
116
|
||
117
|
||
118
|
||
119
|
||
120
|
||
121
|
||
122
|
||
123
|
||
124
|
||
125</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 114</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</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='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span> <span class='op'>==</span> <span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span>
|
||
<span class='comment'># skip calling #filter_pkcs12 which issues a query when the IDs are specified
|
||
</span> <span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:ids</span><span class='rbracket'>]</span>
|
||
<span class='kw'>else</span>
|
||
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_filter_pkcs12'>filter_pkcs12</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:id</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_delete_credentials'>delete_credentials</span><span class='lparen'>(</span><span class='label'>ids:</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_stored_pkcs12'>stored_pkcs12</span><span class='op'>|</span>
|
||
<span class='const'><span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StoredPkcs12.html#initialize-instance_method" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_stored_pkcs12'>stored_pkcs12</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="filter_pkcs12-instance_method">
|
||
|
||
#<strong>filter_pkcs12</strong>(options) ⇒ <tt>Array<Metasploit::Credential::Core></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Return the raw stored pkcs12.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>options</span>
|
||
|
||
|
||
<span class='type'>(<tt>Hash</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>See the options hash description in <span class='object_link'><a href="#pkcs12-instance_method" title="Msf::Exploit::Remote::Pkcs12::Storage#pkcs12 (method)">#pkcs12</a></span>.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Array<Metasploit::Credential::Core></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
68
|
||
69
|
||
70
|
||
71
|
||
72
|
||
73
|
||
74
|
||
75
|
||
76
|
||
77
|
||
78
|
||
79
|
||
80
|
||
81
|
||
82
|
||
83
|
||
84
|
||
85
|
||
86
|
||
87
|
||
88
|
||
89
|
||
90
|
||
91
|
||
92
|
||
93
|
||
94
|
||
95
|
||
96
|
||
97
|
||
98
|
||
99
|
||
100
|
||
101
|
||
102
|
||
103
|
||
104
|
||
105
|
||
106
|
||
107
|
||
108
|
||
109
|
||
110
|
||
111
|
||
112</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 68</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_filter_pkcs12'>filter_pkcs12</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
||
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_active_db?'>active_db?</span>
|
||
|
||
<span class='id identifier rubyid_filter'>filter</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
||
<span class='id identifier rubyid_filter'>filter</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
||
|
||
<span class='id identifier rubyid_creds'>creds</span> <span class='op'>=</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_creds'>creds</span><span class='lparen'>(</span>
|
||
<span class='label'>workspace:</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'>:workspace</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_workspace'>workspace</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
||
<span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Metasploit::Credential::Pkcs12</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
||
<span class='op'>**</span><span class='id identifier rubyid_filter'>filter</span>
|
||
<span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cred'>cred</span><span class='op'>|</span>
|
||
<span class='comment'># this is needed since if a filter is provided (e.g. `id:`) framework.db.creds will ignore the type:
|
||
</span> <span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_private'>private</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Metasploit::Credential::Pkcs12</span><span class='tstring_end'>'</span></span>
|
||
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:username</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
||
<span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:username</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_casecmp'>casecmp</span><span class='lparen'>(</span><span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_public'>public</span><span class='period'>.</span><span class='id identifier rubyid_username'>username</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='int'>0</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:realm</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>&&</span> <span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_realm'>realm</span>
|
||
<span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:realm</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_casecmp'>casecmp</span><span class='lparen'>(</span><span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_realm'>realm</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='int'>0</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:status</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
||
<span class='comment'># If status is not set on the credential, considere it is `active`
|
||
</span> <span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_private'>private</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>active</span><span class='tstring_end'>'</span></span>
|
||
<span class='kw'>next</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_status'>status</span> <span class='op'>!=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:status</span><span class='rbracket'>]</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_cert'>cert</span> <span class='op'>=</span> <span class='id identifier rubyid_cred'>cred</span><span class='period'>.</span><span class='id identifier rubyid_private'>private</span><span class='period'>.</span><span class='id identifier rubyid_openssl_pkcs12'>openssl_pkcs12</span><span class='period'>.</span><span class='id identifier rubyid_certificate'>certificate</span>
|
||
<span class='kw'>unless</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_between?'>between?</span><span class='lparen'>(</span><span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_not_before'>not_before</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_not_after'>not_after</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_ilog'><span class='object_link'><a href="../../../../top-level-namespace.html#ilog-instance_method" title="#ilog (method)">ilog</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[filter_pkcs12] Found a matching certificate but it has expired</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>next</span> <span class='kw'>false</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:tls_auth</span><span class='rbracket'>]</span>
|
||
<span class='id identifier rubyid_eku'>eku</span> <span class='op'>=</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_extensions'>extensions</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_oid'>oid</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>extendedKeyUsage</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
||
<span class='kw'>unless</span> <span class='id identifier rubyid_eku'>eku</span><span class='op'>&.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>TLS Web Client Authentication</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_ilog'><span class='object_link'><a href="../../../../top-level-namespace.html#ilog-instance_method" title="#ilog (method)">ilog</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[filter_pkcs12] Found a matching certificate but it doesn't have the 'TLS Web Client Authentication' EKU</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>next</span> <span class='kw'>false</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='kw'>true</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="pkcs12-instance_method">
|
||
|
||
#<strong>pkcs12</strong>(options = {}, &block) ⇒ <tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Get stored pkcs12 matching the options query.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>options</span>
|
||
|
||
|
||
<span class='type'>(<tt>Hash</tt>)</span>
|
||
|
||
|
||
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The options for matching pkcs12’s.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
||
<ul class="option">
|
||
|
||
<li>
|
||
<span class="name">:id</span>
|
||
<span class="type">(<tt>Integer</tt>, <tt>Array<Integer></tt>)</span>
|
||
<span class="default">
|
||
|
||
</span>
|
||
|
||
— <div class='inline'>
|
||
<p>The identifier of the pkcs12 (optional)</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
<span class="name">:realm</span>
|
||
<span class="type">(<tt>String</tt>)</span>
|
||
<span class="default">
|
||
|
||
</span>
|
||
|
||
— <div class='inline'>
|
||
<p>The realm of the pkcs12 (optional)</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
<span class="name">:username</span>
|
||
<span class="type">(<tt>String</tt>)</span>
|
||
<span class="default">
|
||
|
||
</span>
|
||
|
||
— <div class='inline'>
|
||
<p>The username of the pkcs12 (optional)</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Array<<span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span>></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
52
|
||
53
|
||
54
|
||
55
|
||
56
|
||
57
|
||
58
|
||
59
|
||
60
|
||
61
|
||
62</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 52</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_pkcs12'>pkcs12</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_stored_pkcs12_array'>stored_pkcs12_array</span> <span class='op'>=</span> <span class='id identifier rubyid_filter_pkcs12'>filter_pkcs12</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pkcs12_entry'>pkcs12_entry</span><span class='op'>|</span>
|
||
<span class='const'><span class='object_link'><a href="StoredPkcs12.html" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12 (class)">StoredPkcs12</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="StoredPkcs12.html#initialize-instance_method" title="Msf::Exploit::Remote::Pkcs12::StoredPkcs12#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_pkcs12_entry'>pkcs12_entry</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_stored_pkcs12_array'>stored_pkcs12_array</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_stored_pkcs12'>stored_pkcs12</span><span class='op'>|</span>
|
||
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_stored_pkcs12'>stored_pkcs12</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_stored_pkcs12_array'>stored_pkcs12_array</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="read_pkcs12_cert_path-instance_method">
|
||
|
||
#<strong>read_pkcs12_cert_path</strong>(cert_path, cert_pass = '', workspace: nil) ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>cert_path</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>A path to the file system where a pkcs12 cert is located, or a reference to a core database i.e., “id:123”</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
|
||
<span class='name'>cert_pass</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
<em class="default">(defaults to: <tt>''</tt>)</em>
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The certificate password</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
|
||
<span class='name'>workspace</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The workspace to restrict searches to</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
22
|
||
23
|
||
24
|
||
25
|
||
26
|
||
27
|
||
28
|
||
29
|
||
30
|
||
31
|
||
32
|
||
33
|
||
34
|
||
35
|
||
36
|
||
37
|
||
38
|
||
39
|
||
40
|
||
41
|
||
42
|
||
43</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 22</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_read_pkcs12_cert_path'>read_pkcs12_cert_path</span><span class='lparen'>(</span><span class='id identifier rubyid_cert_path'>cert_path</span><span class='comma'>,</span> <span class='id identifier rubyid_cert_pass'>cert_pass</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>workspace:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_cert_path'>cert_path</span><span class='op'>&.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_core'>core</span> <span class='op'>=</span> <span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_creds'>creds</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='label'>workspace:</span> <span class='id identifier rubyid_workspace'>workspace</span><span class='comma'>,</span> <span class='label'>id:</span> <span class='id identifier rubyid_cert_path'>cert_path</span><span class='period'>.</span><span class='id identifier rubyid_delete_prefix'>delete_prefix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
||
<span class='id identifier rubyid_raise'>raise</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="../../../ValidationError.html" title="Msf::ValidationError (class)">ValidationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Invalid cert id provided</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_core'>core</span>
|
||
<span class='id identifier rubyid_raise'>raise</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="../../../ValidationError.html" title="Msf::ValidationError (class)">ValidationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Invalid cert id provided - not a pkcs12 credential</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_core'>core</span><span class='period'>.</span><span class='id identifier rubyid_private'>private</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Metasploit::Credential::Pkcs12</span><span class='tstring_end'>'</span></span>
|
||
|
||
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_decode64'>decode64</span><span class='lparen'>(</span><span class='id identifier rubyid_core'>core</span><span class='period'>.</span><span class='id identifier rubyid_private'>private</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
||
<span class='kw'>else</span>
|
||
<span class='id identifier rubyid_is_readable'>is_readable</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_file?'>file?</span><span class='lparen'>(</span><span class='id identifier rubyid_cert_path'>cert_path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_readable?'>readable?</span><span class='lparen'>(</span><span class='id identifier rubyid_cert_path'>cert_path</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_raise'>raise</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="../../../ValidationError.html" title="Msf::ValidationError (class)">ValidationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Failed to load the PFX certificate file. The path was not a readable file.</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_is_readable'>is_readable</span>
|
||
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_binread'>binread</span><span class='lparen'>(</span><span class='id identifier rubyid_cert_path'>cert_path</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='kw'>begin</span>
|
||
<span class='comment'># TODO: Is it possible to read the cert pass from the db?
|
||
</span> <span class='id identifier rubyid_pkcs12'>pkcs12</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKCS12</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_cert_pass'>cert_pass</span><span class='rparen'>)</span>
|
||
<span class='kw'>rescue</span> <span class='const'>StandardError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
||
<span class='id identifier rubyid_raise'>raise</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="../../../ValidationError.html" title="Msf::ValidationError (class)">ValidationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Failed to load the PFX file (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='lbrace'>{</span> <span class='label'>path:</span> <span class='id identifier rubyid_cert_path'>cert_path</span><span class='comma'>,</span> <span class='label'>value:</span> <span class='id identifier rubyid_pkcs12'>pkcs12</span> <span class='rbrace'>}</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="workspace-instance_method">
|
||
|
||
#<strong>workspace</strong> ⇒ <tt>String</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns The name of the workspace in which to operate.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The name of the workspace in which to operate.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
128
|
||
129
|
||
130
|
||
131
|
||
132
|
||
133
|
||
134</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/pkcs12/storage.rb', line 128</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_workspace'>workspace</span>
|
||
<span class='kw'>if</span> <span class='ivar'>@framework_module</span>
|
||
<span class='kw'>return</span> <span class='ivar'>@framework_module</span><span class='period'>.</span><span class='id identifier rubyid_workspace'>workspace</span>
|
||
<span class='kw'>elsif</span> <span class='ivar'>@framework</span><span class='op'>&.</span><span class='id identifier rubyid_db'>db</span><span class='op'>&.</span><span class='id identifier rubyid_active'>active</span>
|
||
<span class='kw'>return</span> <span class='ivar'>@framework</span><span class='period'>.</span><span class='id identifier rubyid_db'>db</span><span class='period'>.</span><span class='id identifier rubyid_workspace'>workspace</span><span class='op'>&.</span><span class='id identifier rubyid_name'>name</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="footer">
|
||
Generated on Fri May 8 17:03:38 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> |