Module: RemoteNmapDataService

Includes:
ResponseDataHelper
Included in:
DataServiceAutoLoader
Defined in:
lib/metasploit/framework/data_service/remote/http/remote_nmap_data_service.rb

Constant Summary collapse

NMAP_PATH =
'/api/v1/nmaps'

Instance Method Summary collapse

Methods included from ResponseDataHelper

#json_to_hash, #json_to_mdm_object, #process_file, #to_ar

Instance Method Details

#import_nmap_xml_file(opts) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/metasploit/framework/data_service/remote/http/remote_nmap_data_service.rb', line 8

def import_nmap_xml_file(opts)
  filename = opts[:filename]
  data = ""
  File.open(filename, 'rb') do |f|
    data = f.read(f.stat.size)
  end

  opts[:data] = Base64.urlsafe_encode64(data)

  self.post_data(NMAP_PATH, opts)
end