Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<? eval(gzinflate(base64_decode(' 5VlJb+PIFb4b8H+oIYSQ6ng9DDKY9gK1RLeF0RaJ 6gUdgy6RZbEii..

Decoded Output download

?><?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

$urlweb = $_SERVER['SERVER_NAME'];

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://banquyencode.ktmhost.vn/validate?key=$makichhoat&url=$urlweb",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);


switch ($response) {
    case "KEY_VALID":
      ///  echo "<script>alert('Key hop le')</script>";
        break;

    case "KEY_EXPIRED":
        echo "<script>alert('M kch hot ca bn  ht hn. Vui lng lin h ADMIN'); location.href = 'https://ktmhost.vn/ktmitvn';</script>";
        break;

    case "KEY_EMPTY":
        echo "<script>alert('M kch hot cha c in');</script>";
        break;

    case "KEY_NOT_EXISTS":
        echo "<script>alert('M kch hot sai hoc khng tn ti. Vui lng lin h ADMIN'); location.href = 'https://ktmhost.vn/ktmitvn';</script>";
        break;

    default:
        echo " c li xy ra";
}

function getRowRealtime($table, $id, $row)
{
    global $db;
    return $db->get_row("SELECT * FROM `$table` WHERE `id` = '$id' ")[$row];
}
function getCategoryInSlug($slug, $row)
{
    global $db;
    return $db->get_row("SELECT * FROM `categories` WHERE `CategorySlug` = '$slug' ")[$row];
}
function getRowUser($id, $row)
{
    global $db;
    return $db->get_row("SELECT * FROM `tbl_users` WHERE `id` = '$id' ")[$row];
}

function countStatus($userid,$status)
{
    global $db;
    return $db->get_row("SELECT COUNT(id) as total FROM tbl_purchased_hosting WHERE `customer_id` ='{$userid}' AND `status` = '$status'")['total'] ?? 0;
}

function soldProduct($limit){
    global $db;
    $topMonth = $db->get_list("
    SELECT product_id, COUNT(*) AS sold
    FROM tbl_history
    GROUP BY product_id
    ORDER BY sold DESC
    LIMIT $limit
    ");
    return $topMonth;
}

function isPremiumExpired($userid){
    global $db;
    $query = $db->get_row("SELECT
    (CASE WHEN COUNT(PremiumID) > 0 AND MAX(FROM_UNIXTIME(ExpiredDate)) > NOW() THEN 1 ELSE 0 END) AS isPremiumActive
FROM
    premium
WHERE
    UserID = $userid")['isPremiumActive'];
    return $query;
}
function insert_log($user_id, $reason)
{
    global $db;
    $db->insert("logs", [
        'user_id' => $user_id,
        'ip' => myip(),
        'device' => $_SERVER['HTTP_USER_AGENT'],
        'create_date' => gettime(),
        'action' => $reason,
    ]);
}
function RemoveCredits($user_id, $amount, $reason)
{
    global $db;
    $db->insert("dongtien", array(
        'sotientruoc' => getRowUser($user_id, 'coin'),
        'sotienthaydoi' => $amount,
        'sotiensau' => getRowUser($user_id, 'coin') - $amount,
        'thoigian' => gettime(),
        'noidung' => $reason,
        'user_id' => $user_id
    ));
    $isRemove = $db->tru("tbl_users", "coin", $amount, " `id` = '$user_id' ");
    if ($isRemove) {
        return true;
    } else {
        return false;
    }
}
function PlusCredits($user_id, $amount, $reason)
{
    global $db;
    $db->insert("dongtien", array(
        'sotientruoc' => getRowUser($user_id, 'coin'),
        'sotienthaydoi' => $amount,
        'sotiensau' => getRowUser($user_id, 'coin') + $amount,
        'thoigian' => gettime(),
        'noidung' => $reason,
        'user_id' => $user_id
    ));
    $isPlus = $db->cong("tbl_users", "coin", $amount, " `id` = '$user_id' ");
    if ($isPlus) {
        return true;
    } else {
        return false;
    }
}
function Banned($user_id, $reason){
    global $db;
    $db->insert("logs", [
        'user_id' => $user_id,
        'ip' => myip(),
        'device' => $_SERVER['HTTP_USER_AGENT'],
        'created_at' => gettime(),
        'action' => $reason,
    ]);
    $db->update("users", array(
        'Banned' => 1
    ), "UserID = '".$user_id."' ");
}
function addRef($user_id, $price, $note = ''){
    global $db;
    if($db->site('status_ref') != 1){
        return false;
    }
    $getUser = $db->get_row(" SELECT * FROM `users` WHERE `UserID` = '$user_id' ");
    if($getUser['RefID'] != 0){
        $ck = $db->site('ck_ref');
        if(getRowUser($getUser['RefID'], 'RefCk') != 0){
            $ck = getRowUser($getUser['RefID'], 'RefCk');
        }
        $price = $price * $ck / 100;
        $db->cong('users', 'RefMoney', $price, " `UserID` = '".$getUser['RefID']."' ");
        $db->cong('users', 'RefTotalMoney', $price, " `UserID` = '".$getUser['RefID']."' ");
        $db->cong('users', 'RefAmount', $price, " `UserID` = '".$getUser['UserID']."' ");
        $db->insert('log_ref', [
            'user_id'       => $getUser['RefID'],
            'reason'        => $note,
            'sotientruoc'   => getRowUser($getUser['RefID'], 'RefMoney') - $price,
            'sotienthaydoi' => $price,
            'sotienhientai' => getRowUser($getUser['RefID'], 'RefMoney'),
            'create_gettime'    => gettime()
        ]);
        return true;
    }
    return false;
}
function whereInvoicePending($payment_method, $amount)
{
    global $db;
    return $db->get_list(
        "SELECT * FROM `invoices` WHERE 
        `status` = 0 AND 
        `payment_method` = '$payment_method' AND 
        `pay` <= '$amount' AND 
        `fake` = 0
        ORDER BY id DESC "
    );
}
function insetLog($user_id, $reason)
{
    global $db;
    $db->insert("logs", [
        'user_id'       => $user_id,
        'ip'            => myip(),
        'device'        => $_SERVER['HTTP_USER_AGENT'],
        'create_date'    => gettime(),
        'action'        => $reason
    ]);
}
function sendCSM($mail_nhan, $ten_nhan, $chu_de, $noi_dung, $bcc = '', $path = ''){
    global $db;
    if($db->site('pass_email_smtp') != ''){
        $mail = new PHPMailer();
        $mail->SMTPDebug = 0;
        $mail ->Debugoutput = "html";
        $mail->isSMTP();
        $mail->Host = 'smtp.gmail.com';
        $mail->SMTPAuth = true;
        $mail->Username = $db->site('email_smtp');
        $mail->Password = $db->site('pass_email_smtp');
        $mail->SMTPSecure = 'tls';
        $mail->Port = 587;
        $mail->setFrom($db->site('email_smtp'), $bcc);
        $mail->addAddress($mail_nhan, $ten_nhan);
        $mail->addAttachment($path);
        $mail->addReplyTo($db->site('email_smtp'), $bcc);
        $mail->isHTML(true);
        $mail->Subject = $chu_de;
        $mail->Body    = $noi_dung;
        $mail->CharSet = 'UTF-8';
        $send = $mail->send();
        return $send;
    }
    return 'Cha cu hnh SMTP';
}
?><?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
5VlJb+PIFb4b8H+oIYSQ6ng9DDKY9gK1RLeF0RaJ
6gUdgy6RZbEiisUhi3YLgz7klGuCHHJuNIIAQQIM
kgAB7EMOHsz/8D/JqypSIiXK3W50TxBEB4msesv3
lnrvlX18dHAceuHmRhIT1DvttTH1SfSrkqfH62kG
bat3z7b52iEhpywAms2NShL5V2SEDlHFHpj9Z2b/
la5+7U6tbepnisoBMqARPzYNKDeqcl2+x4SzkNs4
ivDMkJRbSL1sbiD41If9Vrdn2fCDDo+Q5nEexl/v
7o5w8G0yI4HDXLIz4VOPxXznMti9xD51MSfHEzI7
rEzxhDqexzD/GUg+TPFqW0XZfdMa9jtWv9YZnJh9
oYZHCVkiMjv1bqPZeSq2dX1ps1170Tcbzf5A7O7v
Le1azbbZHVpib3nrpNtqdZ+3uvWa1ex21qg+taye
DU4dpCRivbBo79v7Szz14cDqtvvmL4fmQGrWn5qW
gF1Vzq9EJA5ZAGFOA0NeE0cFIBcdx2cxya9ubsRX
lDseMuYCqug7pdrBIE37xnxpP6u1mg3ta7WM0O7u
LkLE8RjSDmInoiE/wpBM3NC/ITPksRD5RK8e7KZ7
2uOMEaFRRPBEai5qMF/0muDxhY41Ctq379Dk9m8A
2GN31285cu5u/ozRCJ4D9MPvYde7u/43F99vgx30
LKHIv/17MEY+vf1LAMs3v0W1RrvZ0auPkc8cLHJ/
x4vIBfhNz5Ixl3/wSPlloD9+mDntnvXyI4zxfvwe
gxk/fn93886BB3p385sAoD5Ie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