509 lines
14 KiB
HTML
509 lines
14 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>
|
||
Class: Msf::RPC::JSON::V1_0::RpcCommand
|
||
|
||
— 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::RPC::JSON::V1_0::RpcCommand";
|
||
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 (R)</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="../../../RPC.html" title="Msf::RPC (module)">RPC</a></span></span> » <span class='title'><span class='object_link'><a href="../../JSON.html" title="Msf::RPC::JSON (module)">JSON</a></span></span> » <span class='title'><span class='object_link'><a href="../V1_0.html" title="Msf::RPC::JSON::V1_0 (module)">V1_0</a></span></span>
|
||
»
|
||
<span class="title">RpcCommand</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::RPC::JSON::V1_0::RpcCommand
|
||
|
||
|
||
|
||
</h1>
|
||
<div class="box_info">
|
||
|
||
<dl>
|
||
<dt>Inherits:</dt>
|
||
<dd>
|
||
<span class="inheritName"><span class='object_link'><a href="../RpcCommand.html" title="Msf::RPC::JSON::RpcCommand (class)">RpcCommand</a></span></span>
|
||
|
||
<ul class="fullTree">
|
||
<li>Object</li>
|
||
|
||
<li class="next"><span class='object_link'><a href="../RpcCommand.html" title="Msf::RPC::JSON::RpcCommand (class)">RpcCommand</a></span></li>
|
||
|
||
<li class="next">Msf::RPC::JSON::V1_0::RpcCommand</li>
|
||
|
||
</ul>
|
||
<a href="#" class="inheritanceTree">show all</a>
|
||
|
||
</dd>
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl>
|
||
<dt>Defined in:</dt>
|
||
<dd>lib/msf/core/rpc/json/v1_0/rpc_command.rb</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<h2>
|
||
Constant Summary
|
||
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
||
</h2>
|
||
|
||
<dl class="constants">
|
||
|
||
<dt id="METHOD_GROUP_SEPARATOR-constant" class="">METHOD_GROUP_SEPARATOR =
|
||
|
||
</dt>
|
||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span></pre></dd>
|
||
|
||
<dt id="MODULE_EXECUTE_KEY-constant" class="">MODULE_EXECUTE_KEY =
|
||
|
||
</dt>
|
||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>module.execute</span><span class='tstring_end'>'</span></span></pre></dd>
|
||
|
||
<dt id="PAYLOAD_MODULE_TYPE_KEY-constant" class="">PAYLOAD_MODULE_TYPE_KEY =
|
||
|
||
</dt>
|
||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>payload</span><span class='tstring_end'>'</span></span></pre></dd>
|
||
|
||
<dt id="PAYLOAD_KEY-constant" class="">PAYLOAD_KEY =
|
||
|
||
</dt>
|
||
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>payload</span><span class='tstring_end'>'</span></span></pre></dd>
|
||
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h2>Instance Attribute Summary</h2>
|
||
|
||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../RpcCommand.html" title="Msf::RPC::JSON::RpcCommand (class)">RpcCommand</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="../RpcCommand.html#execute_timeout-instance_method" title="Msf::RPC::JSON::RpcCommand#execute_timeout (method)">#execute_timeout</a></span>, <span class='object_link'><a href="../RpcCommand.html#framework-instance_method" title="Msf::RPC::JSON::RpcCommand#framework (method)">#framework</a></span></p>
|
||
|
||
|
||
|
||
<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="#execute-instance_method" title="#execute (instance method)">#<strong>execute</strong>(method, params) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Invokes the method on the receiver object with the specified params, returning the method’s return value.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(framework, execute_timeout: 7200) ⇒ RpcCommand </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
<span class="note title constructor">constructor</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Instantiate an RpcCommand.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#register_method-instance_method" title="#register_method (instance method)">#<strong>register_method</strong>(method, name: nil) ⇒ 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>(framework, execute_timeout: 7200) ⇒ <tt><span class='object_link'><a href="" title="Msf::RPC::JSON::V1_0::RpcCommand (class)">RpcCommand</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Instantiate an RpcCommand.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>framework</span>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="../../../Simple/Framework.html" title="Msf::Simple::Framework (module)">Msf::Simple::Framework</a></span></tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>Framework wrapper instance</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
|
||
<span class='name'>execute_timeout</span>
|
||
|
||
|
||
<span class='type'>(<tt>Integer</tt>)</span>
|
||
|
||
|
||
<em class="default">(defaults to: <tt>7200</tt>)</em>
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>execute timeout duration in seconds</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
15
|
||
16
|
||
17
|
||
18
|
||
19
|
||
20
|
||
21
|
||
22
|
||
23
|
||
24</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 15</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_framework'>framework</span><span class='comma'>,</span> <span class='label'>execute_timeout:</span> <span class='int'>7200</span><span class='rparen'>)</span>
|
||
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_framework'>framework</span><span class='comma'>,</span> <span class='label'>execute_timeout:</span> <span class='id identifier rubyid_execute_timeout'>execute_timeout</span><span class='rparen'>)</span>
|
||
|
||
<span class='comment'># The legacy Msf::RPC::Service will not be started, however, it will be used to proxy
|
||
</span> <span class='comment'># requests to existing handlers. This frees the command from having to act as the
|
||
</span> <span class='comment'># service to RPC_Base subclasses and expose accessors for tokens and users.
|
||
</span> <span class='ivar'>@legacy_rpc_service</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../RPC.html" title="Msf::RPC (module)">RPC</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../Service.html" title="Msf::RPC::Service (class)">Service</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../../Service.html#initialize-instance_method" title="Msf::RPC::Service#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@framework</span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
||
<span class='label'>execute_timeout:</span> <span class='ivar'>@execute_timeout</span>
|
||
<span class='rbrace'>}</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="execute-instance_method">
|
||
|
||
#<strong>execute</strong>(method, params) ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Invokes the method on the receiver object with the specified params, returning the method’s return value.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>method</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>the RPC method name</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
<li>
|
||
|
||
<span class='name'>params</span>
|
||
|
||
|
||
<span class='type'>(<tt>Array</tt>, <tt>Hash</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>parameters for the RPC call</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>Object</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>the method’s return value.</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
36
|
||
37
|
||
38
|
||
39
|
||
40
|
||
41</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 36</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_execute_internal'>execute_internal</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_post_process_result'>post_process_result</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
||
|
||
<span class='id identifier rubyid_result'>result</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="register_method-instance_method">
|
||
|
||
#<strong>register_method</strong>(method, name: nil) ⇒ <tt>Object</tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
<p class="tag_title">Raises:</p>
|
||
<ul class="raise">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt>RuntimeError</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The method is not implemented</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
27
|
||
28
|
||
29</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/v1_0/rpc_command.rb', line 27</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_register_method'>register_method</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</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='embexpr_end'>}</span><span class='tstring_content'>#</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid___method__'>__method__</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not implemented</span><span class='tstring_end'>"</span></span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="footer">
|
||
Generated on Fri May 8 17:03:34 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> |