die("Incorrect net/host format {$net}\n"); } if ($remote_sensor != "" && $remote_sensor != "null") { $rscan = new RemoteScan($net, "ping", $remote_sensor, $nmap_completed_scan); $quiet = $timing_template != "" ? FALSE : TRUE; echo "Scanning remote network: {$net}\n"; $rscan->do_scan($quiet); if ($rscan->err() == "") { $ips = $rscan->get_scan(); } else { $ips = array(); echo "Unable to run remote scan: " . $rscan->err() . "\n"; } } else { echo "Scanning local network: {$net}\n"; $scan = new Scan($net, null, $nmap_completed_scan); $scan->append_option($timing_template); if ($full == "fast") { $scan->append_option("-F"); $scan->do_scan(TRUE); } elseif ($full == "full") { $scan->do_scan(TRUE); } else { $scan->do_scan(FALSE); } echo "\n"; $ips = $scan->get_scan(); } foreach ($ips as $ip => $val) { echo "Host {$ip} appears to be up\n"; }