This commit is contained in:
erwanlr
2015-06-24 11:46:06 +01:00
parent 5902a483b4
commit 4c800bacaa
4 changed files with 3 additions and 23 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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/') }

View File

@@ -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