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 /* ### OBF ### */ error_reporting(1); ini_set("\155\141\x78\137\145\x78\145\x63\1..
Decoded Output download
<?php
/* ### OBF ### */
error_reporting(1); ini_set("max_execution_time", 30); include_once dirname(__FILE__) . "/../include/check.php"; $resultCode = false; $url = str_replace(" ", "%20", $ARGUMENTS[0]); $codes = array(0 => "Domain Not Found", 100 => "Continue", 101 => "Switching Protocols", 200 => "OK", 201 => "Created", 202 => "Accepted", 203 => "Non-Authoritative Information", 204 => "No Content", 205 => "Reset Content", 206 => "Partial Content", 300 => "Multiple Choices", 301 => "Moved Permanently", 302 => "Found", 303 => "See Other", 304 => "Not Modified", 305 => "Use Proxy", 307 => "Temporary Redirect", 400 => "Bad Request", 401 => "Unauthorized", 402 => "Payment Required", 403 => "Forbidden", 404 => "Not Found", 405 => "Method Not Allowed", 406 => "Not Acceptable", 407 => "Proxy Authentication Required", 408 => "Request Timeout", 409 => "Conflict", 410 => "Gone", 411 => "Length Required", 412 => "Precondition Failed", 413 => "Request Entity Too Large", 414 => "Request-URI Too Long", 415 => "Unsupported Media Type", 416 => "Requested Range Not Satisfiable", 417 => "Expectation Failed", 500 => "Internal Server Error", 501 => "Not Implemented", 502 => "Bad Gateway", 503 => "Service Unavailable", 504 => "Gateway Timeout", 505 => "HTTP Version Not Supported"); $encoding = false; $options = array(CURLOPT_URL => $url, CURLOPT_HEADER => false, CURLOPT_COOKIESESSION => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36", CURLOPT_ENCODING => "gzip", CURLOPT_CAINFO => "/etc/ca.pem", CURLOPT_CONNECTTIMEOUT => 15, CURLOPT_TIMEOUT => 30); if (!(isset($ARGUMENTS[1]) && strlen($ARGUMENTS[1]) && $ARGUMENTS[1] != "log")) { goto RkNlo; } $ARGUMENTS[1] = json_decode(urldecode($ARGUMENTS[1]), true); foreach ($ARGUMENTS[1] as $opt => $value) { switch ($opt) { case "headers": if (is_array($value)) { goto R0Ov_; } $value = array($value); R0Ov_: if (is_array($options[CURLOPT_HTTPHEADER])) { goto G7iwh; } $options[CURLOPT_HTTPHEADER] = $value; goto C8Zi2; G7iwh: $options[CURLOPT_HTTPHEADER] = array_merge($options[CURLOPT_HTTPHEADER], $value); C8Zi2: goto ChFZ5; case "include_headers": $options[CURLOPT_HEADER] = true; goto ChFZ5; case "post": $options[CURLOPT_POST] = true; $options[CURLOPT_POSTFIELDS] = $value; goto ChFZ5; case "cookie": $options[CURLOPT_COOKIE] = $value; goto ChFZ5; case "follow_off": $options[CURLOPT_FOLLOWLOCATION] = false; goto ChFZ5; case "encoding": $encoding = $value; goto ChFZ5; case "resultcode": $resultCode = $value; goto ChFZ5; } T6GpP: ChFZ5: rGngi: } nTzOX: RkNlo: if (!count(array_keys($_POST))) { goto FYaTN; } $options[CURLOPT_POST] = true; $options[CURLOPT_POSTFIELDS] = $_POST; $options[CURLOPT_HTTPHEADER] = array("Expect: "); FYaTN: $rules = dirname(__FILE__) . "/http_rules.php"; if (!file_exists($rules)) { goto fGKB2; } include $rules; fGKB2: Dgi1F: $ch = curl_init(); curl_setopt_array($ch, $options); $output = curl_exec($ch); $header = curl_getinfo($ch); curl_close($ch); if ($output === false || !$header["http_code"] || $header["http_code"] >= 400) { goto VtA0f; } $success = true; goto SgSTR; VtA0f: $success = false; SgSTR: if ($proxyAttempts-- > 0 && !$success) { goto Dgi1F; } f8i01: if ($resultCode === false) { goto xH7La; } header("HTTP/1.1 " . $resultCode . " " . $codes[$resultCode]); goto Vzfu8; xH7La: header("HTTP/1.1 " . $header["http_code"] . " " . $codes[$header["http_code"]]); Vzfu8: if (!$encoding) { goto OIsFE; } header("content-type: " . $header["content_type"] . "; charset=" . $encoding); goto q1_DF; OIsFE: header("content-type: " . $header["content_type"]); q1_DF: $logger = array_search("log", $ARGUMENTS); if (!($logger === FALSE)) { goto qfphM; } echo $output ? $output : ''; exit; qfphM: $session = $ARGUMENTS[$logger + 1]; $counter = $ARGUMENTS[$logger + 2]; $storage = $ARGUMENTS[$logger + 3]; if (!(empty($storage) || !file_exists($storage))) { goto inq8f; } $storage = glob("/media/{USB,HDD}-*", GLOB_BRACE); if (count($storage)) { goto wm2u0; } exit; goto R5ZfA; wm2u0: $storage = $storage[0]; R5ZfA: $storage .= "/stb-logs/session-" . $session . "/requests"; inq8f: if (file_exists($storage)) { goto K_XwJ; } mkdir($storage, 0777, true); K_XwJ: if (file_exists($storage)) { goto GX2RU; } echo $output; exit; GX2RU: $idx = 0; TxY4E: $mtime = explode(" ", microtime()); $mtime = sprintf("%05d-%s%.06f", $counter, $mtime[1], $mtime[0]); $fname = $storage . "/" . $mtime . "-" . $idx . ".log"; $idx++; if (file_exists($fname)) { goto TxY4E; } Db1K2: echo "[[@LDATA:url:{$url}:LDATA@]][[@LDATA:storage:{$storage}:LDATA@]]
{$output}\xa"; $handle = popen("packer > {$fname}", "w"); fwrite($handle, "{$url}
{$output}"); pclose($handle); ?>
Did this file decode correctly?
Original Code
<?php
/* ### OBF ### */
error_reporting(1); ini_set("\155\141\x78\137\145\x78\145\x63\165\164\151\157\156\x5f\x74\x69\x6d\145", 30); include_once dirname(__FILE__) . "\57\56\56\x2f\151\x6e\x63\x6c\165\x64\x65\x2f\143\150\145\x63\x6b\x2e\160\150\x70"; $resultCode = false; $url = str_replace("\x20", "\x25\x32\x30", $ARGUMENTS[0]); $codes = array(0 => "\x44\157\x6d\x61\x69\156\40\x4e\x6f\x74\x20\106\157\x75\x6e\144", 100 => "\103\157\x6e\164\x69\156\x75\145", 101 => "\123\x77\x69\x74\x63\150\151\156\147\x20\x50\162\x6f\x74\x6f\x63\x6f\154\x73", 200 => "\117\x4b", 201 => "\x43\x72\x65\x61\164\x65\x64", 202 => "\x41\143\143\x65\x70\164\145\144", 203 => "\x4e\157\156\55\101\x75\x74\150\157\162\x69\x74\x61\164\151\x76\145\40\111\x6e\146\157\x72\155\141\x74\x69\x6f\x6e", 204 => "\116\x6f\x20\103\157\156\x74\x65\x6e\x74", 205 => "\122\x65\x73\x65\x74\40\103\x6f\156\x74\145\x6e\x74", 206 => "\120\141\162\x74\x69\x61\154\40\x43\x6f\x6e\164\145\156\x74", 300 => "\x4d\165\x6c\x74\151\x70\x6c\145\40\103\x68\x6f\x69\x63\x65\x73", 301 => "\x4d\157\x76\x65\x64\40\120\145\162\x6d\141\x6e\145\156\164\154\171", 302 => "\x46\x6f\165\156\144", 303 => "\123\145\x65\x20\x4f\164\150\145\x72", 304 => "\x4e\x6f\164\x20\115\157\x64\x69\x66\x69\x65\x64", 305 => "\125\x73\x65\x20\120\162\x6f\170\x79", 307 => "\x54\x65\155\160\x6f\162\141\x72\171\x20\x52\x65\x64\151\162\x65\143\164", 400 => "\102\141\x64\x20\x52\x65\161\165\145\x73\x74", 401 => "\x55\x6e\x61\165\164\x68\x6f\162\x69\172\145\x64", 402 => "\x50\x61\171\x6d\145\x6e\x74\x20\x52\x65\161\165\151\x72\x65\144", 403 => "\106\157\162\x62\151\144\x64\x65\x6e", 404 => "\x4e\157\x74\x20\106\157\x75\x6e\144", 405 => "\x4d\145\164\150\x6f\144\x20\x4e\157\164\x20\x41\154\x6c\x6f\167\145\x64", 406 => "\x4e\157\164\40\101\x63\143\x65\x70\x74\141\x62\154\145", 407 => "\x50\x72\157\x78\x79\x20\101\165\x74\x68\145\156\164\151\x63\x61\164\151\x6f\x6e\x20\122\x65\161\x75\x69\x72\145\144", 408 => "\122\145\161\x75\145\x73\164\40\x54\151\x6d\x65\x6f\165\164", 409 => "\x43\x6f\156\146\154\151\143\x74", 410 => "\107\x6f\x6e\145", 411 => "\114\x65\x6e\x67\x74\x68\x20\x52\x65\161\165\x69\x72\x65\144", 412 => "\x50\x72\145\143\x6f\x6e\144\151\x74\151\157\x6e\x20\x46\141\x69\x6c\x65\x64", 413 => "\x52\145\x71\x75\145\x73\164\40\105\156\x74\151\164\171\40\124\x6f\x6f\40\x4c\141\x72\x67\x65", 414 => "\x52\145\x71\x75\x65\x73\164\55\125\122\x49\x20\124\x6f\157\x20\114\157\x6e\147", 415 => "\125\156\163\x75\x70\x70\157\162\x74\145\144\x20\x4d\x65\144\x69\x61\40\x54\171\160\145", 416 => "\122\145\161\165\x65\163\x74\145\144\40\x52\141\x6e\147\x65\x20\x4e\x6f\x74\40\123\141\x74\x69\163\x66\151\141\142\x6c\145", 417 => "\105\x78\160\x65\143\164\x61\164\151\x6f\x6e\x20\x46\x61\x69\x6c\x65\x64", 500 => "\111\156\164\145\x72\x6e\141\154\x20\x53\145\162\166\x65\162\40\105\162\162\x6f\x72", 501 => "\116\157\164\40\111\155\x70\154\x65\155\145\x6e\164\x65\144", 502 => "\102\x61\144\x20\107\141\164\145\x77\141\x79", 503 => "\123\145\x72\166\x69\143\x65\40\x55\156\141\x76\141\x69\x6c\x61\x62\x6c\x65", 504 => "\x47\x61\164\145\x77\x61\171\x20\x54\151\155\x65\157\x75\x74", 505 => "\x48\124\124\120\x20\x56\x65\162\163\x69\x6f\156\40\x4e\x6f\x74\x20\x53\165\160\160\157\x72\164\145\144"); $encoding = false; $options = array(CURLOPT_URL => $url, CURLOPT_HEADER => false, CURLOPT_COOKIESESSION => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => "\115\x6f\172\x69\154\154\141\57\65\56\x30\40\x28\x57\x69\156\144\x6f\167\163\x20\116\124\x20\x31\60\56\x30\x3b\40\x57\151\x6e\x36\64\x3b\x20\170\66\64\x29\40\x41\x70\160\154\145\x57\x65\142\x4b\x69\164\57\x35\x33\x37\x2e\63\66\40\x28\x4b\110\124\115\114\54\x20\x6c\x69\153\145\40\107\x65\x63\x6b\x6f\51\x20\x43\x68\x72\x6f\155\145\57\71\x39\56\x30\56\x34\x38\x34\64\x2e\x38\x34\40\123\x61\146\x61\162\x69\57\65\63\x37\56\63\66", CURLOPT_ENCODING => "\147\x7a\x69\160", CURLOPT_CAINFO => "\x2f\x65\164\x63\57\143\141\56\x70\145\x6d", CURLOPT_CONNECTTIMEOUT => 15, CURLOPT_TIMEOUT => 30); if (!(isset($ARGUMENTS[1]) && strlen($ARGUMENTS[1]) && $ARGUMENTS[1] != "\x6c\x6f\147")) { goto RkNlo; } $ARGUMENTS[1] = json_decode(urldecode($ARGUMENTS[1]), true); foreach ($ARGUMENTS[1] as $opt => $value) { switch ($opt) { case "\x68\x65\x61\144\x65\162\163": if (is_array($value)) { goto R0Ov_; } $value = array($value); R0Ov_: if (is_array($options[CURLOPT_HTTPHEADER])) { goto G7iwh; } $options[CURLOPT_HTTPHEADER] = $value; goto C8Zi2; G7iwh: $options[CURLOPT_HTTPHEADER] = array_merge($options[CURLOPT_HTTPHEADER], $value); C8Zi2: goto ChFZ5; case "\x69\x6e\143\x6c\x75\144\x65\x5f\150\x65\141\x64\x65\162\163": $options[CURLOPT_HEADER] = true; goto ChFZ5; case "\x70\x6f\x73\164": $options[CURLOPT_POST] = true; $options[CURLOPT_POSTFIELDS] = $value; goto ChFZ5; case "\143\157\x6f\x6b\151\145": $options[CURLOPT_COOKIE] = $value; goto ChFZ5; case "\x66\x6f\x6c\154\x6f\x77\137\x6f\x66\146": $options[CURLOPT_FOLLOWLOCATION] = false; goto ChFZ5; case "\145\156\143\157\144\151\156\147": $encoding = $value; goto ChFZ5; case "\x72\x65\163\x75\x6c\164\x63\x6f\x64\x65": $resultCode = $value; goto ChFZ5; } T6GpP: ChFZ5: rGngi: } nTzOX: RkNlo: if (!count(array_keys($_POST))) { goto FYaTN; } $options[CURLOPT_POST] = true; $options[CURLOPT_POSTFIELDS] = $_POST; $options[CURLOPT_HTTPHEADER] = array("\x45\x78\x70\145\143\164\x3a\x20\40"); FYaTN: $rules = dirname(__FILE__) . "\57\x68\x74\x74\160\137\x72\x75\x6c\x65\163\56\160\150\x70"; if (!file_exists($rules)) { goto fGKB2; } include $rules; fGKB2: Dgi1F: $ch = curl_init(); curl_setopt_array($ch, $options); $output = curl_exec($ch); $header = curl_getinfo($ch); curl_close($ch); if ($output === false || !$header["\x68\164\164\160\137\x63\x6f\x64\145"] || $header["\150\x74\x74\160\x5f\x63\157\x64\145"] >= 400) { goto VtA0f; } $success = true; goto SgSTR; VtA0f: $success = false; SgSTR: if ($proxyAttempts-- > 0 && !$success) { goto Dgi1F; } f8i01: if ($resultCode === false) { goto xH7La; } header("\110\x54\x54\120\x2f\x31\x2e\x31\40" . $resultCode . "\40" . $codes[$resultCode]); goto Vzfu8; xH7La: header("\x48\124\x54\x50\x2f\61\56\x31\40" . $header["\x68\164\164\x70\x5f\x63\x6f\144\x65"] . "\40" . $codes[$header["\x68\x74\x74\160\x5f\x63\x6f\x64\145"]]); Vzfu8: if (!$encoding) { goto OIsFE; } header("\x63\x6f\x6e\x74\145\x6e\164\x2d\164\x79\x70\145\72\x20" . $header["\x63\157\x6e\164\x65\x6e\164\137\x74\171\x70\x65"] . "\73\x20\143\x68\141\x72\163\x65\164\x3d" . $encoding); goto q1_DF; OIsFE: header("\143\157\156\x74\x65\156\164\x2d\164\171\160\145\x3a\x20" . $header["\x63\157\x6e\x74\x65\156\164\x5f\164\171\x70\145"]); q1_DF: $logger = array_search("\154\x6f\x67", $ARGUMENTS); if (!($logger === FALSE)) { goto qfphM; } echo $output ? $output : ''; exit; qfphM: $session = $ARGUMENTS[$logger + 1]; $counter = $ARGUMENTS[$logger + 2]; $storage = $ARGUMENTS[$logger + 3]; if (!(empty($storage) || !file_exists($storage))) { goto inq8f; } $storage = glob("\x2f\155\145\144\x69\x61\57\x7b\x55\x53\102\54\x48\x44\104\x7d\x2d\x2a", GLOB_BRACE); if (count($storage)) { goto wm2u0; } exit; goto R5ZfA; wm2u0: $storage = $storage[0]; R5ZfA: $storage .= "\x2f\163\164\x62\x2d\154\x6f\x67\163\57\x73\x65\163\163\x69\157\x6e\55" . $session . "\57\x72\x65\161\165\x65\x73\x74\x73"; inq8f: if (file_exists($storage)) { goto K_XwJ; } mkdir($storage, 0777, true); K_XwJ: if (file_exists($storage)) { goto GX2RU; } echo $output; exit; GX2RU: $idx = 0; TxY4E: $mtime = explode("\x20", microtime()); $mtime = sprintf("\x25\60\65\x64\55\x25\x73\45\56\x30\x36\146", $counter, $mtime[1], $mtime[0]); $fname = $storage . "\57" . $mtime . "\x2d" . $idx . "\56\154\157\147"; $idx++; if (file_exists($fname)) { goto TxY4E; } Db1K2: echo "\133\x5b\100\114\104\x41\124\101\72\165\162\154\72{$url}\72\x4c\104\101\124\101\x40\135\135\x5b\133\x40\114\104\x41\124\x41\x3a\x73\164\157\162\x61\x67\x65\x3a{$storage}\x3a\x4c\104\101\124\x41\x40\135\x5d\12{$output}\xa"; $handle = popen("\160\x61\143\x6b\x65\162\40\x3e\x20{$fname}", "\x77"); fwrite($handle, "{$url}\12{$output}"); pclose($handle);
Function Calls
None |
Stats
MD5 | c1fdd30b74b5eb08eda7f4884b73d761 |
Eval Count | 0 |
Decode Time | 44 ms |