Module: Msf::DBManager::Import::Wapiti
- Included in:
- Msf::DBManager::Import
- Defined in:
- lib/msf/core/db_manager/import/wapiti.rb
Instance Method Summary collapse
Instance Method Details
#import_wapiti_xml(args = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/msf/core/db_manager/import/wapiti.rb', line 3 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 |
#import_wapiti_xml_file(args = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/msf/core/db_manager/import/wapiti.rb', line 13 def import_wapiti_xml_file(args={}) filename = args[:filename] data = "" ::File.open(filename, 'rb') do |f| data = f.read(f.stat.size) end import_wapiti_xml(args.merge(:data => data)) end |