Fix #413 - Check the version of the Timthumbs files found
This commit is contained in:
@@ -3,11 +3,13 @@
|
|||||||
require 'wp_timthumb/versionable'
|
require 'wp_timthumb/versionable'
|
||||||
require 'wp_timthumb/existable'
|
require 'wp_timthumb/existable'
|
||||||
require 'wp_timthumb/output'
|
require 'wp_timthumb/output'
|
||||||
|
require 'wp_timthumb/vulnerable'
|
||||||
|
|
||||||
class WpTimthumb < WpItem
|
class WpTimthumb < WpItem
|
||||||
include WpTimthumb::Versionable
|
include WpTimthumb::Versionable
|
||||||
include WpTimthumb::Existable
|
include WpTimthumb::Existable
|
||||||
include WpTimthumb::Output
|
include WpTimthumb::Output
|
||||||
|
include WpTimthumb::Vulnerable
|
||||||
|
|
||||||
# @param [ WpTimthumb ] other
|
# @param [ WpTimthumb ] other
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class WpTimthumb < WpItem
|
|||||||
module Output
|
module Output
|
||||||
|
|
||||||
def output(verbose = false)
|
def output(verbose = false)
|
||||||
puts ' | ' + red('[!]') + " #{self}"
|
puts " | #{vulnerable? ? red('[!] Vulnerable') : green('[i] Not Vulnerable')} #{self}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
9
lib/common/models/wp_timthumb/vulnerable.rb
Normal file
9
lib/common/models/wp_timthumb/vulnerable.rb
Normal 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
|
||||||
Reference in New Issue
Block a user