false, 'msg' => 'invalid action']); exit; } header('Content-Type: application/json; charset=utf-8'); $notifier = $input['notifier'] ?? 'Attacker'; $team = $input['team'] ?? 'Team'; $mirror = $input['mirror'] ?? 'defacerid'; $url = trim($input['url'] ?? ''); if ($url === '') { echo json_encode(['ok' => false, 'msg' => 'empty url']); exit; } // --- API DefacerID --- $payload = json_encode([ "notifier" => $notifier, "team" => $team, "url" => $url, "poc" => "Not available", "reason" => "Not available" ]); $ch = curl_init("https://api.defacer.id/notify"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ]); $resp = curl_exec($ch); $curl_err = curl_error($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $status = 'ERROR'; $note = 'Bekas/BanList'; $message = ''; if ($resp !== false && $http_code >= 200 && $http_code < 300) { $json = json_decode($resp, true); if (json_last_error() === JSON_ERROR_NONE) { $message = $json['message'] ?? ''; if (stripos($message, 'success') !== false || stripos($message, 'ok') !== false || stripos($message, 'created') !== false) { $status = 'SUCCESS'; $note = 'Perawan'; } } else { $status = 'SUCCESS'; $note = 'Perawan'; $message = substr($resp, 0, 200); } } else { $message = $curl_err ?: "HTTP:$http_code " . substr($resp, 0, 200); } echo json_encode([ 'ok' => true, 'url' => $url, 'status' => $status, 'note' => $note, 'http' => $http_code, 'message' => $message ]); exit; } ?>