Fix #413 - Check the version of the Timthumbs files found

This commit is contained in:
erwanlr
2014-02-24 18:15:43 +01:00
parent 90617c5433
commit b2d946794b
3 changed files with 12 additions and 1 deletions

View File

@@ -3,11 +3,13 @@
require 'wp_timthumb/versionable'
require 'wp_timthumb/existable'
require 'wp_timthumb/output'
require 'wp_timthumb/vulnerable'
class WpTimthumb < WpItem
include WpTimthumb::Versionable
include WpTimthumb::Existable
include WpTimthumb::Output
include WpTimthumb::Vulnerable
# @param [ WpTimthumb ] other
#

View File

@@ -4,7 +4,7 @@ class WpTimthumb < WpItem
module Output
def output(verbose = false)
puts ' | ' + red('[!]') + " #{self}"
puts " | #{vulnerable? ? red('[!] Vulnerable') : green('[i] Not Vulnerable')} #{self}"
end
end

View File

@@ -0,0 +1,9 @@
# encoding: UTF-8
class WpTimthumb < WpItem
module Vulnerable
def vulnerable?
VersionCompare.is_newer_or_same?(version, '1.34')
end
end
end