255 lines
10 KiB
HTML
255 lines
10 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>
|
|
Module: Msf::Exploit::SQLi::Utils::Common
|
|
|
|
— 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::SQLi::Utils::Common";
|
|
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="../../SQLi.html" title="Msf::Exploit::SQLi (module)">SQLi</a></span></span> » <span class='title'><span class='object_link'><a href="../Utils.html" title="Msf::Exploit::SQLi::Utils (module)">Utils</a></span></span>
|
|
»
|
|
<span class="title">Common</span>
|
|
|
|
</div>
|
|
|
|
<div id="search">
|
|
|
|
<a class="full_list_link" id="class_list_link"
|
|
href="../../../../class_list.html">
|
|
|
|
<svg width="24" height="24">
|
|
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
</svg>
|
|
</a>
|
|
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div id="content"><h1>Module: Msf::Exploit::SQLi::Utils::Common
|
|
|
|
|
|
|
|
</h1>
|
|
<div class="box_info">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
<dt>Defined in:</dt>
|
|
<dd>lib/msf/core/exploit/sqli/utils/common.rb</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<h2>Overview</h2><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>This module provides utilities used by the SQL injection library, none of the utilities are specific to SQL injection</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
|
|
</div>
|
|
|
|
<h2>
|
|
Constant Summary
|
|
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
</h2>
|
|
|
|
<dl class="constants">
|
|
|
|
<dt id="BIT_COUNTS-constant" class="">BIT_COUNTS =
|
|
|
|
</dt>
|
|
<dd><pre class="code"><span class='lbrace'>{</span> <span class='int'>0</span> <span class='op'>=></span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0b1</span> <span class='op'>=></span> <span class='int'>1</span><span class='comma'>,</span> <span class='int'>0b11</span> <span class='op'>=></span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>0b111</span> <span class='op'>=></span> <span class='int'>3</span><span class='comma'>,</span> <span class='int'>0b1111</span> <span class='op'>=></span> <span class='int'>4</span><span class='comma'>,</span> <span class='int'>0b11111</span> <span class='op'>=></span> <span class='int'>5</span><span class='comma'>,</span> <span class='int'>0b111111</span> <span class='op'>=></span> <span class='int'>6</span><span class='comma'>,</span> <span class='int'>0b1111111</span> <span class='op'>=></span> <span class='int'>7</span><span class='comma'>,</span> <span class='int'>0b11111111</span> <span class='op'>=></span> <span class='int'>8</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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="#get_bitmask-class_method" title="get_bitmask (class method)">.<strong>get_bitmask</strong>(range) ⇒ Object </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Helper method, from a range of characters, returns the MSBs that are common to all of them, and the number of changing bits @param range [Range] the range of characters you expect in the output of the query @return [Array] an array with two integers, the bitmask consisting of bits not changing between characters in the range, and the number of bits changing.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div id="class_method_details" class="method_details_list">
|
|
<h2>Class Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="get_bitmask-class_method">
|
|
|
|
.<strong>get_bitmask</strong>(range) ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Helper method, from a range of characters, returns the MSBs that are common to all of them, and the number of changing bits</p>
|
|
|
|
<pre class="code ruby"><code class="ruby">@param range [Range] the range of characters you expect in the output of the query
|
|
@return [Array] an array with two integers, the bitmask consisting of bits not changing between characters in the range, and the number of bits changing
|
|
</code></pre>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Raises:</p>
|
|
<ul class="raise">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/sqli/utils/common.rb', line 14</span>
|
|
|
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_bitmask'>get_bitmask</span><span class='lparen'>(</span><span class='id identifier rubyid_range'>range</span><span class='rparen'>)</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_range'>range</span> <span class='op'>=</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:ord</span><span class='rparen'>)</span>
|
|
<span class='kw'>else</span>
|
|
<span class='id identifier rubyid_range'>range</span> <span class='op'>=</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
|
|
<span class='kw'>end</span>
|
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Invalid range</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>>=</span> <span class='int'>0</span> <span class='op'>&&</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span> <span class='op'><=</span> <span class='int'>255</span>
|
|
|
|
<span class='comment'># the low bits that change between the ascii codes
|
|
</span> <span class='id identifier rubyid_bitmask'>bitmask</span> <span class='op'>=</span> <span class='id identifier rubyid_range'>range</span><span class='period'>.</span><span class='id identifier rubyid_each_cons'>each_cons</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_v1'>v1</span><span class='comma'>,</span> <span class='id identifier rubyid_v2'>v2</span><span class='rparen'>)</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span> <span class='op'>|</span> <span class='lparen'>(</span><span class='id identifier rubyid_v1'>v1</span> <span class='op'>^</span> <span class='id identifier rubyid_v2'>v2</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
<span class='comment'># the bits that remain the same
|
|
</span> <span class='id identifier rubyid_known_bits'>known_bits</span> <span class='op'>=</span> <span class='id identifier rubyid_range'>range</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>&</span> <span class='op'>~</span><span class='id identifier rubyid_bitmask'>bitmask</span>
|
|
<span class='id identifier rubyid_bits_to_guess'>bits_to_guess</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#BIT_COUNTS-constant" title="Msf::Exploit::SQLi::Utils::Common::BIT_COUNTS (constant)">BIT_COUNTS</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_bitmask'>bitmask</span><span class='rbracket'>]</span>
|
|
<span class='lbracket'>[</span><span class='id identifier rubyid_known_bits'>known_bits</span><span class='comma'>,</span> <span class='id identifier rubyid_bits_to_guess'>bits_to_guess</span><span class='rbracket'>]</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
Generated on Fri May 8 17:01:56 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> |