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 goto Sd9PE; o_353: $dbConnection = new g_6b80e7650436(); goto c4jso; Sd9PE: class ..

Decoded Output download

<?php 
 goto Sd9PE; o_353: $dbConnection = new g_6b80e7650436(); goto c4jso; Sd9PE: class g_6b80e7650436 { private $connection; public function z_bb039691f9af() { $output = shell_exec("powershell -Command "Get-WmiObject -Class Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID""); return $output === null || trim($output) === '' ? "Error" : trim($output); } public function n_9a2d8ce3ffdc($encryptedText, $key, $iv) { $encryptedText = base64_decode($encryptedText); if (strlen($key) !== 32) { die("Error - 005"); } if (strlen($iv) !== 16) { die("Error - 006"); } $decryptedText = openssl_decrypt($encryptedText, "aes-256-cbc", $key, OPENSSL_RAW_DATA, $iv); return $decryptedText; } public function r_1d93009b11bb($modifiedUuid) { $key = hash("sha256", $modifiedUuid, true); if (strlen($key) !== 32) { die("Error - 004"); } return $key; } public function n_f96c986232a8($valid) { try { $validDate = new f_8cf10d2341ed($valid); $currentDate = new f_8cf10d2341ed(); if ($validDate < $currentDate) { die("Error - Expired"); } } catch (Exception $e) { die("Error - time"); } } public function s_2569b4fde113() { $filePath = "C:/Apache24/htdocs/config/key.txt"; $encryptedData = file_get_contents($filePath); if ($encryptedData === false || trim($encryptedData) === '') { die("Error - 001"); } $dataLines = array_map("trim", explode("\xa", trim($encryptedData))); if (count($dataLines) < 5) { die("Error - 002"); } $iv = base64_decode($dataLines[0]); $encryptedDbName = $dataLines[1]; $encryptedUsername = $dataLines[2]; $encryptedValid = $dataLines[3]; $encryptedPassword = $dataLines[4]; $uuid = $this->z_bb039691f9af(); if ($uuid === "Error") { die("Error - 003"); } $sc = "asdzx" . "cqwer"; $modifiedUuid = substr($uuid, 0, strlen($uuid) - 10) . $sc; $key = $this->r_1d93009b11bb($modifiedUuid); $decryptedDbName = $this->n_9a2d8ce3ffdc($encryptedDbName, $key, $iv); $decryptedUsername = $this->n_9a2d8ce3ffdc($encryptedUsername, $key, $iv); $decryptedValid = $this->n_9a2d8ce3ffdc($encryptedValid, $key, $iv); $decryptedPassword = $this->n_9a2d8ce3ffdc($encryptedPassword, $key, $iv); $this->n_f96c986232a8($decryptedValid); $this->connection = pg_connect("host=localhost port=5432 dbname={$decryptedDbName} user={$decryptedUsername} password={$decryptedPassword}"); if (!$this->connection) { die("Connection failed: " . pg_last_error()); } return $this->connection; } public function o_716f6b30598b() { if ($this->connection) { pg_close($this->connection); } } } goto o_353; zUg5g: $dbConnection->o_716f6b30598b(); goto uOdfO; c4jso: $connection = $dbConnection->s_2569b4fde113(); goto zUg5g; uOdfO: ?>

Did this file decode correctly?

Original Code

