From 4c5f02865fc1a7cb5d925aae91afa6ddfb587a16 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Tue, 19 Mar 2013 23:53:43 +0100 Subject: [PATCH] Output the timthumb version if found --- data/timthumbs.txt | 8 ++++---- lib/common/models/wp_timthumb/output.rb | 2 +- lib/common/models/wp_timthumb/versionable.rb | 5 +++++ main.rb | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/data/timthumbs.txt b/data/timthumbs.txt index 129510e8..23571a00 100644 --- a/data/timthumbs.txt +++ b/data/timthumbs.txt @@ -1,7 +1,7 @@ -timthumb.php -arras/library/timthumb.php -uBillboard/timthumb.php -uploads/thumb-temp/timthumb.php +$wp-content$/timthumb.php +$wp-content$/arras/library/timthumb.php +$wp-content$/uBillboard/timthumb.php +$wp-content$/uploads/thumb-temp/timthumb.php $wp-content$/themes/eGamer/timthumb.php $wp-plugins$/add-new-default-avatar-emrikols-fork/includes/thumb.php $wp-plugins$/add-new-default-avatar-emrikols-fork/includes/timthumb.php diff --git a/lib/common/models/wp_timthumb/output.rb b/lib/common/models/wp_timthumb/output.rb index 3b2317c2..3d4f07a1 100644 --- a/lib/common/models/wp_timthumb/output.rb +++ b/lib/common/models/wp_timthumb/output.rb @@ -4,7 +4,7 @@ class WpTimthumb < WpItem module Output def output - puts ' | ' + red('[!]') + " #{url}" + puts ' | ' + red('[!]') + " #{self}" end end diff --git a/lib/common/models/wp_timthumb/versionable.rb b/lib/common/models/wp_timthumb/versionable.rb index de26c7fc..b53f2227 100755 --- a/lib/common/models/wp_timthumb/versionable.rb +++ b/lib/common/models/wp_timthumb/versionable.rb @@ -9,5 +9,10 @@ class WpTimthumb < WpItem response = Browser.instance.get(url) response.body[%r{TimThumb version\s*: ([^<]+)} , 1] end + + def to_s + "#{url}#{ ' v' + version if version}" + end + end end diff --git a/main.rb b/main.rb index bfc91619..552c6d24 100644 --- a/main.rb +++ b/main.rb @@ -256,7 +256,7 @@ def main ) if !wp_timthumbs.empty? puts - puts green('[+]') + " We found #{timthumbs.size} timthumb file/s :" + puts green('[+]') + " We found #{wp_timthumbs.size} timthumb file/s :" puts wp_timthumbs.output