Parent

Nmap::Parser::Session

This holds session information, such as runtime, Nmap's arguments, and verbosity/debugging

Attributes

debug[R]

Amount of debugging (-d) used while scanning

debugging[R]

Amount of debugging (-d) used while scanning

nmap_version[R]

The Nmap version number used to scan

scan_args[R]

Holds the command run to initiate the scan

scan_time[R]

Total scan time in seconds (can differ from stop_time - start_time)

start_str[R]

Starting time

start_time[R]

Starting time

stop_str[R]

Ending time

stop_time[R]

Ending time

verbose[R]

Amount of verbosity (-v) used while scanning

verbosity[R]

Amount of verbosity (-v) used while scanning

xml_version[R]

XML version of Nmap's output

Public Class Methods

new(root) click to toggle source
# File lib/nmap/parser.rb, line 423
def initialize(root)
        parse(root)
end

Public Instance Methods

numservices(type = "") click to toggle source

Returns the total number of services that were scanned or, if an argument is given, returns the number of services scanned for type (e.g. "syn")

# File lib/nmap/parser.rb, line 374
def numservices(type = "")
        total = 0

        @scaninfo.each do |info|
                if type.empty?
                        total += info.numservices
                elsif info.type == type
                        return info.numservices
                end
        end

        total
end
scan_type_proto(type) click to toggle source

Returns the protocol associated with the specified scan type (e.g. "tcp" for type "syn")

# File lib/nmap/parser.rb, line 390
def scan_type_proto(type)
        @scaninfo.each do |info|
                return info.proto if info.type == type
        end

        nil
end
scan_types() click to toggle source

Returns an array of all the scan types performed, and passes them each to a block if one if given

# File lib/nmap/parser.rb, line 400
def scan_types() # :yields: scantype
        types = []

        @scaninfo.each do |info|
                types << info.type
                yield info.type if block_given?
        end

        types
end
scanflags(type) click to toggle source

Returns the scanflags associated with the specified scan type (e.g. "PSHACK" for type "ack")

# File lib/nmap/parser.rb, line 413
def scanflags(type)
        @scaninfo.each do |info|
                return info.scanflags if info.type == type
        end

        nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.