From 4c800bacaa2e77bc4a14fe80032cd752c8f5032c Mon Sep 17 00:00:00 2001 From: erwanlr Date: Wed, 24 Jun 2015 11:46:06 +0100 Subject: [PATCH] Fixes #835 --- lib/common/models/wp_version.rb | 2 +- lib/common/models/wp_version/vulnerable.rb | 8 +------- spec/lib/common/models/wp_version_spec.rb | 14 -------------- wpscan.rb | 2 +- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lib/common/models/wp_version.rb b/lib/common/models/wp_version.rb index eb8f918d..cdf38043 100755 --- a/lib/common/models/wp_version.rb +++ b/lib/common/models/wp_version.rb @@ -12,6 +12,7 @@ class WpVersion < WpItem # The version number attr_accessor :number + alias_method :version, :number # Needed to have the right behaviour in Vulnerable#vulnerable_to? # @return [ Array ] def allowed_options; super << :number << :found_from end @@ -29,5 +30,4 @@ class WpVersion < WpItem a << node.text.to_s end end - end diff --git a/lib/common/models/wp_version/vulnerable.rb b/lib/common/models/wp_version/vulnerable.rb index 6de10428..ad846a26 100644 --- a/lib/common/models/wp_version/vulnerable.rb +++ b/lib/common/models/wp_version/vulnerable.rb @@ -14,12 +14,6 @@ class WpVersion < WpItem # @return [ String ] def identifier @number - end - - # @return [ String ] - # def vulns_xpath - # "//wordpress[@version='#{@number}']/vulnerability" - # end - + end end end diff --git a/spec/lib/common/models/wp_version_spec.rb b/spec/lib/common/models/wp_version_spec.rb index d9ad5795..33a3e2c5 100644 --- a/spec/lib/common/models/wp_version_spec.rb +++ b/spec/lib/common/models/wp_version_spec.rb @@ -4,20 +4,6 @@ require 'spec_helper' describe WpVersion do it_behaves_like 'WpVersion::Vulnerable' - it_behaves_like 'WpItem::Vulnerable' do - let(:options) { { number: '3.2' } } - let(:vulns_file) { MODELS_FIXTURES + '/wp_version/vulnerable/versions_vulns.json' } - let(:expected_refs) { { - 'id' => [2993], - 'url' => ['Ref 1,Ref 2'], - 'cve' => ['2011-001'], - 'secunia' => ['secunia'], - 'osvdb' => ['osvdb'], - 'metasploit' => ['exploit/ex1'], - 'exploitdb' => ['exploitdb'] - } } - let(:expected_vulns) { Vulnerabilities.new << Vulnerability.new('Here I Am', 'SQLI', expected_refs) } - end subject(:wp_version) { WpVersion.new(uri, options) } let(:uri) { URI.parse('http://example.com/') } diff --git a/wpscan.rb b/wpscan.rb index 4e6535ec..b58cff4a 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -62,7 +62,7 @@ def main exit(1) else if missing_db_file? - puts critical('You can not run a scan without any databases.') + puts critical('You can not run a scan without any databases.') exit(1) end end