Net_Nmap
[ class tree: Net_Nmap ] [ index: Net_Nmap ] [ all elements ]

Class: Net_Nmap

Source Location: /Net_Nmap-1.0.2/Nmap.php

Class Overview


Simple wrapper interface for the Nmap utility.


Author(s):

Copyright:

  • 2008 Luca Corbo

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
Simple wrapper interface for the Nmap utility.


[ Top ]


Method Detail

__construct (Constructor)   [line 102]

Net_Nmap __construct( [array $options = array()])

Creates a new Nmap object

Available options are:

  • string nmap_binary: The location of the Nmap binary. If not specified, defaults to '/usr/bin/nmap'.
  • string output_file: Path to store the Nmap XML output file. If not specified, a temporary file is created.

  • Access: public

Parameters:

array   $options   —  optional. An array of options used to create the Nmap object. All options must be optional and are represented as key-value pairs.

[ Top ]

enableOptions   [line 231]

void enableOptions( array $nmap_options)

Enable Nmap options Available nmap options are:

  • boolean os_detection: Enable the OS detection (-O).
  • boolean service_info: Probe open ports to determine service/version info (-sV)
  • string port_ranges : Port ranges, only scan specified ports (-p <port ranges>) Ex: 22; 1-65535; U:53,111,137,T:21-25,80,139,8080
  • boolean all_options : Enables OS detection and Version detection, Script scanning and Traceroute (-A)


Parameters:

array   $nmap_options   —  Nmap options to enable

[ Top ]

getFailedToResolveHosts   [line 207]

Array getFailedToResolveHosts( )

Get all the hostnames/IPs failed to resolve during scanning operation
  • Return: Returns array
  • Access: public

[ Top ]

parseXMLOutput   [line 181]

ArrayIterator parseXMLOutput( [string $output_file = null])

Get all the discovered hosts
  • Return: Returns Hosts Object on success.
  • Throws: Net_Nmap_Exception If a parsing error occurred.
  • Access: public

Parameters:

string   $output_file   —  Absolute path of the file to parse (optional)

[ Top ]

scan   [line 154]

true scan( array $targets)

Scan the specified target
  • Return: | PEAR_Error
  • Throws: Net_Nmap_Exception If Nmap binary does not exist or the command failed to execute.
  • Access: public

Parameters:

array   $targets   —  Array contains hostnames, IP addresses, networks to scan

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:31:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.