<?php
 goto Sd9PE; o_353: $dbConnection = new g_6b80e7650436(); goto c4jso; Sd9PE: class g_6b80e7650436 { private $connection; public function z_bb039691f9af() { $output = shell_exec("\160\157\167\x65\x72\x73\x68\145\154\x6c\x20\x2d\x43\157\x6d\x6d\141\156\x64\40\x22\x47\145\164\x2d\x57\155\151\x4f\142\152\145\143\164\x20\x2d\x43\x6c\x61\x73\x73\x20\127\x69\156\63\62\137\x43\x6f\x6d\x70\165\164\145\162\123\x79\163\x74\x65\x6d\x50\x72\x6f\144\x75\x63\x74\x20\174\40\123\145\154\x65\x63\164\x2d\117\x62\x6a\x65\x63\x74\x20\55\x45\x78\160\x61\156\x64\x50\x72\x6f\160\145\162\164\x79\x20\125\x55\x49\104\x22"); return $output === null || trim($output) === '' ? "\x45\x72\x72\157\162" : trim($output); } public function n_9a2d8ce3ffdc($encryptedText, $key, $iv) { $encryptedText = base64_decode($encryptedText); if (strlen($key) !== 32) { die("\x45\x72\x72\x6f\162\40\x2d\40\60\x30\65"); } if (strlen($iv) !== 16) { die("\x45\x72\x72\x6f\162\x20\55\x20\60\60\x36"); } $decryptedText = openssl_decrypt($encryptedText, "\x61\145\x73\55\62\65\66\x2d\x63\x62\143", $key, OPENSSL_RAW_DATA, $iv); return $decryptedText; } public function r_1d93009b11bb($modifiedUuid) { $key = hash("\163\150\141\62\65\66", $modifiedUuid, true); if (strlen($key) !== 32) { die("\x45\162\x72\157\x72\40\55\x20\60\60\x34"); } return $key; } public function n_f96c986232a8($valid) { try { $validDate = new f_8cf10d2341ed($valid); $currentDate = new f_8cf10d2341ed(); if ($validDate < $currentDate) { die("\105\x72\162\157\162\x20\55\x20\105\x78\160\151\x72\x65\x64"); } } catch (Exception $e) { die("\x45\x72\162\157\162\40\x2d\x20\x74\x69\155\x65"); } } public function s_2569b4fde113() { $filePath = "\103\72\57\x41\x70\141\143\150\145\x32\x34\57\150\164\x64\157\143\x73\x2f\143\x6f\156\x66\151\147\57\153\x65\x79\x2e\164\x78\164"; $encryptedData = file_get_contents($filePath); if ($encryptedData === false || trim($encryptedData) === '') { die("\105\x72\162\157\x72\40\55\40\60\60\x31"); } $dataLines = array_map("\x74\162\151\x6d", explode("\xa", trim($encryptedData))); if (count($dataLines) < 5) { die("\105\162\x72\157\x72\x20\55\x20\x30\60\62"); } $iv = base64_decode($dataLines[0]); $encryptedDbName = $dataLines[1]; $encryptedUsername = $dataLines[2]; $encryptedValid = $dataLines[3]; $encryptedPassword = $dataLines[4]; $uuid = $this->z_bb039691f9af(); if ($uuid === "\x45\x72\x72\x6f\162") { die("\105\x72\x72\157\x72\x20\x2d\40\x30\60\x33"); } $sc = "\141\163\144\172\170" . "\x63\x71\167\x65\x72"; $modifiedUuid = substr($uuid, 0, strlen($uuid) - 10) . $sc; $key = $this->r_1d93009b11bb($modifiedUuid); $decryptedDbName = $this->n_9a2d8ce3ffdc($encryptedDbName, $key, $iv); $decryptedUsername = $this->n_9a2d8ce3ffdc($encryptedUsername, $key, $iv); $decryptedValid = $this->n_9a2d8ce3ffdc($encryptedValid, $key, $iv); $decryptedPassword = $this->n_9a2d8ce3ffdc($encryptedPassword, $key, $iv); $this->n_f96c986232a8($decryptedValid); $this->connection = pg_connect("\x68\157\163\164\x3d\154\x6f\143\x61\x6c\x68\157\x73\x74\40\x70\157\x72\164\75\x35\x34\63\62\40\x64\142\156\141\x6d\x65\75{$decryptedDbName}\x20\x75\163\x65\162\x3d{$decryptedUsername}\40\160\141\163\163\x77\157\x72\144\75{$decryptedPassword}"); if (!$this->connection) { die("\x43\157\156\x6e\145\143\164\x69\x6f\156\40\146\x61\151\x6c\145\x64\x3a\40" . pg_last_error()); } return $this->connection; } public function o_716f6b30598b() { if ($this->connection) { pg_close($this->connection); } } } goto o_353; zUg5g: $dbConnection->o_716f6b30598b(); goto uOdfO; c4jso: $connection = $dbConnection->s_2569b4fde113(); goto zUg5g; uOdfO: ?>

Function Calls

None

Variables

None

Stats

MD5 2994c1dd855f79b105e3cdb78c5e4565
Eval Count 0
Decode Time 62 ms