示例#1
0
            if (!preg_match('/\\/\\d{1,2}$/', $asset)) {
                $aux[] = $asset . '/32';
            } else {
                $aux[] = $asset;
            }
        }
    }
}
$assets_string .= implode(' ', $aux);
$db->close();
$assets = $assets_string;
$scan_path_log = "/tmp/nmap_scanning_" . md5(Session::get_secure_id()) . '.log';
// Only Stop
if ($only_stop) {
    $scan = new Scan();
    $scan->stop();
    $data['status'] = 'OK';
    $data['data'] = NULL;
    echo json_encode($data);
    exit;
}
// Launch scan
if (!$only_status && !$only_stop) {
    // This object is only for checking available sensors
    $rscan = new Remote_scan($assets, $scan_mode == 'full' ? 'root' : 'ping');
    $available = $rscan->available_scan(preg_match('/^[0-9A-F]{32}$/i', $sensor) ? $sensor : '');
    $remote_sensor = "null";
    // default runs local scan
    unset($_SESSION['_remote_sensor_scan']);
    if (preg_match('/[0-9A-F]{32}/i', $sensor)) {
        if ($available == '') {
示例#2
0
function cancel_scan($wizard)
{
    $step = intval($wizard->get_step_data('scan_step'));
    if ($step == 1 || $step == 2) {
        $obj = new Scan();
        $obj->stop();
        $obj->delete_data();
    }
    $wizard->clean_step_data();
    $wizard->save_status();
    $response['error'] = FALSE;
    return $response;
}