echo "\tSensor: " . $av_scan->get_sensor() . "\n"; echo "\tScan Options: \n"; $sc_options = $av_scan->get_scan_options(); foreach ($sc_options as $sc_type => $sc_value) { echo "\t\t{$sc_type}: {$sc_value}\n"; } if ($display_results == 1) { $status = $av_scan->get_status(); while ($status['status']['code'] != Av_scan::ST_SCAN_FINISHED) { sleep(2); $status = $av_scan->get_status(); } // Getting discovered hosts $scan_report = $av_scan->download_scan_report(); // Deleting Scan Report $av_scan->delete_scan(); //Parsing scan report $nmap_parser = new Nmap_parser(); $scan_report = $nmap_parser->parse_json($scan_report, $av_scan->get_sensor()); if (!empty($scan_report['scanned_ips'])) { foreach ($scan_report['scanned_ips'] as $ip => $hdata) { if ($hdata['status'] == 'up') { echo "Host {$ip} appears to be up\n"; } } } } } catch (Exception $e) { echo strip_tags($e->getMessage()); } echo "\n\n";