PHP code example of guisehn / willdurand-nmap

1. Go to this page and download the library: Download guisehn/willdurand-nmap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

guisehn / willdurand-nmap example snippets


$hosts = Nmap::create()->scan([ 'williamdurand.fr' ]);

$ports = $hosts->getOpenPorts();
 php
$nmap = new Nmap();

$nmap->scan([ 'williamdurand.fr' ], [ 21, 22, 80 ]);
 php
$nmap
    ->enableVerbose()
    ->scan([ 'williamdurand.fr' ]);
 php
$nmap
    ->disablePortScan()
    ->scan([ 'williamdurand.fr' ]);
 php
$nmap
    ->disableReverseDNS()
    ->scan([ 'williamdurand.fr' ]);
 php
$nmap
    ->setTimeout(120)
    ->scan([ 'williamdurand.fr' ]);