Module: Nmap::XML::Scripts

Included in:
HostScript, Port, Postscript, Prescript
Defined in:
lib/nmap/xml/scripts.rb

Overview

Mixin that adds methods for parsing <script> XML elements.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#scriptsHash{String => Script}

The output from the NSE script's output and structured data.

Returns:

  • (Hash{String => Script})

    The NSE script names and output.

Since:

  • 0.3.0



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/nmap/xml/scripts.rb', line 21

def scripts
  unless @scripts
    @scripts = {}

    @node.xpath('script').each do |script|
      @scripts[script['id']] = Script.new(script)
    end
  end

  return @scripts
end