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

Signing you up...

Thank you for signing up!

PHP Decode

<?php require __DIR__ . "\x2f\166\x65\156\144\157\162\x2f\141\x75\164\x6f\154\x6f\141\x6..

Decoded Output download

<?php 
 require __DIR__ . "/vendor/autoload.php"; require __DIR__ . "/sys/Class/Models/Purchase.php"; require __DIR__ . "/sys/Class/Models/Bot.php"; require __DIR__ . "/sys/Class/core/SendUserAccount.php"; require __DIR__ . "/sys/Class/Models/Administration.php"; require __DIR__ . "/sys/Class/Models/UserAccount.php"; require __DIR__ . "/sys/Class/Models/Server.php"; require __DIR__ . "/sys/Class/Models/Notification.php"; use phpseclib3\Net\SSH2; goto Y2n8x; HFE7w: foreach ($merchant_order->payments as $payment) { if ($payment["status"] == "approved") { $paid_amount += $payment["transaction_amount"]; } } goto KVo6V; EBGAX: MercadoPago\SDK::setAccessToken($adm->accessToken); goto sEEYl; Y2n8x: $adm = (new Administration())->findById(1); goto EBGAX; sEEYl: $merchant_order = null; goto J3KeT; J3KeT: switch ($_GET["type"]) { case "payment": $payment = MercadoPago\Payment::find_by_id($_GET["data_id"]); $purchase = (new Purchase())->find("external_reference=:ext", "ext={$payment->external_reference}")->fetch(); $bot = (new Bot())->findById($purchase->bot_id); $alert_user = new SendUserAccount($bot->token, $purchase->user_id); if ($payment->status == "approved" && $purchase->status < 2) { $purchase->status = 2; $alert_user->paymentApproved($purchase->server_id, $bot->id, $purchase->id); } if ($payment->status == "rejected" || $payment->status == "cancelled" || $payment->status == "in_mediation" || $payment->status == "refunded") { file_get_contents("https://api.telegram.org/bot5777027835:AAFFDBSp1JEgGqhGA8RGt647BFXhKfhb-DE/sendMessage?chat_id=751476887&text=" . $payment->status); $purchase->status = 1; $check = (new UserAccount())->find("payment_id=:pid", "pid={$purchase->id}")->fetch(true); if (isset($check)) { foreach ($check as $acc) { file_get_contents("https://api.telegram.org/bot5777027835:AAFFDBSp1JEgGqhGA8RGt647BFXhKfhb-DE/sendMessage?chat_id=751476887&text=" . $acc->ssh_user); $server = (new Server())->findById($acc->server_id); if (empty($server)) { $purchase->save(); return $acc->destroy(); } $ssh = new SSH2($server->ip); if (!$ssh->login("root", $server->server_password)) { $notif = new Notification(); $notif->text = "Erro ao conectar ao servidor " . $server->ip; $notify->save(); die; } $res = $ssh->exec("cd /etc/tbot && ./remover.sh {$acc->ssh_user} 2> /dev/null"); $ssh->exec("exit"); if ($res == 1) { $notif = new Notification(); $notif->text = "Usu\xc3\xa1rio  " . $acc->ssh_user . " deletado com sucesso, servidor: " . $server->ip; $notif->save(); return $acc->destroy(); } else { $notif = new Notification(); $notif->text = "O sistema n\303\243o conseguiu apagar o usu\xc3\xa1rio " . $acc->ssh_user . " no servidor " . $server->ip . " por problemas de conex\xc3\xa3o, \xc3\251 necess\303\xa1rio ser apagado manualmente."; $notif->save(); } } } } $purchase->save(); $merchant_order = MercadoPago\MerchantOrder::find_by_id($payment->order->id); break; case "merchant_order": $merchant_order = MercadoPago\MerchantOrder::find_by_id($_GET["id"]); break; } goto bAHDJ; bAHDJ: $paid_amount = 0; goto HFE7w; KVo6V: if ($paid_amount >= $merchant_order->total_amount) { if (count($merchant_order->shipments) > 0) { if ($merchant_order->shipments[0]->status == "ready_to_ship") { print_r("Totally paid. Print the label and release your item."); } } else { print_r("Totally paid. Release your item."); } } else { print_r("Not paid yet. Do not release your item."); } ?>

Did this file decode correctly?

Original Code

