From 65e260c4f2f8df40de4d73afcfffaeb36844018f Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Mon, 17 Sep 2012 19:45:57 +0200 Subject: [PATCH] WpItem is now a class --- doc/WpDetector.html | 2 +- doc/WpEnumerator.html | 9 +++-- doc/WpItem.html | 44 +++++++++++++--------- doc/WpPlugin.html | 20 ++-------- doc/WpTheme.html | 26 ++++--------- doc/created.rid | 14 +++---- doc/index.html | 50 ++++++++++++------------- doc/lib/wpscan/modules/wp_item_rb.html | 52 -------------------------- doc/lib/wpscan/wp_detector_rb.html | 2 +- doc/lib/wpscan/wp_enumerator_rb.html | 2 +- doc/lib/wpscan/wp_plugin_rb.html | 2 +- doc/lib/wpscan/wp_theme_rb.html | 2 +- doc/wpscan_rb.html | 2 +- lib/wpscan/{modules => }/wp_item.rb | 2 +- lib/wpscan/wp_plugin.rb | 3 +- lib/wpscan/wp_theme.rb | 3 +- 16 files changed, 83 insertions(+), 152 deletions(-) delete mode 100644 doc/lib/wpscan/modules/wp_item_rb.html rename lib/wpscan/{modules => }/wp_item.rb (98%) diff --git a/doc/WpDetector.html b/doc/WpDetector.html index 73e48aa8..854015dd 100644 --- a/doc/WpDetector.html +++ b/doc/WpDetector.html @@ -299,7 +299,7 @@ names.each do |item| items << { - :url => url, + :url => url, :name => item, :path => "#{type}/#{item}/", :wp_content_dir => wp_content_dir diff --git a/doc/WpEnumerator.html b/doc/WpEnumerator.html index c19d7a48..c2dce821 100644 --- a/doc/WpEnumerator.html +++ b/doc/WpEnumerator.html @@ -267,11 +267,12 @@ enumerate_size = targets.size targets.each do |target| - if options[:type] =~ /timthumbs/ - url = "#{target[:url]}#{target[:wp_content_dir]}/#{target[:path]}" - else - url = "#{target[:url]}#{target[:wp_content_dir]}/#{options[:type]}/#{target[:path]}" + # Timthumb files have no /timthumbs/ directory + unless options[:type] =~ /timthumbs/ + target[:path] = "#{options[:type]}/#{target[:path]}" end + url = "#{target[:url]}#{target[:wp_content_dir]}/#{target[:path]}" + request = enum_browser.forge_request(url, :cache_timeout => 0, :follow_location => true) request_count += 1 diff --git a/doc/WpItem.html b/doc/WpItem.html index b2259a13..cb191386 100644 --- a/doc/WpItem.html +++ b/doc/WpItem.html @@ -5,7 +5,7 @@ - Module: WpItem + Class: WpItem @@ -15,7 +15,7 @@ - +
@@ -34,8 +34,8 @@ @@ -46,6 +46,14 @@
+ +
+

Parent

+ + + +
+ @@ -197,7 +205,7 @@
-

WpItem

+

WpItem

@@ -298,7 +306,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 64
+# File lib/wpscan/wp_item.rb, line 64
 def <=>(item)
   item.name <=> @name
 end
@@ -331,7 +339,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 60
+# File lib/wpscan/wp_item.rb, line 60
 def ==(item)
   item.name == @name
 end
@@ -364,7 +372,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 80
+# File lib/wpscan/wp_item.rb, line 80
 def changelog_url
   get_url_without_filename.merge("changelog.txt")
 end
@@ -397,7 +405,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 46
+# File lib/wpscan/wp_item.rb, line 46
 def directory_listing?
   # Need to remove to file part from the url
   Browser.instance.get(location_uri_from_file_url(get_url.to_s)).body[%{<title>Index of}] ? true : false
@@ -431,7 +439,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 51
+# File lib/wpscan/wp_item.rb, line 51
 def extract_name_from_url(url)
   url.to_s[%{^(https?://.*/([^/]+)/)}, 2]
 end
@@ -464,7 +472,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 23
+# File lib/wpscan/wp_item.rb, line 23
 def get_url
   URI.parse("#{@url.to_s}#@wp_content_dir/#@path")
 end
@@ -497,7 +505,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 27
+# File lib/wpscan/wp_item.rb, line 27
 def get_url_without_filename
   matches = @path.match(%{^(.*/).*$})
   if matches == nil or matches.length < 2
@@ -536,7 +544,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 92
+# File lib/wpscan/wp_item.rb, line 92
 def has_changelog?
   unless @changelog
     status = Browser.instance.get(changelog_url).code
@@ -573,7 +581,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 84
+# File lib/wpscan/wp_item.rb, line 84
 def has_readme?
   unless @readme
     status = Browser.instance.get(readme_url).code
@@ -610,7 +618,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 68
+# File lib/wpscan/wp_item.rb, line 68
 def location_uri_from_file_url(location_url)
   valid_location_url = location_url[%{^(https?://.*/)[^.]+\.[^/]+$}, 1]
   unless valid_location_url
@@ -647,7 +655,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 76
+# File lib/wpscan/wp_item.rb, line 76
 def readme_url
   get_url_without_filename.merge("readme.txt")
 end
@@ -680,7 +688,7 @@
-# File lib/wpscan/modules/wp_item.rb, line 55
+# File lib/wpscan/wp_item.rb, line 55
 def to_s
   item_version = version
   "#@name#{' v' + item_version.strip if item_version}"
@@ -714,7 +722,7 @@
             
             
-# File lib/wpscan/modules/wp_item.rb, line 37
+# File lib/wpscan/wp_item.rb, line 37
 def version
   unless @version
     response = Browser.instance.get(get_url.merge("readme.txt").to_s)
diff --git a/doc/WpPlugin.html b/doc/WpPlugin.html
index 887b02c4..2299ceb8 100644
--- a/doc/WpPlugin.html
+++ b/doc/WpPlugin.html
@@ -50,7 +50,7 @@
       

Parent

- +
@@ -76,18 +76,6 @@ - -
-

Included Modules

- -
-
@@ -262,7 +250,7 @@
-# File lib/wpscan/wp_plugin.rb, line 26
+# File lib/wpscan/wp_plugin.rb, line 25
 def initialize(options = {})
   @url            = options[:url]
   @path           = options[:path]
@@ -316,7 +304,7 @@ href="http://www.exploit-db.com/ghdb/3714/">www.exploit-db.com/ghdb/3714/

-# File lib/wpscan/wp_plugin.rb, line 47
+# File lib/wpscan/wp_plugin.rb, line 46
 def error_log?
   response_body = Browser.instance.get(error_log_url(), :headers => { "range" => "bytes=0-700"}).body
   response_body[%{PHP Fatal error}] ? true : false
@@ -350,7 +338,7 @@ href="http://www.exploit-db.com/ghdb/3714/">www.exploit-db.com/ghdb/3714/

-# File lib/wpscan/wp_plugin.rb, line 52
+# File lib/wpscan/wp_plugin.rb, line 51
 def error_log_url
   get_url.merge("error_log").to_s
 end
diff --git a/doc/WpTheme.html b/doc/WpTheme.html index af6b5375..df60947d 100644 --- a/doc/WpTheme.html +++ b/doc/WpTheme.html @@ -50,7 +50,7 @@

Parent

- +
@@ -82,18 +82,6 @@ - -
-

Included Modules

- -
-
@@ -298,7 +286,7 @@
-# File lib/wpscan/wp_theme.rb, line 54
+# File lib/wpscan/wp_theme.rb, line 53
 def self.find(target_uri)
   self.methods.grep(/find_from_/).each do |method_to_call|
     theme = self.send(method_to_call, target_uri)
@@ -336,7 +324,7 @@
             
             
-# File lib/wpscan/wp_theme.rb, line 26
+# File lib/wpscan/wp_theme.rb, line 25
 def initialize(options = {})
   @url            = options[:url]
   @name           = options[:name] || extract_name_from_url(get_url)
@@ -389,7 +377,7 @@