Extract #handle_qualys to Msf::DBManager::Import::Qualys

MSP-11124
bug/bundler_fix
Luke Imhoff 2014-10-14 15:32:22 -05:00
parent 55ca928fee
commit 0c10b5a859
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
2 changed files with 43 additions and 43 deletions

View File

@ -3227,49 +3227,6 @@ module Msf::DBManager::Import
report_vuln(vuln)
end
#
# Qualys report parsing/handling
#
def handle_qualys(wspace, hobj, port, protocol, qid, severity, refs, name=nil, title=nil, task=nil)
addr = hobj.address
port = port.to_i if port
info = { :workspace => wspace, :host => hobj, :port => port, :proto => protocol, :task => task }
if name and name != 'unknown' and name != 'No registered hostname'
info[:name] = name
end
if info[:host] && info[:port] && info[:proto]
report_service(info)
end
fixed_refs = []
if refs
refs.each do |ref|
case ref
when /^MS[0-9]{2}-[0-9]{3}/
fixed_refs << "MSB-#{ref}"
else
fixed_refs << ref
end
end
end
return if qid == 0
title = 'QUALYS-' + qid if title.nil? or title.empty?
if addr
report_vuln(
:workspace => wspace,
:task => task,
:host => hobj,
:port => port,
:proto => protocol,
:name => title,
:refs => fixed_refs
)
end
end
def process_nexpose_data_sxml_refs(vuln)
refs = []
vid = vuln.attributes['id'].to_s.downcase

View File

@ -4,4 +4,47 @@ module Msf::DBManager::Import::Qualys
include Msf::DBManager::Import::Qualys::Asset
include Msf::DBManager::Import::Qualys::Scan
#
# Qualys report parsing/handling
#
def handle_qualys(wspace, hobj, port, protocol, qid, severity, refs, name=nil, title=nil, task=nil)
addr = hobj.address
port = port.to_i if port
info = { :workspace => wspace, :host => hobj, :port => port, :proto => protocol, :task => task }
if name and name != 'unknown' and name != 'No registered hostname'
info[:name] = name
end
if info[:host] && info[:port] && info[:proto]
report_service(info)
end
fixed_refs = []
if refs
refs.each do |ref|
case ref
when /^MS[0-9]{2}-[0-9]{3}/
fixed_refs << "MSB-#{ref}"
else
fixed_refs << ref
end
end
end
return if qid == 0
title = 'QUALYS-' + qid if title.nil? or title.empty?
if addr
report_vuln(
:workspace => wspace,
:task => task,
:host => hobj,
:port => port,
:proto => protocol,
:name => title,
:refs => fixed_refs
)
end
end
end