Module: Msf::DBManager::Import::Qualys

Includes:
Asset, Scan
Included in:
Msf::DBManager::Import
Defined in:
lib/msf/core/db_manager/import/qualys.rb

Defined Under Namespace

Modules: Asset, Scan

Constant Summary collapse

TCP_QID =
82023
UDP_QID =
82004

Instance Method Summary collapse

Methods included from Scan

#import_qualys_scan_xml, #import_qualys_scan_xml_file

Methods included from Asset

#find_qualys_asset_ports, #find_qualys_asset_vuln_refs, #find_qualys_asset_vulns, #import_qualys_asset_xml

Instance Method Details

#handle_qualys(wspace, hobj, port, protocol, qid, severity, refs, name = nil, title = nil, task = nil) ⇒ Object

Qualys report parsing/handling



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/msf/core/db_manager/import/qualys.rb', line 14

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]
    msf_import_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
    msf_import_vuln(
      :workspace => wspace,
      :task => task,
      :host => hobj,
      :port => port,
      :proto => protocol,
      :name =>  title,
      :refs => fixed_refs
    )
  end
end