Site Archives nmap

Discovery hosts and services with PHP and Nmap


Requirements:
- PHP5
- PEAR::Net_Nmap
- nmap

<?php

/**
* Scan network to retrieve hosts and services information.
*/

require_once 'Net/Nmap.php';

//Define the target to scan
$target = array('127.0.0.1','www.yourserver.com');

$options = array('nmap_binary' => '/usr/local/bin/nmap');

try {
$nmap = new Net_Nmap($options);

//Enable nmap options
$nmap_options = array('os_detection' => true,
[...]