forgot to git add db.rb. oops

unstable
root 2012-05-13 14:30:27 -07:00
parent d5cec05cc3
commit 2906686da1
1 changed files with 28 additions and 0 deletions

View File

@ -8,6 +8,7 @@ require 'rex/parser/acunetix_nokogiri'
require 'rex/parser/appscan_nokogiri'
require 'rex/parser/burp_session_nokogiri'
require 'rex/parser/ci_nokogiri'
require 'rex/parser/wapiti_nokogiri'
# Legacy XML parsers -- these will be converted some day
@ -2440,6 +2441,7 @@ class DBManager
line_count = 0
data.each_line { |line|
line =~ /<([a-zA-Z0-9\-\_]+)[ >]/
case $1
when "niktoscan"
@import_filedata[:type] = "Nikto XML"
@ -2459,6 +2461,9 @@ class DBManager
when "SCAN"
@import_filedata[:type] = "Qualys Scan XML"
return :qualys_scan_xml
when "report"
@import_filedata[:type] = "Wapiti XML"
return :wapiti_xml
when "ASSET_DATA_REPORT"
@import_filedata[:type] = "Qualys Asset XML"
return :qualys_asset_xml
@ -2591,6 +2596,29 @@ class DBManager
end
end
def import_wapiti_xml_file(args={})
filename = args[:filename]
wspace = args[:wspace] || workspace
data = ""
::File.open(filename, 'rb') do |f|
data = f.read(f.stat.size)
end
import_wapiti_xml(args.merge(:data => data))
end
def import_wapiti_xml(args={}, &block)
if block
doc = Rex::Parser::WapitiDocument.new(args,framework.db) {|type, data| yield type,data }
else
doc = Rex::Parser::WapitiDocument.new(args,self)
end
parser = ::Nokogiri::XML::SAX::Parser.new(doc)
parser.parse(args[:data])
end
def import_libpcap_file(args={})
filename = args[:filename]
wspace = args[:wspace] || workspace