2329 lines
60 KiB
HTML
2329 lines
60 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::HTTP::HttpCookie
|
||
|
|
|
||
|
|
— 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::HTTP::HttpCookie";
|
||
|
|
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 (H)</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="../HTTP.html" title="Msf::Exploit::Remote::HTTP (module)">HTTP</a></span></span>
|
||
|
|
»
|
||
|
|
<span class="title">HttpCookie</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::HTTP::HttpCookie
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h1>
|
||
|
|
<div class="box_info">
|
||
|
|
|
||
|
|
<dl>
|
||
|
|
<dt>Inherits:</dt>
|
||
|
|
<dd>
|
||
|
|
<span class="inheritName">Object</span>
|
||
|
|
|
||
|
|
<ul class="fullTree">
|
||
|
|
<li>Object</li>
|
||
|
|
|
||
|
|
<li class="next">Msf::Exploit::Remote::HTTP::HttpCookie</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
<a href="#" class="inheritanceTree">show all</a>
|
||
|
|
|
||
|
|
</dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<dl>
|
||
|
|
<dt>Includes:</dt>
|
||
|
|
<dd>Comparable</dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<dl>
|
||
|
|
<dt>Defined in:</dt>
|
||
|
|
<dd>lib/msf/core/exploit/remote/http/http_cookie.rb</dd>
|
||
|
|
</dl>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<h2>Overview</h2><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>This class is a representation of a Http Cookie with some built in convenience methods. Acts as a wrapper for the <code>HTTP::Cookie</code> (<a href="https://www.rubydoc.info/gems/http-cookie/1.0.3/HTTP/Cookie">www.rubydoc.info/gems/http-cookie/1.0.3/HTTP/Cookie</a>) class .</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<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="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#acceptable%3F-instance_method" title="#acceptable? (instance method)">#<strong>acceptable?</strong> ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Tests if it is OK to accept this cookie.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#acceptable_from_uri%3F-instance_method" title="#acceptable_from_uri? (instance method)">#<strong>acceptable_from_uri?</strong>(uri) ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Tests if it is OK to accept this cookie if it is sent from the passed <code>uri</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#accessed_at-instance_method" title="#accessed_at (instance method)">#<strong>accessed_at</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie accessed_at value of type <code>Time</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#accessed_at=-instance_method" title="#accessed_at= (instance method)">#<strong>accessed_at=</strong>(time) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie accessed_at time.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#cookie_value-instance_method" title="#cookie_value (instance method)">#<strong>cookie_value</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
(also: #to_s)
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns a string representation of the cookie for use in a cookie header.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#created_at-instance_method" title="#created_at (instance method)">#<strong>created_at</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie created_at value of type <code>Time</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#created_at=-instance_method" title="#created_at= (instance method)">#<strong>created_at=</strong>(time) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie accessed_at time.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#domain-instance_method" title="#domain (instance method)">#<strong>domain</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie domain of type <code>String</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#domain=-instance_method" title="#domain= (instance method)">#<strong>domain=</strong>(domain) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie domain.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#expired%3F-instance_method" title="#expired? (instance method)">#<strong>expired?</strong>(time = Time.now) ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns a boolean indicating if the cookie will have expired by the date and time represented by <code>time</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#expires-instance_method" title="#expires (instance method)">#<strong>expires</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the value of cookie expires of type <code>Time</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#expires=-instance_method" title="#expires= (instance method)">#<strong>expires=</strong>(expires) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie expires value.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#httponly-instance_method" title="#httponly (instance method)">#<strong>httponly</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie httponly value of type <code>Boolean</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#httponly=-instance_method" title="#httponly= (instance method)">#<strong>httponly=</strong>(httponly) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie httponly value.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, value = nil, **attr_hash) ⇒ HttpCookie </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class="note title constructor">constructor</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns a new <code>HttpCookie</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#max_age-instance_method" title="#max_age (instance method)">#<strong>max_age</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the value of max_age.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#max_age=-instance_method" title="#max_age= (instance method)">#<strong>max_age=</strong>(max_age) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie max_age of type <code>Integer</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the name of cookie of type <code>String</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#name=-instance_method" title="#name= (instance method)">#<strong>name=</strong>(name) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie name.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#origin-instance_method" title="#origin (instance method)">#<strong>origin</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#origin=-instance_method" title="#origin= (instance method)">#<strong>origin=</strong>(origin) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#path-instance_method" title="#path (instance method)">#<strong>path</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie path of type <code>String</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#path=-instance_method" title="#path= (instance method)">#<strong>path=</strong>(path) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie path.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#secure-instance_method" title="#secure (instance method)">#<strong>secure</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the cookie secure value of type <code>Boolean</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#secure=-instance_method" title="#secure= (instance method)">#<strong>secure=</strong>(secure) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie secure value.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#session%3F-instance_method" title="#session? (instance method)">#<strong>session?</strong> ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns a boolean indicating if the cookie is a Session Cookie.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#valid_for_uri%3F-instance_method" title="#valid_for_uri? (instance method)">#<strong>valid_for_uri?</strong>(uri) ⇒ Boolean </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns a boolean indicating if the cookie can be sent to the passed <code>uri</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#value-instance_method" title="#value (instance method)">#<strong>value</strong> ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Returns the value of cookie of type <code>String</code>.</p>
|
||
|
|
</div></span>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
|
||
|
|
<li class="public ">
|
||
|
|
<span class="summary_signature">
|
||
|
|
|
||
|
|
<a href="#value=-instance_method" title="#value= (instance method)">#<strong>value=</strong>(value) ⇒ Object </a>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="summary_desc"><div class='inline'>
|
||
|
|
<p>Sets the cookie value.</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>(name, value = nil, **attr_hash) ⇒ <tt><span class='object_link'><a href="" title="Msf::Exploit::Remote::HTTP::HttpCookie (class)">HttpCookie</a></span></tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns a new <code>HttpCookie</code>.</p>
|
||
|
|
|
||
|
|
<p>Name can be a string.</p>
|
||
|
|
<ul><li>
|
||
|
|
<p>If a <code>String</code>, the name of the cookie is set to the passed <code>name</code>.</p>
|
||
|
|
</li></ul>
|
||
|
|
|
||
|
|
<p> - If only a <code>String</code> is passed to <code>name</code>, the cookie is set as a session cookie.</p>
|
||
|
|
|
||
|
|
<p>Value can be a <code>String</code> or <code>nil</code>.</p>
|
||
|
|
<ul><li>
|
||
|
|
<p>If a <code>String</code>, the value of the cookie is set as the passed <code>cookie</code>.</p>
|
||
|
|
</li><li>
|
||
|
|
<p>If <code>nil</code>, the value of the cookie is set as an empty <code>String</code> <tt>”</tt> and the cookie is set to expire at <code>UNIX_EPOCH</code></p>
|
||
|
|
</li></ul>
|
||
|
|
|
||
|
|
<p><code>attr_hash</code> can be used to set the values of <code>domain</code>, <code>path</code>, <code>max_age</code>, <code>expires</code>, <code>secure</code>, <code>httponly</code>, <code>accessed_at</code>, <code>created_at</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
25
|
||
|
|
26
|
||
|
|
27
|
||
|
|
28
|
||
|
|
29
|
||
|
|
30
|
||
|
|
31
|
||
|
|
32
|
||
|
|
33
|
||
|
|
34
|
||
|
|
35
|
||
|
|
36
|
||
|
|
37
|
||
|
|
38
|
||
|
|
39</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 25</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_attr_hash'>attr_hash</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span>
|
||
|
|
<span class='ivar'>@cookie</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Cookie</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>HTTP</span><span class='op'>::</span><span class='const'>Cookie</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
|
||
|
|
<span class='id identifier rubyid_attr_hash'>attr_hash</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_k'>k</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>max-age</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_max_age'>max_age</span><span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
|
||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</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="<=>-instance_method">
|
||
|
|
|
||
|
|
#<strong><=></strong>(other) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
266
|
||
|
|
267
|
||
|
|
268</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 266</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='op'><=></span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="acceptable?-instance_method">
|
||
|
|
|
||
|
|
#<strong>acceptable?</strong> ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Tests if it is OK to accept this cookie. If either domain or path is missing an ArgumentError is raised.</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">
|
||
|
|
|
||
|
|
|
||
|
|
242
|
||
|
|
243
|
||
|
|
244</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 242</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_acceptable?'>acceptable?</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_acceptable?'>acceptable?</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="acceptable_from_uri?-instance_method">
|
||
|
|
|
||
|
|
#<strong>acceptable_from_uri?</strong>(uri) ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Tests if it is OK to accept this cookie if it is sent from the passed <code>uri</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
<p class="tag_title">Parameters:</p>
|
||
|
|
<ul class="param">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
<span class='name'>uri</span>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>The uri that will be checked</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
<p class="tag_title">Returns:</p>
|
||
|
|
<ul class="return">
|
||
|
|
|
||
|
|
<li>
|
||
|
|
|
||
|
|
|
||
|
|
<span class='type'>(<tt>Boolean</tt>)</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
—
|
||
|
|
<div class='inline'>
|
||
|
|
<p>True if the URI is an acceptable URI, false if the URI is nil or resolves to a blank string</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</li>
|
||
|
|
|
||
|
|
</ul>
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
259
|
||
|
|
260
|
||
|
|
261
|
||
|
|
262
|
||
|
|
263
|
||
|
|
264</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 259</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_acceptable_from_uri?'>acceptable_from_uri?</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||
|
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
||
|
|
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_acceptable_from_uri?'>acceptable_from_uri?</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="accessed_at-instance_method">
|
||
|
|
|
||
|
|
#<strong>accessed_at</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie accessed_at value of type <code>Time</code>. accessed_at indicates when a cookie was last interacted with.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
190
|
||
|
|
191
|
||
|
|
192</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 190</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_accessed_at'>accessed_at</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_accessed_at'>accessed_at</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="accessed_at=-instance_method">
|
||
|
|
|
||
|
|
#<strong>accessed_at=</strong>(time) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie accessed_at time.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>time</code> must be <code>nil</code>, an instance of <code>Time</code>, or an object that can be converted successfully to an <code>Time</code> with <code>Time.parse</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
198
|
||
|
|
199
|
||
|
|
200
|
||
|
|
201
|
||
|
|
202
|
||
|
|
203
|
||
|
|
204</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 198</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_accessed_at='>accessed_at=</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_time'>time</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_time'>time</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_accessed_at'>accessed_at</span> <span class='op'>=</span> <span class='id identifier rubyid_time'>time</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_accessed_at'>accessed_at</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="cookie_value-instance_method">
|
||
|
|
|
||
|
|
#<strong>cookie_value</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<span class="aliases">Also known as:
|
||
|
|
<span class="names"><span id='to_s-instance_method'>to_s</span></span>
|
||
|
|
</span>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns a string representation of the cookie for use in a cookie header. Comes in format “#<span class='object_link'><a href="#name-instance_method" title="Msf::Exploit::Remote::HTTP::HttpCookie#name (method)">#name</a></span>=#<span class='object_link'><a href="#value-instance_method" title="Msf::Exploit::Remote::HTTP::HttpCookie#value (method)">#value</a></span>”.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
225
|
||
|
|
226
|
||
|
|
227</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 225</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_cookie_value'>cookie_value</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_cookie_value'>cookie_value</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="created_at-instance_method">
|
||
|
|
|
||
|
|
#<strong>created_at</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie created_at value of type <code>Time</code>. created_at indicates when a cookie was created.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
207
|
||
|
|
208
|
||
|
|
209</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 207</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_created_at'>created_at</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="created_at=-instance_method">
|
||
|
|
|
||
|
|
#<strong>created_at=</strong>(time) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie accessed_at time.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>time</code> must be <code>nil</code>, an instance of <code>Time</code>, or an object that can be converted successfully to an <code>Time</code> with <code>Time.parse</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
215
|
||
|
|
216
|
||
|
|
217
|
||
|
|
218
|
||
|
|
219
|
||
|
|
220
|
||
|
|
221</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 215</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_created_at='>created_at=</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_time'>time</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_time'>time</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_created_at'>created_at</span> <span class='op'>=</span> <span class='id identifier rubyid_time'>time</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_created_at'>created_at</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="domain-instance_method">
|
||
|
|
|
||
|
|
#<strong>domain</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie domain of type <code>String</code>.</p>
|
||
|
|
|
||
|
|
<p>If omitted, defaults to the host of the current document URL, not including subdomains. Leading dots in domain names (.example.com) are ignored. Multiple host/domain values are not allowed, but if a domain is specified, then subdomains are always included.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
160
|
||
|
|
161
|
||
|
|
162
|
||
|
|
163
|
||
|
|
164
|
||
|
|
165
|
||
|
|
166</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 160</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_domain'>domain</span>
|
||
|
|
<span class='kw'>if</span> <span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_domain'>domain</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||
|
|
<span class='kw'>nil</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_domain'>domain</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="domain=-instance_method">
|
||
|
|
|
||
|
|
#<strong>domain=</strong>(domain) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie domain.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>domain</code> must be <code>nil</code>, an instance of <code>String</code>, or an object that can be converted successfully to an <code>String</code> with <code>to_s</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
172
|
||
|
|
173
|
||
|
|
174
|
||
|
|
175
|
||
|
|
176
|
||
|
|
177
|
||
|
|
178</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 172</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_domain='>domain=</span><span class='lparen'>(</span><span class='id identifier rubyid_domain'>domain</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_domain'>domain</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_domain'>domain</span> <span class='op'>=</span> <span class='id identifier rubyid_domain'>domain</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_domain'>domain</span> <span class='op'>=</span> <span class='id identifier rubyid_domain'>domain</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="expired?-instance_method">
|
||
|
|
|
||
|
|
#<strong>expired?</strong>(time = Time.now) ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns a boolean indicating if the cookie will have expired by the date and time represented by <code>time</code>. <code>time</code> defaults to <code>Time.now</code>, so the method can return a different value after enough calls.</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">
|
||
|
|
|
||
|
|
|
||
|
|
232
|
||
|
|
233
|
||
|
|
234</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 232</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_expired?'>expired?</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_expired?'>expired?</span><span class='lparen'>(</span><span class='id identifier rubyid_time'>time</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="expires-instance_method">
|
||
|
|
|
||
|
|
#<strong>expires</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the value of cookie expires of type <code>Time</code>.</p>
|
||
|
|
|
||
|
|
<p>expires is the date and time at which a cookie expires.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
90
|
||
|
|
91
|
||
|
|
92</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 90</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_expires'>expires</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_expires'>expires</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="expires=-instance_method">
|
||
|
|
|
||
|
|
#<strong>expires=</strong>(expires) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie expires value.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>expires</code> must be <code>nil</code>, an instance of <code>Time</code>, or an object that can be converted successfully to an <code>Time</code> with <tt>Time.parse(expires)</tt>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
98
|
||
|
|
99
|
||
|
|
100
|
||
|
|
101
|
||
|
|
102
|
||
|
|
103
|
||
|
|
104
|
||
|
|
105</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 98</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_expires='>expires=</span><span class='lparen'>(</span><span class='id identifier rubyid_expires'>expires</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_expires'>expires</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_expires'>expires</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Time</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_expires'>expires</span> <span class='op'>=</span> <span class='id identifier rubyid_expires'>expires</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_expires'>expires</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_expires'>expires</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="httponly-instance_method">
|
||
|
|
|
||
|
|
#<strong>httponly</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie httponly value of type <code>Boolean</code>.</p>
|
||
|
|
|
||
|
|
<p>httponly is a <code>Boolean</code> that indicates if client-side scripts should be prevented from accessing data.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</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/msf/core/exploit/remote/http/http_cookie.rb', line 144</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_httponly'>httponly</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_httponly'>httponly</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="httponly=-instance_method">
|
||
|
|
|
||
|
|
#<strong>httponly=</strong>(httponly) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie httponly value.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>httponly</code> is converted to a Boolean with <tt>!!httponly</tt> and set.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</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/msf/core/exploit/remote/http/http_cookie.rb', line 151</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_httponly='>httponly=</span><span class='lparen'>(</span><span class='id identifier rubyid_httponly'>httponly</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_httponly'>httponly</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_httponly'>httponly</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="max_age-instance_method">
|
||
|
|
|
||
|
|
#<strong>max_age</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the value of max_age.</p>
|
||
|
|
|
||
|
|
<p>max_age is the number of seconds until a cookie expires.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</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/msf/core/exploit/remote/http/http_cookie.rb', line 71</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_max_age'>max_age</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_max_age'>max_age</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="max_age=-instance_method">
|
||
|
|
|
||
|
|
#<strong>max_age=</strong>(max_age) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie max_age of type <code>Integer</code>.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>max_age</code> must be <code>nil</code>, an <code>Integer</code>, or an object that can be converted successfully to an <code>Integer</code> with <tt>Integer(max_age)</tt>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
79
|
||
|
|
80
|
||
|
|
81
|
||
|
|
82
|
||
|
|
83
|
||
|
|
84
|
||
|
|
85</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 79</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_max_age='>max_age=</span><span class='lparen'>(</span><span class='id identifier rubyid_max_age'>max_age</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_max_age'>max_age</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_max_age'>max_age</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_max_age'>max_age</span> <span class='op'>=</span> <span class='id identifier rubyid_max_age'>max_age</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_max_age'>max_age</span> <span class='op'>=</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_max_age'>max_age</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="name-instance_method">
|
||
|
|
|
||
|
|
#<strong>name</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the name of cookie of type <code>String</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
42
|
||
|
|
43
|
||
|
|
44</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 42</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="name=-instance_method">
|
||
|
|
|
||
|
|
#<strong>name=</strong>(name) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie name.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
47
|
||
|
|
48
|
||
|
|
49</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 47</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_name='>name=</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</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='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="origin-instance_method">
|
||
|
|
|
||
|
|
#<strong>origin</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
184
|
||
|
|
185
|
||
|
|
186</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 184</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_origin'>origin</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="origin=-instance_method">
|
||
|
|
|
||
|
|
#<strong>origin=</strong>(origin) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
180
|
||
|
|
181
|
||
|
|
182</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 180</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_origin='>origin=</span><span class='lparen'>(</span><span class='id identifier rubyid_origin'>origin</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span> <span class='op'>=</span> <span class='id identifier rubyid_origin'>origin</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="path-instance_method">
|
||
|
|
|
||
|
|
#<strong>path</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie path of type <code>String</code>.</p>
|
||
|
|
|
||
|
|
<p>path is the URL for which the cookie is valid.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
110
|
||
|
|
111
|
||
|
|
112</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 110</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="path=-instance_method">
|
||
|
|
|
||
|
|
#<strong>path=</strong>(path) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie path.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>path</code> must be <code>nil</code>, an instance of <code>String</code>, or an object that can be converted successfully to a <code>String</code> with <code>to_s</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
118
|
||
|
|
119
|
||
|
|
120
|
||
|
|
121
|
||
|
|
122
|
||
|
|
123
|
||
|
|
124</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 118</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_path='>path=</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_path'>path</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='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="secure-instance_method">
|
||
|
|
|
||
|
|
#<strong>secure</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the cookie secure value of type <code>Boolean</code>.</p>
|
||
|
|
|
||
|
|
<p>secure is a boolean that indicates if the cookie should be limited to the scope of secure channels as defined by the user agent.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
130
|
||
|
|
131
|
||
|
|
132</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 130</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_secure'>secure</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_secure'>secure</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="secure=-instance_method">
|
||
|
|
|
||
|
|
#<strong>secure=</strong>(secure) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie secure value.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>secure</code> is converted to a Boolean with <tt>!!secure</tt> and set.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</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/msf/core/exploit/remote/http/http_cookie.rb', line 137</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_secure='>secure=</span><span class='lparen'>(</span><span class='id identifier rubyid_secure'>secure</span><span class='rparen'>)</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_secure'>secure</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_secure'>secure</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="session?-instance_method">
|
||
|
|
|
||
|
|
#<strong>session?</strong> ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns a boolean indicating if the cookie is a Session Cookie.</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">
|
||
|
|
|
||
|
|
|
||
|
|
237
|
||
|
|
238
|
||
|
|
239</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 237</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_session?'>session?</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_session?'>session?</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="valid_for_uri?-instance_method">
|
||
|
|
|
||
|
|
#<strong>valid_for_uri?</strong>(uri) ⇒ <tt>Boolean</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns a boolean indicating if the cookie can be sent to the passed <code>uri</code>. Raises an ArgumentError if domain is nil (unset).</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>
|
||
|
|
<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">
|
||
|
|
|
||
|
|
|
||
|
|
248
|
||
|
|
249
|
||
|
|
250
|
||
|
|
251
|
||
|
|
252
|
||
|
|
253</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 248</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_valid_for_uri?'>valid_for_uri?</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</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'>cannot tell if this cookie is valid as domain is nil</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_domain'>domain</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||
|
|
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_valid_for_uri?'>valid_for_uri?</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'><span class='object_link'><a href="../../../../top-level-namespace.html#uri-instance_method" title="#uri (method)">uri</a></span></span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="value-instance_method">
|
||
|
|
|
||
|
|
#<strong>value</strong> ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Returns the value of cookie of type <code>String</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
52
|
||
|
|
53
|
||
|
|
54</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 52</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="method_details ">
|
||
|
|
<h3 class="signature " id="value=-instance_method">
|
||
|
|
|
||
|
|
#<strong>value=</strong>(value) ⇒ <tt>Object</tt>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
</h3><div class="docstring">
|
||
|
|
<div class="discussion">
|
||
|
|
|
||
|
|
<p>Sets the cookie value.</p>
|
||
|
|
|
||
|
|
<p>Passed <code>value</code> must be <code>nil</code>, an instance of <code>String</code>, or an object that can be converted successfully to a <code>String</code> with <code>to_s</code>.</p>
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="tags">
|
||
|
|
|
||
|
|
|
||
|
|
</div><table class="source_code">
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<pre class="lines">
|
||
|
|
|
||
|
|
|
||
|
|
60
|
||
|
|
61
|
||
|
|
62
|
||
|
|
63
|
||
|
|
64
|
||
|
|
65
|
||
|
|
66</pre>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<pre class="code"><span class="info file"># File 'lib/msf/core/exploit/remote/http/http_cookie.rb', line 60</span>
|
||
|
|
|
||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_value='>value=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_value'>value</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='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
||
|
|
<span class='kw'>else</span>
|
||
|
|
<span class='ivar'>@cookie</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
||
|
|
<span class='kw'>end</span>
|
||
|
|
<span class='kw'>end</span></pre>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="footer">
|
||
|
|
Generated on Fri May 8 17:03:41 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>
|