1816 lines
49 KiB
HTML
1816 lines
49 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>
|
|
Class: Metasploit::Framework::PrivateCredentialCollection
|
|
|
|
— 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 = "Metasploit::Framework::PrivateCredentialCollection";
|
|
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 (P)</a> »
|
|
<span class='title'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span> » <span class='title'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span>
|
|
»
|
|
<span class="title">PrivateCredentialCollection</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: Metasploit::Framework::PrivateCredentialCollection
|
|
|
|
|
|
|
|
</h1>
|
|
<div class="box_info">
|
|
|
|
<dl>
|
|
<dt>Inherits:</dt>
|
|
<dd>
|
|
<span class="inheritName">Object</span>
|
|
|
|
<ul class="fullTree">
|
|
<li>Object</li>
|
|
|
|
<li class="next">Metasploit::Framework::PrivateCredentialCollection</li>
|
|
|
|
</ul>
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
<dt>Defined in:</dt>
|
|
<dd>lib/metasploit/framework/credential_collection.rb</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<div id="subclasses">
|
|
<h2>Direct Known Subclasses</h2>
|
|
<p class="children"><span class='object_link'><a href="CredentialCollection.html" title="Metasploit::Framework::CredentialCollection (class)">CredentialCollection</a></span></p>
|
|
</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="#additional_privates-instance_method" title="#additional_privates (instance method)">#<strong>additional_privates</strong> ⇒ Array<String> </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Additional private values that should be tried.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#blank_passwords-instance_method" title="#blank_passwords (instance method)">#<strong>blank_passwords</strong> ⇒ Boolean </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Whether each username should be tried with a blank password.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#filter-instance_method" title="#filter (instance method)">#<strong>filter</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>A block that can be used to filter credential objects.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#nil_passwords-instance_method" title="#nil_passwords (instance method)">#<strong>nil_passwords</strong> ⇒ Boolean </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Whether each username should be tried with a nil password.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#pass_file-instance_method" title="#pass_file (instance method)">#<strong>pass_file</strong> ⇒ String </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Path to a file containing passwords, one per line.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#password-instance_method" title="#password (instance method)">#<strong>password</strong> ⇒ String </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>The password that should be tried.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#prepended_creds-instance_method" title="#prepended_creds (instance method)">#<strong>prepended_creds</strong> ⇒ Array<Credential> </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>List of credentials to be tried before any others.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#realm-instance_method" title="#realm (instance method)">#<strong>realm</strong> ⇒ String </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>The authentication realm associated with this password.</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="#add_private-instance_method" title="#add_private (instance method)">#<strong>add_private</strong>(private_str = '') ⇒ void </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Adds a string as an additional private credential to be combined in the collection.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#each_filtered-instance_method" title="#each_filtered (instance method)">#<strong>each_filtered</strong> {|credential| ... } ⇒ void </a>
|
|
|
|
|
|
|
|
(also: #each)
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Combines all the provided credential sources into a stream of <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span> objects, yielding them one at a time.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#each_unfiltered-instance_method" title="#each_unfiltered (instance method)">#<strong>each_unfiltered</strong> {|credential| ... } ⇒ void </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Combines all the provided credential sources into a stream of <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span> objects, yielding them one at a time.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#empty%3F-instance_method" title="#empty? (instance method)">#<strong>empty?</strong> ⇒ Boolean </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Returns true when #each will have no results to iterate.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#filtered%3F-instance_method" title="#filtered? (instance method)">#<strong>filtered?</strong> ⇒ Boolean </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Returns true when a filter is defined.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#has_privates%3F-instance_method" title="#has_privates? (instance method)">#<strong>has_privates?</strong> ⇒ Boolean </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Returns true when there are any private values set.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ PrivateCredentialCollection </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="note title constructor">constructor</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>A new instance of PrivateCredentialCollection.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="public ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#prepend_cred-instance_method" title="#prepend_cred (instance method)">#<strong>prepend_cred</strong>(cred) ⇒ self </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Add <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">credentials</a></span> that will be yielded by <span class='object_link'><a href="#each-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#each (method)">#each</a></span>.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#private_type-instance_method" title="#private_type (instance method)">#<strong>private_type</strong>(private) ⇒ Symbol </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Analyze a private value to determine its type by checking it against a known list of regular expressions.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<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>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Metasploit::Framework::PrivateCredentialCollection (class)">PrivateCredentialCollection</a></span></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns a new instance of PrivateCredentialCollection.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>opts</span>
|
|
|
|
|
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
|
|
|
|
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>a customizable set of options</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
|
<ul class="option">
|
|
|
|
<li>
|
|
<span class="name">:nil_passwords</span>
|
|
<span class="type">(<tt>Boolean</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See <span class='object_link'><a href="#nil_passwords-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#nil_passwords (method)">#nil_passwords</a></span></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:blank_passwords</span>
|
|
<span class="type">(<tt>Boolean</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See <span class='object_link'><a href="#blank_passwords-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#blank_passwords (method)">#blank_passwords</a></span></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:pass_file</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See <span class='object_link'><a href="#pass_file-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#pass_file (method)">#pass_file</a></span></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:password</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See <span class='object_link'><a href="#password-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#password (method)">#password</a></span></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:prepended_creds</span>
|
|
<span class="type">(<tt>Array<<span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span>></tt>)</span>
|
|
<span class="default">
|
|
|
|
— default:
|
|
<tt>[]</tt>
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See <span class='object_link'><a href="#prepended_creds-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#prepended_creds (method)">#prepended_creds</a></span></p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:user_as_pass</span>
|
|
<span class="type">(<tt>Boolean</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See #user_as_pass</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:user_file</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See #user_file</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:username</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See #username</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:userpass_file</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See #userpass_file</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<span class="name">:usernames_only</span>
|
|
<span class="type">(<tt>String</tt>)</span>
|
|
<span class="default">
|
|
|
|
</span>
|
|
|
|
— <div class='inline'>
|
|
<p>See #usernames_only</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
|
62
|
|
63
|
|
64</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 57</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_opts'>opts</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_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
|
<span class='id identifier rubyid_public_send'>public_send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attribute'>attribute</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_prepended_creds'>prepended_creds</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_additional_privates'>additional_privates</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span> <span class='op'>=</span> <span class='kw'>nil</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="additional_privates=-instance_method"></span>
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="additional_privates-instance_method">
|
|
|
|
#<strong>additional_privates</strong> ⇒ <tt>Array<String></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Additional private values that should be tried</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Array<String></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
9
|
|
10
|
|
11</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 9</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_additional_privates'>additional_privates</span>
|
|
<span class='ivar'>@additional_privates</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="blank_passwords=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="blank_passwords-instance_method">
|
|
|
|
#<strong>blank_passwords</strong> ⇒ <tt>Boolean</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Whether each username should be tried with a blank password</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
14
|
|
15
|
|
16</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 14</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_blank_passwords'>blank_passwords</span>
|
|
<span class='ivar'>@blank_passwords</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="filter=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="filter-instance_method">
|
|
|
|
#<strong>filter</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>A block that can be used to filter credential objects</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
45
|
|
46
|
|
47</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 45</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span>
|
|
<span class='ivar'>@filter</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="nil_passwords=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="nil_passwords-instance_method">
|
|
|
|
#<strong>nil_passwords</strong> ⇒ <tt>Boolean</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Whether each username should be tried with a nil password</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
19
|
|
20
|
|
21</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 19</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_nil_passwords'>nil_passwords</span>
|
|
<span class='ivar'>@nil_passwords</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="pass_file=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="pass_file-instance_method">
|
|
|
|
#<strong>pass_file</strong> ⇒ <tt>String</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Path to a file containing passwords, one per line</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
24
|
|
25
|
|
26</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 24</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_pass_file'>pass_file</span>
|
|
<span class='ivar'>@pass_file</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="password=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="password-instance_method">
|
|
|
|
#<strong>password</strong> ⇒ <tt>String</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>The password that should be tried</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
29
|
|
30
|
|
31</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 29</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_password'>password</span>
|
|
<span class='ivar'>@password</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="prepended_creds=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="prepended_creds-instance_method">
|
|
|
|
#<strong>prepended_creds</strong> ⇒ <tt>Array<<span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span>></tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>List of credentials to be tried before any others</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Array<<span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span>></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">See Also:</p>
|
|
<ul class="see">
|
|
|
|
<li><span class='object_link'><a href="#prepend_cred-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#prepend_cred (method)">#prepend_cred</a></span></li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
36
|
|
37
|
|
38</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 36</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_prepended_creds'>prepended_creds</span>
|
|
<span class='ivar'>@prepended_creds</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span id="realm=-instance_method"></span>
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="realm-instance_method">
|
|
|
|
#<strong>realm</strong> ⇒ <tt>String</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>The authentication realm associated with this password</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
41
|
|
42
|
|
43</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 41</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_realm'>realm</span>
|
|
<span class='ivar'>@realm</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="add_private-instance_method">
|
|
|
|
#<strong>add_private</strong>(private_str = '') ⇒ <tt>void</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|
<p>Adds a string as an additional private credential to be combined in the collection.</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>private_str</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
<em class="default">(defaults to: <tt>''</tt>)</em>
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The string to use as a private credential</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
71
|
|
72
|
|
73</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 71</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_add_private'>add_private</span><span class='lparen'>(</span><span class='id identifier rubyid_private_str'>private_str</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_additional_privates'>additional_privates</span> <span class='op'><<</span> <span class='id identifier rubyid_private_str'>private_str</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="each_filtered-instance_method">
|
|
|
|
#<strong>each_filtered</strong> {|credential| ... } ⇒ <tt>void</tt>
|
|
|
|
|
|
|
|
<span class="aliases">Also known as:
|
|
<span class="names"><span id='each-instance_method'>each</span></span>
|
|
</span>
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|
<p>Combines all the provided credential sources into a stream of <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span> objects, yielding them one at a time</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Yield Parameters:</p>
|
|
<ul class="yieldparam">
|
|
|
|
<li>
|
|
|
|
<span class='name'>credential</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Metasploit::Framework::Credential</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
90
|
|
91
|
|
92
|
|
93
|
|
94
|
|
95
|
|
96</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 90</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_filtered'>each_filtered</span>
|
|
<span class='id identifier rubyid_each_unfiltered'>each_unfiltered</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_credential'>credential</span><span class='op'>|</span>
|
|
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_credential'>credential</span><span class='rparen'>)</span>
|
|
|
|
<span class='kw'>yield</span> <span class='id identifier rubyid_credential'>credential</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="each_unfiltered-instance_method">
|
|
|
|
#<strong>each_unfiltered</strong> {|credential| ... } ⇒ <tt>void</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
<p class="note returns_void">This method returns an undefined value.</p>
|
|
<p>Combines all the provided credential sources into a stream of <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span> objects, yielding them one at a time</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Yield Parameters:</p>
|
|
<ul class="yieldparam">
|
|
|
|
<li>
|
|
|
|
<span class='name'>credential</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Metasploit::Framework::Credential</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
103
|
|
104
|
|
105
|
|
106
|
|
107
|
|
108
|
|
109
|
|
110
|
|
111
|
|
112
|
|
113
|
|
114
|
|
115
|
|
116
|
|
117
|
|
118
|
|
119
|
|
120
|
|
121
|
|
122
|
|
123
|
|
124
|
|
125
|
|
126
|
|
127
|
|
128
|
|
129
|
|
130
|
|
131
|
|
132</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 103</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_unfiltered'>each_unfiltered</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_pass_file'>pass_file</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
|
<span class='id identifier rubyid_pass_fd'>pass_fd</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_pass_file'>pass_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r:binary</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='id identifier rubyid_prepended_creds'>prepended_creds</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_c'>c</span> <span class='rbrace'>}</span>
|
|
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_password'>password</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
|
<span class='kw'>yield</span> <span class='const'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Credential.html#initialize-instance_method" title="Metasploit::Framework::Credential#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>private:</span> <span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='label'>realm:</span> <span class='id identifier rubyid_realm'>realm</span><span class='comma'>,</span> <span class='label'>private_type:</span> <span class='id identifier rubyid_private_type'>private_type</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_blank_passwords'>blank_passwords</span>
|
|
<span class='kw'>yield</span> <span class='const'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Credential.html#initialize-instance_method" title="Metasploit::Framework::Credential#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>private:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>realm:</span> <span class='id identifier rubyid_realm'>realm</span><span class='comma'>,</span> <span class='label'>private_type:</span> <span class='symbol'>:password</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_nil_passwords'>nil_passwords</span>
|
|
<span class='kw'>yield</span> <span class='const'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Credential.html#initialize-instance_method" title="Metasploit::Framework::Credential#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>private:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>realm:</span> <span class='id identifier rubyid_realm'>realm</span><span class='comma'>,</span> <span class='label'>private_type:</span> <span class='symbol'>:password</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_pass_fd'>pass_fd</span>
|
|
<span class='id identifier rubyid_pass_fd'>pass_fd</span><span class='period'>.</span><span class='id identifier rubyid_each_line'>each_line</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pass_from_file'>pass_from_file</span><span class='op'>|</span>
|
|
<span class='id identifier rubyid_pass_from_file'>pass_from_file</span><span class='period'>.</span><span class='id identifier rubyid_chomp!'>chomp!</span>
|
|
<span class='kw'>yield</span> <span class='const'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Credential.html#initialize-instance_method" title="Metasploit::Framework::Credential#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>private:</span> <span class='id identifier rubyid_pass_from_file'>pass_from_file</span><span class='comma'>,</span> <span class='label'>realm:</span> <span class='id identifier rubyid_realm'>realm</span><span class='comma'>,</span> <span class='label'>private_type:</span> <span class='id identifier rubyid_private_type'>private_type</span><span class='lparen'>(</span><span class='id identifier rubyid_pass_from_file'>pass_from_file</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='id identifier rubyid_pass_fd'>pass_fd</span><span class='period'>.</span><span class='id identifier rubyid_seek'>seek</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='id identifier rubyid_additional_privates'>additional_privates</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_add_private'>add_private</span><span class='op'>|</span>
|
|
<span class='kw'>yield</span> <span class='const'><span class='object_link'><a href="../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Credential.html#initialize-instance_method" title="Metasploit::Framework::Credential#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>private:</span> <span class='id identifier rubyid_add_private'>add_private</span><span class='comma'>,</span> <span class='label'>realm:</span> <span class='id identifier rubyid_realm'>realm</span><span class='comma'>,</span> <span class='label'>private_type:</span> <span class='id identifier rubyid_private_type'>private_type</span><span class='lparen'>(</span><span class='id identifier rubyid_add_private'>add_private</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='kw'>ensure</span>
|
|
<span class='id identifier rubyid_pass_fd'>pass_fd</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='kw'>if</span> <span class='id identifier rubyid_pass_fd'>pass_fd</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_pass_fd'>pass_fd</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="empty?-instance_method">
|
|
|
|
#<strong>empty?</strong> ⇒ <tt>Boolean</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns true when #each will have no results to iterate</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
137
|
|
138
|
|
139</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 137</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_empty?'>empty?</span>
|
|
<span class='id identifier rubyid_prepended_creds'>prepended_creds</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_has_privates?'>has_privates?</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="filtered?-instance_method">
|
|
|
|
#<strong>filtered?</strong> ⇒ <tt>Boolean</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns true when a filter is defined</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
144
|
|
145
|
|
146</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 144</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_filtered?'>filtered?</span>
|
|
<span class='op'>!</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="has_privates?-instance_method">
|
|
|
|
#<strong>has_privates?</strong> ⇒ <tt>Boolean</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Returns true when there are any private values set</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
151
|
|
152
|
|
153</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 151</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_has_privates?'>has_privates?</span>
|
|
<span class='id identifier rubyid_password'>password</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>||</span> <span class='id identifier rubyid_pass_file'>pass_file</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>||</span> <span class='op'>!</span><span class='id identifier rubyid_additional_privates'>additional_privates</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_blank_passwords'>blank_passwords</span> <span class='op'>||</span> <span class='id identifier rubyid_nil_passwords'>nil_passwords</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="prepend_cred-instance_method">
|
|
|
|
#<strong>prepend_cred</strong>(cred) ⇒ <tt>self</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Add <span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">credentials</a></span> that will be yielded by <span class='object_link'><a href="#each-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#each (method)">#each</a></span></p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>cred</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="Credential.html" title="Metasploit::Framework::Credential (class)">Credential</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>self</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">See Also:</p>
|
|
<ul class="see">
|
|
|
|
<li><span class='object_link'><a href="#prepended_creds-instance_method" title="Metasploit::Framework::PrivateCredentialCollection#prepended_creds (method)">#prepended_creds</a></span></li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
80
|
|
81
|
|
82
|
|
83</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 80</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_prepend_cred'>prepend_cred</span><span class='lparen'>(</span><span class='id identifier rubyid_cred'>cred</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_prepended_creds'>prepended_creds</span><span class='period'>.</span><span class='id identifier rubyid_unshift'>unshift</span> <span class='id identifier rubyid_cred'>cred</span>
|
|
<span class='kw'>self</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="private_type-instance_method">
|
|
|
|
#<strong>private_type</strong>(private) ⇒ <tt>Symbol</tt> <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Analyze a private value to determine its type by checking it against a known list of regular expressions</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>private</span>
|
|
|
|
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|
|
|
|
|
|
|
—
|
|
<div class='inline'>
|
|
<p>The string to analyze</p>
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>Symbol</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
163
|
|
164
|
|
165
|
|
166
|
|
167
|
|
168
|
|
169
|
|
170
|
|
171</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/credential_collection.rb', line 163</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_private_type'>private_type</span><span class='lparen'>(</span><span class='id identifier rubyid_private'>private</span><span class='rparen'>)</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_private'>private</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[0-9a-f]{32}:[0-9a-f]{32}</span><span class='regexp_end'>/</span></span>
|
|
<span class='symbol'>:ntlm_hash</span>
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_private'>private</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^md5([a-f0-9]{32})$</span><span class='regexp_end'>/</span></span>
|
|
<span class='symbol'>:postgres_md5</span>
|
|
<span class='kw'>else</span>
|
|
<span class='symbol'>:password</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:04:00 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> |