Fix wpstools check-vuln-ref-urls

This commit is contained in:
ethicalhack3r
2014-07-31 15:26:13 +02:00
parent 420ad6cd37
commit 3959892c20
3 changed files with 18 additions and 11 deletions

View File

@@ -64,14 +64,6 @@ end
require_files_from_directory(COMMON_LIB_DIR, '**/*.rb')
# Hook to check if the target if down during the scan
# The target is considered down after 10 requests with status = 0
down = 0
Typhoeus.on_complete do |response|
down += 1 if response.code == 0
fail 'The target seems to be down' if down >= 10
end
# Add protocol
def add_http_protocol(url)
url =~ /^https?:/ ? url : "http://#{url}"

View File

@@ -108,3 +108,11 @@ def help
puts '--verbose | -v Verbose output.'
puts
end
# Hook to check if the target if down during the scan
# The target is considered down after 10 requests with status = 0
down = 0
Typhoeus.on_complete do |response|
down += 1 if response.code == 0
fail 'The target seems to be down' if down >= 10
end

View File

@@ -29,11 +29,18 @@ class CheckerPlugin < Plugin
puts '[+] Checking vulnerabilities reference urls'
vuln_ref_files.each do |vuln_ref_file|
xml = xml(vuln_ref_file)
json = json(vuln_ref_file)
urls = []
xml.xpath('//references/url').each { |node| urls << node.text }
json.each do |asset|
asset[asset.keys.inject]['vulnerabilities'].each do |url|
unless url['url'].nil?
url['url'].split(',').each do |url|
urls << url
end
end
end
end
urls.uniq!
puts "[!] No URLs found in #{vuln_ref_file}!" if urls.empty?