941 lines
32 KiB
HTML
941 lines
32 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::Relay::NTLM::Target::LDAP::Client
|
||
|
||
— 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::Relay::NTLM::Target::LDAP::Client";
|
||
relpath = '../../../../../../../';
|
||
</script>
|
||
|
||
|
||
<script type="text/javascript" charset="utf-8" src="../../../../../../../js/jquery.js"></script>
|
||
|
||
<script type="text/javascript" charset="utf-8" src="../../../../../../../js/app.js"></script>
|
||
|
||
|
||
</head>
|
||
<body>
|
||
<div class="nav_wrap">
|
||
<iframe id="nav" src="../../../../../../../class_list.html?1"></iframe>
|
||
<div id="resizer"></div>
|
||
</div>
|
||
|
||
<div id="main" tabindex="-1">
|
||
<div id="header">
|
||
<div id="menu">
|
||
|
||
<a href="../../../../../../../_index.html">Index (C)</a> »
|
||
<span class='title'><span class='object_link'><a href="../../../../../../../Msf.html" title="Msf (module)">Msf</a></span></span> » <span class='title'><span class='object_link'><a href="../../../../../../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="../../../../Relay.html" title="Msf::Exploit::Remote::Relay (module)">Relay</a></span></span> » <span class='title'>NTLM</span> » <span class='title'>Target</span> » <span class='title'><span class='object_link'><a href="../LDAP.html" title="Msf::Exploit::Remote::Relay::NTLM::Target::LDAP (module)">LDAP</a></span></span>
|
||
»
|
||
<span class="title">Client</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::Relay::NTLM::Target::LDAP::Client
|
||
|
||
|
||
|
||
</h1>
|
||
<div class="box_info">
|
||
|
||
<dl>
|
||
<dt>Inherits:</dt>
|
||
<dd>
|
||
<span class="inheritName">Net::LDAP::Connection</span>
|
||
|
||
<ul class="fullTree">
|
||
<li>Object</li>
|
||
|
||
<li class="next">Net::LDAP::Connection</li>
|
||
|
||
<li class="next">Msf::Exploit::Remote::Relay::NTLM::Target::LDAP::Client</li>
|
||
|
||
</ul>
|
||
<a href="#" class="inheritanceTree">show all</a>
|
||
|
||
</dd>
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl>
|
||
<dt>Defined in:</dt>
|
||
<dd>lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
|
||
<h2>Overview</h2><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>The LDAP Client for interacting with the relayed_target This isn’t actually a Rex::Proto::LDAP::Client instance, but rather a Net::LDAP::Connection instance because of the state requirements of the relay operations</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
||
<ul class="summary">
|
||
|
||
<li class="protected ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#logger-instance_method" title="#logger (instance method)">#<strong>logger</strong> ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
<span class="note title readonly">readonly</span>
|
||
|
||
|
||
|
||
<span class="note title protected">protected</span>
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Returns the value of attribute logger.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#target-instance_method" title="#target (instance method)">#<strong>target</strong> ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
<span class="note title readonly">readonly</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Returns the value of attribute target.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#timeout-instance_method" title="#timeout (instance method)">#<strong>timeout</strong> ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Returns the value of attribute timeout.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
|
||
<h2>
|
||
Class Method Summary
|
||
<small><a href="#" class="summary_toggle">collapse</a></small>
|
||
</h2>
|
||
|
||
<ul class="summary">
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#create-class_method" title="create (class method)">.<strong>create</strong>(provider, target, logger, timeout) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
<h2>
|
||
Instance Method Summary
|
||
<small><a href="#" class="summary_toggle">collapse</a></small>
|
||
</h2>
|
||
|
||
<ul class="summary">
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#create_ldap_client-instance_method" title="#create_ldap_client (instance method)">#<strong>create_ldap_client</strong> ⇒ Rex::Proto::LDAP::Client </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Instantiate a Rex::Proto::LDAP::Client that can be used as a normal LDAP client.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(server, provider: nil, target: nil, logger: nil, timeout: DefaultConnectTimeout) ⇒ Client </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
<span class="note title constructor">constructor</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>A new instance of Client.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#is_http_source%3F-instance_method" title="#is_http_source? (instance method)">#<strong>is_http_source?</strong> ⇒ Boolean </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Determines whether the relay connection originated from an HTTP server.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#relay_ntlmssp_type1-instance_method" title="#relay_ntlmssp_type1 (instance method)">#<strong>relay_ntlmssp_type1</strong>(client_type1_msg) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#relay_ntlmssp_type3-instance_method" title="#relay_ntlmssp_type3 (instance method)">#<strong>relay_ntlmssp_type3</strong>(client_type3_msg) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></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>(server, provider: nil, target: nil, logger: nil, timeout: DefaultConnectTimeout) ⇒ <tt><span class='object_link'><a href="" title="Msf::Exploit::Remote::Relay::NTLM::Target::LDAP::Client (class)">Client</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns a new instance of Client.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
11
|
||
12
|
||
13
|
||
14
|
||
15
|
||
16
|
||
17</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 11</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_server'>server</span><span class='comma'>,</span> <span class='label'>provider:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>target:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>logger:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='const'>DefaultConnectTimeout</span><span class='rparen'>)</span>
|
||
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='id identifier rubyid_logger'>logger</span>
|
||
<span class='ivar'>@provider</span> <span class='op'>=</span> <span class='id identifier rubyid_provider'>provider</span>
|
||
<span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
|
||
<span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_server'>server</span><span class='lbracket'>[</span><span class='symbol'>:connect_timeout</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
||
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_server'>server</span><span class='rparen'>)</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="logger-instance_method">
|
||
|
||
#<strong>logger</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly, protected)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns the value of attribute logger.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
107
|
||
108
|
||
109</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 107</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
||
<span class='ivar'>@logger</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
|
||
<span id=""></span>
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="target-instance_method">
|
||
|
||
#<strong>target</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns the value of attribute target.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</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/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 9</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
|
||
<span class='ivar'>@target</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
|
||
<span id="timeout=-instance_method"></span>
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="timeout-instance_method">
|
||
|
||
#<strong>timeout</strong> ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns the value of attribute timeout.</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/relay/ntlm/target/ldap/client.rb', line 8</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
||
<span class='ivar'>@timeout</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<div id="class_method_details" class="method_details_list">
|
||
<h2>Class Method Details</h2>
|
||
|
||
|
||
<div class="method_details first">
|
||
<h3 class="signature first" id="create-class_method">
|
||
|
||
.<strong>create</strong>(provider, target, logger, timeout) ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
19
|
||
20
|
||
21
|
||
22
|
||
23
|
||
24
|
||
25
|
||
26
|
||
27
|
||
28
|
||
29
|
||
30</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 19</span>
|
||
|
||
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_provider'>provider</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span><span class='comma'>,</span> <span class='id identifier rubyid_logger'>logger</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
||
<span class='lbrace'>{</span>
|
||
<span class='label'>host:</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_ip'>ip</span><span class='comma'>,</span>
|
||
<span class='label'>port:</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='comma'>,</span>
|
||
<span class='label'>connect_timeout:</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
||
<span class='rbrace'>}</span><span class='comma'>,</span>
|
||
<span class='label'>provider:</span> <span class='id identifier rubyid_provider'>provider</span><span class='comma'>,</span>
|
||
<span class='label'>target:</span> <span class='id identifier rubyid_target'>target</span><span class='comma'>,</span>
|
||
<span class='label'>logger:</span> <span class='id identifier rubyid_logger'>logger</span>
|
||
<span class='rparen'>)</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="create_ldap_client-instance_method">
|
||
|
||
#<strong>create_ldap_client</strong> ⇒ <tt><span class='object_link'><a href="../../../../../../../Rex/Proto/LDAP/Client.html" title="Rex::Proto::LDAP::Client (class)">Rex::Proto::LDAP::Client</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Instantiate a Rex::Proto::LDAP::Client that can be used as a normal LDAP client. This is mainly used to setup an LDAP session.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="../../../../../../../Rex/Proto/LDAP/Client.html" title="Rex::Proto::LDAP::Client (class)">Rex::Proto::LDAP::Client</a></span></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
94
|
||
95
|
||
96
|
||
97
|
||
98
|
||
99
|
||
100
|
||
101
|
||
102
|
||
103</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 94</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_create_ldap_client'>create_ldap_client</span>
|
||
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../../../../../Rex.html" title="Rex (module)">Rex</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../../../Rex/Proto.html" title="Rex::Proto (module)">Proto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../../../Rex/Proto/LDAP.html" title="Rex::Proto::LDAP (module)">LDAP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../../../Rex/Proto/LDAP/Client.html" title="Rex::Proto::LDAP::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../../../../../../../Rex/Proto/LDAP/Client.html#initialize-instance_method" title="Rex::Proto::LDAP::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
||
<span class='label'>host:</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_ip'>ip</span><span class='comma'>,</span>
|
||
<span class='label'>port:</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='comma'>,</span>
|
||
<span class='label'>auth:</span> <span class='lbrace'>{</span> <span class='label'>method:</span> <span class='symbol'>:rex_relay_ntlm</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
||
<span class='label'>connect_timeout:</span> <span class='ivar'>@timeout</span>
|
||
<span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span> <span class='kw'>self</span>
|
||
<span class='id identifier rubyid_client'>client</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="is_http_source?-instance_method">
|
||
|
||
#<strong>is_http_source?</strong> ⇒ <tt>Boolean</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Determines whether the relay connection originated from an HTTP server.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>true if the provider’s class name contains ‘httpserver’, false otherwise.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
61
|
||
62
|
||
63</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 61</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_is_http_source?'>is_http_source?</span>
|
||
<span class='ivar'>@provider</span> <span class='op'>&&</span> <span class='ivar'>@provider</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</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'>httpserver</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="relay_ntlmssp_type1-instance_method">
|
||
|
||
#<strong>relay_ntlmssp_type1</strong>(client_type1_msg) ⇒ <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'>client_type1_msg</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
36
|
||
37
|
||
38
|
||
39
|
||
40
|
||
41
|
||
42
|
||
43
|
||
44
|
||
45
|
||
46
|
||
47
|
||
48
|
||
49
|
||
50
|
||
51
|
||
52
|
||
53
|
||
54
|
||
55
|
||
56</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 36</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_relay_ntlmssp_type1'>relay_ntlmssp_type1</span><span class='lparen'>(</span><span class='id identifier rubyid_client_type1_msg'>client_type1_msg</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_ntlm_message'>ntlm_message</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Message</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_client_type1_msg'>client_type1_msg</span><span class='rparen'>)</span>
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_ntlm_message'>ntlm_message</span><span class='period'>.</span><span class='id identifier rubyid_has_flag?'>has_flag?</span><span class='lparen'>(</span><span class='symbol'>:SIGN</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_print_warning'>print_warning</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Relay client\'s NTLM type 1 message requests signing, relaying to LDAP will not work</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_pdu'>pdu</span> <span class='op'>=</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='symbol'>:rex_relay_ntlm</span><span class='comma'>,</span> <span class='label'>ntlm_message:</span> <span class='id identifier rubyid_client_type1_msg'>client_type1_msg</span><span class='rparen'>)</span>
|
||
|
||
<span class='kw'>unless</span> <span class='id identifier rubyid_pdu'>pdu</span><span class='period'>.</span><span class='id identifier rubyid_result_code'>result_code</span> <span class='op'>==</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>LDAP</span><span class='op'>::</span><span class='const'>ResultCodeSaslBindInProgress</span>
|
||
<span class='kw'>return</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="../../../../../../Exploit.html" title="Msf::Exploit (class)">Exploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../Remote.html" title="Msf::Exploit::Remote (class)">Remote</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../Relay.html" title="Msf::Exploit::Remote::Relay (module)">Relay</a></span></span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Target</span><span class='op'>::</span><span class='const'>RelayResult</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
||
<span class='label'>nt_status:</span> <span class='const'><span class='object_link'><a href="../../../../../../WindowsError.html" title="Msf::WindowsError (class)">WindowsError</a></span></span><span class='op'>::</span><span class='const'>NTStatus</span><span class='op'>::</span><span class='const'>STATUS_LOGON_FAILURE</span>
|
||
<span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_server_type2_message'>server_type2_message</span> <span class='op'>=</span> <span class='id identifier rubyid_pdu'>pdu</span><span class='period'>.</span><span class='id identifier rubyid_result_server_sasl_creds'>result_server_sasl_creds</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</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="../../../../../../Exploit.html" title="Msf::Exploit (class)">Exploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../Remote.html" title="Msf::Exploit::Remote (class)">Remote</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../Relay.html" title="Msf::Exploit::Remote::Relay (module)">Relay</a></span></span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Target</span><span class='op'>::</span><span class='const'>RelayResult</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
||
<span class='label'>message:</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Message</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_server_type2_message'>server_type2_message</span><span class='rparen'>)</span><span class='comma'>,</span>
|
||
<span class='label'>nt_status:</span> <span class='const'><span class='object_link'><a href="../../../../../../WindowsError.html" title="Msf::WindowsError (class)">WindowsError</a></span></span><span class='op'>::</span><span class='const'>NTStatus</span><span class='op'>::</span><span class='const'>STATUS_MORE_PROCESSING_REQUIRED</span>
|
||
<span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="relay_ntlmssp_type3-instance_method">
|
||
|
||
#<strong>relay_ntlmssp_type3</strong>(client_type3_msg) ⇒ <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'>client_type3_msg</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
67
|
||
68
|
||
69
|
||
70
|
||
71
|
||
72
|
||
73
|
||
74
|
||
75
|
||
76
|
||
77
|
||
78
|
||
79
|
||
80
|
||
81
|
||
82
|
||
83
|
||
84
|
||
85
|
||
86
|
||
87
|
||
88</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/relay/ntlm/target/ldap/client.rb', line 67</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_relay_ntlmssp_type3'>relay_ntlmssp_type3</span><span class='lparen'>(</span><span class='id identifier rubyid_client_type3_msg'>client_type3_msg</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_ntlm_message'>ntlm_message</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Message</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_client_type3_msg'>client_type3_msg</span><span class='rparen'>)</span>
|
||
|
||
<span class='comment'># Suppress the warning for HTTP sources because they can safely relay NTLMv2 type 3 messages. During testing
|
||
</span> <span class='comment'># non-Windows HTTP clients that sent NTLMv2 type 3 messages were able to be relayed to LDAP without issue.
|
||
</span> <span class='kw'>if</span> <span class='id identifier rubyid_ntlm_message'>ntlm_message</span><span class='period'>.</span><span class='id identifier rubyid_ntlm_version'>ntlm_version</span> <span class='op'>==</span> <span class='symbol'>:ntlmv2</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_is_http_source?'>is_http_source?</span>
|
||
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_print_warning'>print_warning</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Relay client\'s NTLM type 3 message is NTLMv2, relaying to LDAP will not work</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='id identifier rubyid_pdu'>pdu</span> <span class='op'>=</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='label'>method:</span> <span class='symbol'>:rex_relay_ntlm</span><span class='comma'>,</span> <span class='label'>ntlm_message:</span> <span class='id identifier rubyid_client_type3_msg'>client_type3_msg</span><span class='rparen'>)</span>
|
||
|
||
<span class='kw'>case</span> <span class='id identifier rubyid_pdu'>pdu</span><span class='period'>.</span><span class='id identifier rubyid_result_code'>result_code</span>
|
||
<span class='kw'>when</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>LDAP</span><span class='op'>::</span><span class='const'>ResultCodeSuccess</span>
|
||
<span class='id identifier rubyid_nt_status'>nt_status</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../../../../WindowsError.html" title="Msf::WindowsError (class)">WindowsError</a></span></span><span class='op'>::</span><span class='const'>NTStatus</span><span class='op'>::</span><span class='const'>STATUS_SUCCESS</span>
|
||
<span class='kw'>when</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>LDAP</span><span class='op'>::</span><span class='const'>ResultCodeInvalidCredentials</span>
|
||
<span class='id identifier rubyid_nt_status'>nt_status</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../../../../WindowsError.html" title="Msf::WindowsError (class)">WindowsError</a></span></span><span class='op'>::</span><span class='const'>NTStatus</span><span class='op'>::</span><span class='const'>STATUS_LOGON_FAILURE</span>
|
||
<span class='kw'>else</span>
|
||
<span class='kw'>return</span> <span class='kw'>nil</span>
|
||
<span class='kw'>end</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="../../../../../../Exploit.html" title="Msf::Exploit (class)">Exploit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../../Remote.html" title="Msf::Exploit::Remote (class)">Remote</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../Relay.html" title="Msf::Exploit::Remote::Relay (module)">Relay</a></span></span><span class='op'>::</span><span class='const'>NTLM</span><span class='op'>::</span><span class='const'>Target</span><span class='op'>::</span><span class='const'>RelayResult</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>nt_status:</span> <span class='id identifier rubyid_nt_status'>nt_status</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="footer">
|
||
Generated on Fri May 8 17:05:35 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> |