Class: Nmap::Parser::Host

Class | Nmap::Parser::Host
In: | lib/nmap/parser.rb
Parent: | Object

This holds all of the information about a target host.

Status, IP/MAC addresses, hostnames, all that. Port information is available in this class; either accessed through here or directly from a Port object.

### Methods

addr all_hostnames extraports hostname hostnames ip_proto ip_proto_list ip_protos ip_reason ip_service ip_state new script script_output scripts tcp_port tcp_port_list tcp_ports tcp_reason tcp_script tcp_script_output tcp_scripts tcp_service tcp_state udp_port udp_port_list udp_ports udp_reason udp_script udp_script_output udp_scripts udp_service udp_state

### Classes and Modules

Class Nmap::Parser::Host::ExtraPorts
Class Nmap::Parser::Host::OS
Class Nmap::Parser::Host::Port
Class Nmap::Parser::Host::Script
Class Nmap::Parser::Host::Times
Class Nmap::Parser::Host::Traceroute

### External Aliases

ip4_addr | -> | ipv4_addr
ip6_addr | -> | ipv6_addr

### Attributes

distance | [R] | Network distance (not necessarily the same as from traceroute)
endtime | [R] | Host start and end times
ip4_addr | [R] | The IPv4 address
ip6_addr | [R] | The IPv6 address
ipidsequence_class | [R] | IPID Sequence Number information
ipidsequence_values | [R] | IPID Sequence Number information
mac_addr | [R] | The MAC address
mac_vendor | [R] | The MAC vendor
os | [R] | OS object holding Operating System information
reason | [R] | The reason for the status
smurf | [R] | The number of "weird responses"
starttime | [R] | Host start and end times
status | [R] | The status of the host, typically "up" or "down"
tcpsequence_class | [R] | TCP Sequence Number information
tcpsequence_difficulty | [R] | TCP Sequence Number information
tcpsequence_index | [R] | TCP Sequence Number information
tcpsequence_values | [R] | TCP Sequence Number information
tcptssequence_class | [R] | TCP Timestamp Sequence Number information
tcptssequence_values | [R] | TCP Timestamp Sequence Number information
times | [R] | Times object holding timing information
traceroute | [R] | Traceroute object
uptime_lastboot | [R] | Uptime information
uptime_seconds | [R] | Uptime information

### Public Class methods

new(hostinfo)

### Public Instance methods

addr()

Returns the IPv4 or IPv6 address of host

all_hostnames() {|hostname| ...}

Returns an array containing all of the hostnames for this host, and passes them each to a block if one is given

extraports( {|extraports| ...}

Returns an array of ExtraPorts objects, and passes them each to a block if one if given

hostname()

Returns the first hostname, or nil if unavailable

hostnames()

Alias for all_hostnames

ip_proto(protonum) {|proto| ...}

Returns the Port object for the IP protocol `protonum`, and passes it to a block if one is given

ip_proto_list(state = "") {|proto| ...}

Returns an array of IP protocol numbers, and passes them each to a block if one given

If an argument is given, only protocols matching `state` are given.

ip_protos(state = "") {|proto| ...}

Returns an array of Port objects for each IP protocol, and passes them each to a block if one is given

If an argument is given, only protocols matching `state` are given. Note that combinations like "open|filtered" will get matched by "open" and "filtered"

ip_reason(protonum)

Returns the state reason of IP protocol `protonum`

ip_service(protonum)

Returns a Port::Service object for IP protocol `protonum`

ip_state(protonum)

Returns the state of IP protocol `protonum`

script(name)

Returns the Script object for the specified host script `name`

script_output(name)

Returns the output of the specified host script `name`

scripts() {|script| ...}

Returns an array of Script objects for each host script run, and passes them each to a block if given

tcp_port(portnum) {|port| ...}

Returns the Port object for the TCP port `portnum`, and passes it to a block if one is given

tcp_port_list(state = "") {|port| ...}

Returns an array of TCP port numbers, and passes them each to a block if one given

If an argument is given, only ports matching `state` are given.

tcp_ports(state = "") {|port| ...}

Returns an array of Port objects for each TCP port, and passes them each to a block if one is given

If an argument is given, only ports matching `state` are given. Note that combinations like "open|filtered" will get matched by "open" and "filtered"

tcp_reason(portnum)

Returns the state reason of TCP port `portnum`

tcp_script(portnum, name)

Returns the Script object for the script `name` run against the TCP port `portnum`

tcp_script_output(portnum, name)

Returns the output of the script `name` on the TCP port `portnum`

tcp_scripts(portnum) {|script| ...}

Returns an array of Script objects for each script run on the TCP port `portnum`, and passes them each to a block if given

tcp_service(portnum)

Returns a Port::Service object for TCP port `portnum`

tcp_state(portnum)

Returns the state of TCP port `portnum`

udp_port(portnum) {|port| ...}

Returns the Port object for the UDP port `portnum`, and passes it to a block if one is given

udp_port_list(state = "") {|port| ...}

Returns an array of UDP port numbers, and passes them each to a block if one is given

If an argument is given, only ports matching `state` are given.

udp_ports(state = "") {|port| ...}

Returns an array of Port objects for each UDP port, and passes them each to a block if one is given

If an argument is given, only ports matching `state` are given. Note that combinations like "open|filtered" will get matched by "open" and "filtered"

udp_reason(portnum)

Returns the state reason of UDP port `portnum`

udp_script(portnum, name)

Returns the Script object for the script `name` run against the UDP port `portnum`

udp_script_output(portnum, name)

Returns the output of the script `name` on the UDP port `portnum`

udp_scripts(portnum) {|script| ...}

Returns an array of Script objects for each script run on the UDP port `portnum`, and passes them each to a block if given

udp_service(portnum)

Returns a Port::Service object for UDP port `portnum`

udp_state(portnum)

Returns the state of UDP port `portnum`

[Validate]