当前位置:首页 > PHP教程 > PHP高级教程

微盾PHP脚本加密专家php解密算法

复制代码 代码如下:

<?php
/***********************************
*威盾php加密专家解密算法 by:neeao
*http://neeao.com
*2009-09-10
***********************************/

$filename="play-js.php";//要解密的文件
$lines = file($filename);//0,1,2行

//第一次base64解密
$content="";
if(preg_match("/o0o0000o0('.*')/",$lines[1],$y))
{
$content=str_replace("o0o0000o0('","",$y[0]);
$content=str_replace("')","",$content);
$content=base64_decode($content);
}
//第一次base64解密后的内容中查找密钥
$decode_key="";
if(preg_match("/),'.*',/",$content,$k))
{
$decode_key=str_replace("),'","",$k[0]);
$decode_key=str_replace("',","",$decode_key);
}
//查找要截取字符串长度
$str_length="";
if(preg_match("/,d*),/",$content,$k))
{
$str_length=str_replace("),","",$k[0]);
$str_length=str_replace(",","",$str_length);
}
//截取文件加密后的密文
$secret=substr($lines[2],$str_length);
//echo $secret;

//直接还原密文输出
echo "<?phpn".base64_decode(strtr($secret,$decode_key,'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/'))."?>";
?>

微盾php脚本破解
复制代码 代码如下:

<?php
function get_filetree($path){
$tree = array();
foreach(glob($path . '/*') as $single){
if(is_dir($single)){
$tree = array_merge($tree,get_filetree($single));
} else {
$tree[] = $single;
}
}
return $tree;
}
function eval_decode($file)
{
$lines = file($file);
$content;
if(preg_match("/o0o0000o0('.*')/", $lines[1], $s)){
$content = str_replace("o0o0000o0('", "", $s[0]);
$content = str_replace("')", "", $content);
$content = base64_decode($content);
} else {
return "file not encode!";
}
$key;
if(preg_match("/),'.*',/", $content, $k)){
$key = str_replace("),'", "", $k[0]);
$key = str_replace("',", "", $key);
} else {
return "not decode key!";
}
$length;
if(preg_match("/,d*),/", $content, $k)){
$length = str_replace("),", "", $k[0]);
$length = str_replace(",", "", $length);
} else {
return "not decode base64 string!";
}
$secret = substr($lines[2], $length);
$decode = "<?php".base64_decode(strtr($secret,$key,'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/')) ."?>";
file_put_contents($file, $decode);
return "file decode success!";
}

$filelist = get_filetree("d:/phpnow/htdocs/1");
foreach($filelist as $value){
echo $value." :tt".eval_decode($value) . "nr<br>";
}
?>

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!