479 lines
15 KiB
HTML
479 lines
15 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>
|
|
Module: WpTheme::Findable
|
|
|
|
— Documentation by YARD 0.8.6.1
|
|
|
|
</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
|
|
<link rel="stylesheet" href="../css/common.css" type="text/css" 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 (F)</a> »
|
|
<span class='title'><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></span>
|
|
»
|
|
<span class="title">Findable</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>Module: WpTheme::Findable
|
|
|
|
|
|
|
|
</h1>
|
|
|
|
<dl class="box">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt class="r1">Included in:</dt>
|
|
<dd class="r1"><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></dd>
|
|
|
|
|
|
|
|
<dt class="r2 last">Defined in:</dt>
|
|
<dd class="r2 last">lib/common/models/wp_theme/findable.rb</dd>
|
|
|
|
</dl>
|
|
<div class="clear"></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="#find-instance_method" title="#find (instance method)">- (WpTheme) <strong>find</strong>(target_uri) </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Find the main theme of the blog.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#find_from_css_link-instance_method" title="#find_from_css_link (instance method)">- (WpTheme) <strong>find_from_css_link</strong>(target_uri) </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p>Discover the wordpress theme by parsing the css link rel.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
<li class="protected ">
|
|
<span class="summary_signature">
|
|
|
|
<a href="#find_from_wooframework-instance_method" title="#find_from_wooframework (instance method)">- (WpTheme) <strong>find_from_wooframework</strong>(target_uri) </a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span class="note title protected">protected</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
<p><a
|
|
href="http://code.google.com/p/wpscan/issues/detail?id=141">code.google.com/p/wpscan/issues/detail?id=141</a>.</p>
|
|
</div></span>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div id="instance_method_details" class="method_details_list">
|
|
<h2>Instance Method Details</h2>
|
|
|
|
|
|
<div class="method_details first">
|
|
<h3 class="signature first" id="find-instance_method">
|
|
|
|
- (<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>) <strong>find</strong>(target_uri)
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Find the main theme of the blog</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>target_uri</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../URI.html" title="URI (module)">URI</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/common/models/wp_theme/findable.rb', line 11</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_target_uri'>target_uri</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_methods'>methods</span><span class='period'>.</span><span class='id identifier rubyid_grep'>grep</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^find_from_</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_method'>method</span><span class='op'>|</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_wp_theme'>wp_theme</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_target_uri'>target_uri</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_wp_theme'>wp_theme</span><span class='period'>.</span><span class='id identifier rubyid_found_from'>found_from</span> <span class='op'>=</span> <span class='id identifier rubyid_method'>method</span>
|
|
|
|
<span class='kw'>return</span> <span class='id identifier rubyid_wp_theme'>wp_theme</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>nil</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="method_details ">
|
|
<h3 class="signature " id="find_from_css_link-instance_method">
|
|
|
|
- (<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>) <strong>find_from_css_link</strong>(target_uri) <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p>Discover the wordpress theme by parsing the css link rel</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>target_uri</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../URI.html" title="URI (module)">URI</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
29
|
|
30
|
|
31
|
|
32
|
|
33
|
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
|
39
|
|
40
|
|
41
|
|
42
|
|
43
|
|
44</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/common/models/wp_theme/findable.rb', line 29</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_find_from_css_link'>find_from_css_link</span><span class='lparen'>(</span><span class='id identifier rubyid_target_uri'>target_uri</span><span class='rparen'>)</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_target_uri'>target_uri</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
|
|
|
|
<span class='comment'># https + domain is optional because of relative links
|
|
</span> <span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>(?:https?://[^"']+)?/([^/]+)/themes/([^"']+)/style.css</span><span class='regexp_end'>}i</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_matches'>matches</span>
|
|
<span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
|
<span class='id identifier rubyid_target_uri'>target_uri</span><span class='comma'>,</span>
|
|
<span class='lbrace'>{</span>
|
|
<span class='label'>name:</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
<span class='label'>style_url:</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
<span class='label'>wp_content_dir:</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
|
<span class='rbrace'>}</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="find_from_wooframework-instance_method">
|
|
|
|
- (<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>) <strong>find_from_wooframework</strong>(target_uri) <span class="extras">(protected)</span>
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
<div class="discussion">
|
|
|
|
<p><a
|
|
href="http://code.google.com/p/wpscan/issues/detail?id=141">code.google.com/p/wpscan/issues/detail?id=141</a></p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<p class="tag_title">Parameters:</p>
|
|
<ul class="param">
|
|
|
|
<li>
|
|
|
|
<span class='name'>target_uri</span>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../URI.html" title="URI (module)">URI</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="tag_title">Returns:</p>
|
|
<ul class="return">
|
|
|
|
<li>
|
|
|
|
|
|
<span class='type'>(<tt><span class='object_link'><a href="../WpTheme.html" title="WpTheme (class)">WpTheme</a></span></tt>)</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div><table class="source_code">
|
|
<tr>
|
|
<td>
|
|
<pre class="lines">
|
|
|
|
|
|
51
|
|
52
|
|
53
|
|
54
|
|
55
|
|
56
|
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
|
62
|
|
63
|
|
64
|
|
65
|
|
66
|
|
67
|
|
68
|
|
69</pre>
|
|
</td>
|
|
<td>
|
|
<pre class="code"><span class="info file"># File 'lib/common/models/wp_theme/findable.rb', line 51</span>
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_find_from_wooframework'>find_from_wooframework</span><span class='lparen'>(</span><span class='id identifier rubyid_target_uri'>target_uri</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_body'>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_target_uri'>target_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_regexp'>regexp</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'><meta name="generator" content="([^\s"]+)\s?([^"]+)?" />\s+<meta name="generator" content="WooFramework\s?([^"]+)?" /></span><span class='regexp_end'>}</span></span>
|
|
|
|
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_matches'>matches</span> <span class='op'>=</span> <span class='id identifier rubyid_regexp'>regexp</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
|
|
<span class='id identifier rubyid_woo_theme_name'>woo_theme_name</span> <span class='op'>=</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
|
|
<span class='id identifier rubyid_woo_theme_version'>woo_theme_version</span> <span class='op'>=</span> <span class='id identifier rubyid_matches'>matches</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
|
|
<span class='comment'>#woo_framework_version = matches[3] # Not used at this time
|
|
</span>
|
|
<span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
|
<span class='id identifier rubyid_target_uri'>target_uri</span><span class='comma'>,</span>
|
|
<span class='lbrace'>{</span>
|
|
<span class='label'>name:</span> <span class='id identifier rubyid_woo_theme_name'>woo_theme_name</span><span class='comma'>,</span>
|
|
<span class='label'>version:</span> <span class='id identifier rubyid_woo_theme_version'>woo_theme_version</span>
|
|
<span class='rbrace'>}</span>
|
|
<span class='rparen'>)</span>
|
|
<span class='kw'>end</span>
|
|
<span class='kw'>end</span></pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
Generated on Sun Jun 9 16:05:16 2013 by
|
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
0.8.6.1 (ruby-1.9.3).
|
|
</div>
|
|
|
|
</body>
|
|
</html> |