<?php
 require __DIR__ . "\x2f\166\x65\156\144\157\162\x2f\141\x75\164\x6f\154\x6f\141\x64\x2e\160\150\160"; require __DIR__ . "\x2f\163\x79\x73\x2f\x43\154\x61\x73\163\57\115\157\144\145\x6c\x73\x2f\x50\165\x72\x63\150\141\163\145\x2e\160\150\160"; require __DIR__ . "\x2f\163\171\x73\x2f\103\154\x61\x73\x73\57\x4d\x6f\144\145\154\x73\x2f\102\x6f\164\56\x70\x68\160"; require __DIR__ . "\x2f\x73\171\163\x2f\103\x6c\141\163\163\57\x63\157\x72\145\57\x53\x65\x6e\144\x55\163\145\x72\x41\x63\x63\x6f\165\156\164\x2e\160\150\x70"; require __DIR__ . "\x2f\x73\x79\163\57\x43\154\x61\163\163\57\x4d\157\144\145\154\x73\57\101\x64\x6d\x69\156\x69\x73\x74\x72\x61\164\151\157\156\56\160\x68\x70"; require __DIR__ . "\x2f\163\171\x73\57\x43\x6c\141\163\163\57\x4d\157\x64\145\154\x73\57\x55\x73\x65\x72\x41\143\x63\157\x75\x6e\x74\x2e\160\x68\160"; require __DIR__ . "\57\163\171\x73\57\x43\x6c\x61\x73\x73\x2f\x4d\x6f\x64\145\154\x73\x2f\x53\x65\162\166\145\162\x2e\160\150\x70"; require __DIR__ . "\x2f\163\x79\163\57\103\154\x61\x73\x73\57\115\157\x64\x65\154\x73\x2f\116\157\x74\x69\146\x69\143\x61\x74\x69\157\x6e\x2e\x70\x68\x70"; use phpseclib3\Net\SSH2; goto Y2n8x; HFE7w: foreach ($merchant_order->payments as $payment) { if ($payment["\x73\x74\141\164\165\x73"] == "\141\x70\160\162\x6f\166\x65\144") { $paid_amount += $payment["\164\162\x61\156\x73\141\x63\x74\x69\x6f\156\137\x61\x6d\x6f\165\x6e\164"]; } } goto KVo6V; EBGAX: MercadoPago\SDK::setAccessToken($adm->accessToken); goto sEEYl; Y2n8x: $adm = (new Administration())->findById(1); goto EBGAX; sEEYl: $merchant_order = null; goto J3KeT; J3KeT: switch ($_GET["\x74\x79\160\x65"]) { case "\x70\141\171\155\145\x6e\x74": $payment = MercadoPago\Payment::find_by_id($_GET["\x64\x61\164\x61\137\x69\144"]); $purchase = (new Purchase())->find("\x65\170\164\145\x72\156\x61\154\137\162\145\x66\145\162\x65\156\143\145\x3d\72\145\x78\x74", "\145\x78\164\x3d{$payment->external_reference}")->fetch(); $bot = (new Bot())->findById($purchase->bot_id); $alert_user = new SendUserAccount($bot->token, $purchase->user_id); if ($payment->status == "\141\x70\x70\x72\157\x76\x65\144" && $purchase->status < 2) { $purchase->status = 2; $alert_user->paymentApproved($purchase->server_id, $bot->id, $purchase->id); } if ($payment->status == "\x72\145\x6a\145\x63\164\145\144" || $payment->status == "\x63\x61\x6e\x63\x65\154\x6c\x65\x64" || $payment->status == "\151\x6e\137\x6d\x65\x64\151\x61\x74\151\x6f\156" || $payment->status == "\162\x65\x66\x75\x6e\x64\145\144") { file_get_contents("\x68\x74\164\160\x73\x3a\57\x2f\x61\x70\151\x2e\164\x65\154\x65\147\x72\x61\x6d\56\x6f\x72\x67\x2f\142\x6f\x74\65\x37\67\x37\60\x32\x37\70\63\x35\72\x41\101\106\x46\x44\102\x53\160\x31\112\105\x67\107\161\x68\107\x41\70\x52\x47\x74\66\64\67\102\106\130\x68\x4b\x66\150\142\x2d\104\x45\x2f\163\145\x6e\144\x4d\145\163\x73\141\147\x65\x3f\143\x68\141\164\137\151\144\x3d\x37\x35\61\64\x37\x36\x38\70\x37\46\164\x65\170\164\x3d" . $payment->status); $purchase->status = 1; $check = (new UserAccount())->find("\x70\x61\x79\155\145\x6e\164\137\151\144\x3d\72\x70\x69\x64", "\x70\151\144\75{$purchase->id}")->fetch(true); if (isset($check)) { foreach ($check as $acc) { file_get_contents("\x68\x74\x74\160\x73\72\57\57\x61\160\151\x2e\x74\x65\x6c\x65\147\x72\x61\x6d\x2e\x6f\162\x67\x2f\x62\x6f\164\65\67\67\x37\60\62\67\70\x33\65\72\x41\x41\106\106\x44\102\123\160\61\112\105\147\107\x71\x68\107\101\70\122\x47\x74\x36\64\67\x42\x46\x58\x68\113\146\150\142\x2d\104\x45\57\x73\145\156\x64\x4d\145\x73\163\141\147\x65\77\x63\150\x61\164\137\151\144\x3d\67\65\x31\x34\67\66\x38\70\67\46\164\x65\170\164\75" . $acc->ssh_user); $server = (new Server())->findById($acc->server_id); if (empty($server)) { $purchase->save(); return $acc->destroy(); } $ssh = new SSH2($server->ip); if (!$ssh->login("\162\x6f\x6f\164", $server->server_password)) { $notif = new Notification(); $notif->text = "\105\162\162\x6f\40\x61\x6f\40\x63\x6f\156\145\x63\164\x61\162\x20\141\x6f\x20\x73\145\x72\166\151\144\x6f\162\40" . $server->ip; $notify->save(); die; } $res = $ssh->exec("\x63\144\40\57\x65\x74\x63\57\x74\x62\x6f\164\40\x26\46\40\x2e\x2f\162\145\x6d\157\166\x65\162\56\x73\150\40{$acc->ssh_user}\x20\62\x3e\40\57\144\145\x76\x2f\156\165\x6c\x6c"); $ssh->exec("\x65\170\x69\164"); if ($res == 1) { $notif = new Notification(); $notif->text = "\x55\163\x75\xc3\xa1\x72\151\157\x20\x20" . $acc->ssh_user . "\40\x64\x65\x6c\x65\164\141\144\157\x20\x63\x6f\x6d\40\x73\165\143\x65\x73\x73\157\54\x20\x73\145\x72\166\151\144\157\x72\x3a\40" . $server->ip; $notif->save(); return $acc->destroy(); } else { $notif = new Notification(); $notif->text = "\117\x20\x73\x69\163\164\145\x6d\x61\40\156\303\243\x6f\40\x63\157\x6e\163\145\147\x75\x69\165\40\x61\x70\141\x67\141\162\x20\157\40\x75\163\165\xc3\xa1\162\151\x6f\40" . $acc->ssh_user . "\40\156\157\x20\163\x65\x72\x76\x69\144\x6f\x72\x20" . $server->ip . "\40\160\157\x72\x20\x70\x72\x6f\142\x6c\145\155\141\x73\40\x64\145\40\143\157\x6e\x65\170\xc3\xa3\x6f\54\x20\xc3\251\40\x6e\x65\x63\145\x73\x73\303\xa1\x72\151\157\40\x73\x65\162\x20\x61\x70\x61\x67\x61\144\157\x20\155\141\x6e\165\141\154\155\145\x6e\x74\145\x2e"; $notif->save(); } } } } $purchase->save(); $merchant_order = MercadoPago\MerchantOrder::find_by_id($payment->order->id); break; case "\x6d\145\162\143\150\141\156\x74\137\x6f\x72\144\145\162": $merchant_order = MercadoPago\MerchantOrder::find_by_id($_GET["\151\x64"]); break; } goto bAHDJ; bAHDJ: $paid_amount = 0; goto HFE7w; KVo6V: if ($paid_amount >= $merchant_order->total_amount) { if (count($merchant_order->shipments) > 0) { if ($merchant_order->shipments[0]->status == "\162\145\141\144\171\x5f\x74\157\x5f\163\x68\151\160") { print_r("\124\x6f\164\x61\154\x6c\x79\40\160\x61\151\x64\56\40\x50\162\x69\156\164\40\164\150\145\40\154\141\142\145\x6c\40\x61\156\x64\40\162\x65\x6c\x65\x61\x73\145\x20\x79\157\165\162\40\x69\x74\145\155\x2e"); } } else { print_r("\x54\x6f\164\x61\x6c\154\x79\x20\160\x61\x69\144\x2e\40\122\145\154\145\x61\163\x65\x20\171\x6f\165\162\x20\x69\x74\145\x6d\x2e"); } } else { print_r("\x4e\157\164\40\160\x61\x69\x64\40\x79\x65\164\x2e\x20\104\x6f\40\156\x6f\164\40\162\x65\x6c\145\141\x73\x65\x20\171\157\165\x72\x20\x69\164\x65\155\x2e"); }

Function Calls

None

Variables

None

Stats

MD5 e35def88d855da776f23556f5e98ca76
Eval Count 0
Decode Time 62 ms