Files
wpscan/doc_yard/WebSite.html
Christian Mehlmauer 8896f8bf79 docs
2013-08-11 08:58:28 +02:00

1264 lines
33 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: WebSite
&mdash; Documentation by YARD 0.8.5.2
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '';
framesUrl = "frames.html#!" + escape(window.location.href);
</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 id="header">
<div id="menu">
<a href="_index.html">Index (W)</a> &raquo;
<span class="title">WebSite</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: WebSite
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">WebSite</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2"><span class='object_link'><a href="WebSite/InterestingHeaders.html" title="WebSite::InterestingHeaders (module)">InterestingHeaders</a></span>, <span class='object_link'><a href="WebSite/RobotsTxt.html" title="WebSite::RobotsTxt (module)">RobotsTxt</a></span></dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">lib/wpscan/web_site.rb<span class="defines">,<br />
lib/wpscan/web_site/robots_txt.rb,<br /> lib/wpscan/web_site/interesting_headers.rb</span>
</dd>
</dl>
<div class="clear"></div>
<div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="WpTarget.html" title="WpTarget (class)">WpTarget</a></span></p>
</div>
<h2>Defined Under Namespace</h2>
<p class="children">
<strong class="modules">Modules:</strong> <span class='object_link'><a href="WebSite/InterestingHeaders.html" title="WebSite::InterestingHeaders (module)">InterestingHeaders</a></span>, <span class='object_link'><a href="WebSite/RobotsTxt.html" title="WebSite::RobotsTxt (module)">RobotsTxt</a></span>
</p>
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#uri-instance_method" title="#uri (instance method)">- (Object) <strong>uri</strong> </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute uri.</p>
</div></span>
</li>
</ul>
<h2>
Class Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#has_log%3F-class_method" title="has_log? (class method)">+ (Boolean) <strong>has_log?</strong>(log_url, pattern) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Only the first 700 bytes are checked to avoid the download of the whole
file which can be very huge (like 2 Go).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#page_hash-class_method" title="page_hash (class method)">+ (String) <strong>page_hash</strong>(page) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Compute the MD5 of the page Comments are deleted from the page to avoid
cache generation details.</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#error_404_hash-instance_method" title="#error_404_hash (instance method)">- (Object) <strong>error_404_hash</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Return the MD5 hash of a 404 page.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#has_basic_auth%3F-instance_method" title="#has_basic_auth? (instance method)">- (Boolean) <strong>has_basic_auth?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#has_xml_rpc%3F-instance_method" title="#has_xml_rpc? (instance method)">- (Boolean) <strong>has_xml_rpc?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#homepage_hash-instance_method" title="#homepage_hash (instance method)">- (Object) <strong>homepage_hash</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">- (WebSite) <strong>initialize</strong>(site_url) </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of WebSite.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#online%3F-instance_method" title="#online? (instance method)">- (Boolean) <strong>online?</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Checks if the remote website is up.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#redirection-instance_method" title="#redirection (instance method)">- (Object) <strong>redirection</strong>(url = nil) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>See if the remote url returns 30x redirect This method is recursive Return
a string with the redirection or nil.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#rss_url-instance_method" title="#rss_url (instance method)">- (Object) <strong>rss_url</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Will try to find the rss url in the homepage Only the first one found is
returned.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#url-instance_method" title="#url (instance method)">- (Object) <strong>url</strong> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#url%3D-instance_method" title="#url= (instance method)">- (Object) <strong>url=</strong>(url) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#xml_rpc_url-instance_method" title="#xml_rpc_url (instance method)">- (Object) <strong>xml_rpc_url</strong> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>See <a
href="http://www.hixie.ch/specs/pingback/pingback-1.0#TOC2.3">www.hixie.ch/specs/pingback/pingback-1.0#TOC2.3</a>.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="WebSite/InterestingHeaders.html" title="WebSite::InterestingHeaders (module)">InterestingHeaders</a></span></h3>
<p class="inherited"><span class='object_link'><a href="WebSite/InterestingHeaders.html#interesting_headers-instance_method" title="WebSite::InterestingHeaders#interesting_headers (method)">#interesting_headers</a></span>, <span class='object_link'><a href="WebSite/InterestingHeaders.html#known_headers-class_method" title="WebSite::InterestingHeaders.known_headers (method)">known_headers</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="WebSite/RobotsTxt.html" title="WebSite::RobotsTxt (module)">RobotsTxt</a></span></h3>
<p class="inherited"><span class='object_link'><a href="WebSite/RobotsTxt.html#has_robots%3F-instance_method" title="WebSite::RobotsTxt#has_robots? (method)">#has_robots?</a></span>, <span class='object_link'><a href="WebSite/RobotsTxt.html#known_dirs-class_method" title="WebSite::RobotsTxt.known_dirs (method)">known_dirs</a></span>, <span class='object_link'><a href="WebSite/RobotsTxt.html#parse_robots_txt-instance_method" title="WebSite::RobotsTxt#parse_robots_txt (method)">#parse_robots_txt</a></span>, <span class='object_link'><a href="WebSite/RobotsTxt.html#robots_url-instance_method" title="WebSite::RobotsTxt#robots_url (method)">#robots_url</a></span></p>
<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">
- (<tt><span class='object_link'><a href="" title="WebSite (class)">WebSite</a></span></tt>) <strong>initialize</strong>(site_url)
</h3><div class="docstring">
<div class="discussion">
<p>A new instance of WebSite</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_site_url'>site_url</span><span class='rparen'>)</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='id identifier rubyid_site_url'>site_url</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="uri-instance_method">
- (<tt>Object</tt>) <strong>uri</strong> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute uri</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
10
11
12</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_uri'>uri</span>
<span class='ivar'>@uri</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="has_log?-class_method">
+ (<tt>Boolean</tt>) <strong>has_log?</strong>(log_url, pattern)
</h3><div class="docstring">
<div class="discussion">
<p>Only the first 700 bytes are checked to avoid the download of the whole
file which can be very huge (like 2 Go)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>log_url</span>
<span class='type'>(<tt>String</tt>)</span>
</li>
<li>
<span class='name'>pattern</span>
<span class='type'>(<tt>RegEx</tt>)</span>
</li>
</ul>
<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">
109
110
111
112</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 109</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_log?'>has_log?</span><span class='lparen'>(</span><span class='id identifier rubyid_log_url'>log_url</span><span class='comma'>,</span> <span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
<span class='id identifier rubyid_log_body'>log_body</span> <span class='op'>=</span> <span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_log_url'>log_url</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>range</span><span class='tstring_end'>'</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>bytes=0-700</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_log_body'>log_body</span><span class='lbracket'>[</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="page_hash-class_method">
+ (<tt>String</tt>) <strong>page_hash</strong>(page)
</h3><div class="docstring">
<div class="discussion">
<p>Compute the MD5 of the page Comments are deleted from the page to avoid
cache generation details</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>page</span>
<span class='type'>(<tt>String</tt>, <tt><span class='object_link'><a href="Typhoeus/Response.html" title="Typhoeus::Response (class)">Typhoeus::Response</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The url of the response of the page</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>The MD5 hash of the page</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
73
74
75
76
77</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 73</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_page_hash'>page_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span><span class='rparen'>)</span>
<span class='id identifier rubyid_page'>page</span> <span class='op'>=</span> <span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Typhoeus</span><span class='op'>::</span><span class='const'>Response</span><span class='rparen'>)</span>
<span class='const'>Digest</span><span class='op'>::</span><span class='const'>MD5</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>&lt;!--.*?--&gt;</span><span class='regexp_end'>/m</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</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="error_404_hash-instance_method">
- (<tt>Object</tt>) <strong>error_404_hash</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Return the MD5 hash of a 404 page</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
87
88
89
90
91
92
93</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 87</span>
<span class='kw'>def</span> <span class='id identifier rubyid_error_404_hash'>error_404_hash</span>
<span class='kw'>unless</span> <span class='ivar'>@error_404_hash</span>
<span class='id identifier rubyid_non_existant_page'>non_existant_page</span> <span class='op'>=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>MD5</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='id identifier rubyid_rand'>rand</span><span class='lparen'>(</span><span class='int'>999_999_999</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.html</span><span class='tstring_end'>'</span></span>
<span class='ivar'>@error_404_hash</span> <span class='op'>=</span> <span class='const'>WebSite</span><span class='period'>.</span><span class='id identifier rubyid_page_hash'>page_hash</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_non_existant_page'>non_existant_page</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='ivar'>@error_404_hash</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="has_basic_auth?-instance_method">
- (<tt>Boolean</tt>) <strong>has_basic_auth?</strong>
</h3><div class="docstring">
<div class="discussion">
</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">
29
30
31</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 29</span>
<span class='kw'>def</span> <span class='id identifier rubyid_has_basic_auth?'>has_basic_auth?</span>
<span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>401</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="has_xml_rpc?-instance_method">
- (<tt>Boolean</tt>) <strong>has_xml_rpc?</strong>
</h3><div class="docstring">
<div class="discussion">
</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">
33
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 33</span>
<span class='kw'>def</span> <span class='id identifier rubyid_has_xml_rpc?'>has_xml_rpc?</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get_and_follow_location'>get_and_follow_location</span><span class='lparen'>(</span><span class='id identifier rubyid_xml_rpc_url'>xml_rpc_url</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>XML-RPC server accepts POST requests only</span><span class='regexp_end'>}i</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="homepage_hash-instance_method">
- (<tt>Object</tt>) <strong>homepage_hash</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
79
80
81
82
83
84</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 79</span>
<span class='kw'>def</span> <span class='id identifier rubyid_homepage_hash'>homepage_hash</span>
<span class='kw'>unless</span> <span class='ivar'>@homepage_hash</span>
<span class='ivar'>@homepage_hash</span> <span class='op'>=</span> <span class='const'>WebSite</span><span class='period'>.</span><span class='id identifier rubyid_page_hash'>page_hash</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='ivar'>@homepage_hash</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="online?-instance_method">
- (<tt>Boolean</tt>) <strong>online?</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if the remote website is up.</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">
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 25</span>
<span class='kw'>def</span> <span class='id identifier rubyid_online?'>online?</span>
<span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>!=</span> <span class='int'>0</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="redirection-instance_method">
- (<tt>Object</tt>) <strong>redirection</strong>(url = nil)
</h3><div class="docstring">
<div class="discussion">
<p>See if the remote url returns 30x redirect This method is recursive Return
a string with the redirection or nil</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_redirection'>redirection</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_redirection'>redirection</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='id identifier rubyid_url'>url</span> <span class='op'>||=</span> <span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>301</span> <span class='op'>||</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>302</span>
<span class='id identifier rubyid_redirection'>redirection</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers_hash'>headers_hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>location</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
<span class='comment'># Let's check if there is a redirection in the redirection
</span> <span class='kw'>if</span> <span class='id identifier rubyid_other_redirection'>other_redirection</span> <span class='op'>=</span> <span class='id identifier rubyid_redirection'>redirection</span><span class='lparen'>(</span><span class='id identifier rubyid_redirection'>redirection</span><span class='rparen'>)</span>
<span class='id identifier rubyid_redirection'>redirection</span> <span class='op'>=</span> <span class='id identifier rubyid_other_redirection'>other_redirection</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_redirection'>redirection</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="rss_url-instance_method">
- (<tt>Object</tt>) <strong>rss_url</strong>
</h3><div class="docstring">
<div class="discussion">
<p>Will try to find the rss url in the homepage Only the first one found is
returned</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
97
98
99
100</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 97</span>
<span class='kw'>def</span> <span class='id identifier rubyid_rss_url'>rss_url</span>
<span class='id identifier rubyid_homepage_body'>homepage_body</span> <span class='op'>=</span> <span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_homepage_body'>homepage_body</span><span class='lbracket'>[</span><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>&lt;link .* type=&quot;application/rss\+xml&quot; .* href=&quot;([^&quot;]+)&quot; /&gt;</span><span class='regexp_end'>}</span></span><span class='comma'>,</span> <span class='int'>1</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="url-instance_method">
- (<tt>Object</tt>) <strong>url</strong>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 20</span>
<span class='kw'>def</span> <span class='id identifier rubyid_url'>url</span>
<span class='ivar'>@uri</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="url=-instance_method">
- (<tt>Object</tt>) <strong>url=</strong>(url)
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_url='>url=</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
<span class='ivar'>@uri</span> <span class='op'>=</span> <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_add_trailing_slash'>add_trailing_slash</span><span class='lparen'>(</span><span class='id identifier rubyid_add_http_protocol'>add_http_protocol</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="xml_rpc_url-instance_method">
- (<tt>Object</tt>) <strong>xml_rpc_url</strong>
</h3><div class="docstring">
<div class="discussion">
<p>See <a
href="http://www.hixie.ch/specs/pingback/pingback-1.0#TOC2.3">www.hixie.ch/specs/pingback/pingback-1.0#TOC2.3</a></p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
39
40
41
42
43
44
45</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/wpscan/web_site.rb', line 39</span>
<span class='kw'>def</span> <span class='id identifier rubyid_xml_rpc_url'>xml_rpc_url</span>
<span class='kw'>unless</span> <span class='ivar'>@xmlrpc_url</span>
<span class='ivar'>@xmlrpc_url</span> <span class='op'>=</span> <span class='ivar'>@uri</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>xmlrpc.php</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='ivar'>@xmlrpc_url</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sun Aug 11 08:57:57 2013 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.5.2 (ruby-1.9.3).
</div>
</body>
</html>