Last active
April 25, 2022 18:09
-
-
Save iNawaR1/69295954c4b4318e47efe8be86dd50b2 to your computer and use it in GitHub Desktop.
Simple script for pulling IPs. you will receive all the IPs from your telegram bot so you need Bot token and your Telegram ID. I am not responsible for any wrong use for this script !!.. usage : just copy this script to your website and you are good to go.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ip_target = $_SERVER['HTTP_CLIENT_IP'] ? $_SERVER['HTTP_CLIENT_IP'] : ($_SERVER['HTTP_X_FORWARDED_FOR'] ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']); | |
$bot_token = "Your Telegram bot Token here"; | |
$chatid = "Your Telegram ID here"; | |
sendMessage($chatid, '✳ IP : ' . $ip_target, $bot_token); | |
function sendMessage($chatID, $messaggio, $bot_token) { | |
$url = "https://api.telegram.org/bot" . $bot_token . "/sendMessage?chat_id=" . $chatID; | |
$url = $url . "&text=" . urlencode($messaggio); | |
$ch = curl_init(); | |
$optArray = array( | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true | |
); | |
curl_setopt_array($ch, $optArray); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
return $result; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment