当前位置:网站首页>简单解决phpjm加密问题 免费phpjm解密工具
简单解决phpjm加密问题 免费phpjm解密工具
2022-07-06 09:08:00 【办公模板库 素材蛙】
你们可能看到了最近发了几个基于帝国CMS开发的模板,都是些做了SEO优化处理的模板,最近又买了一个,但是在扫描后门的时候发现很多文件加密了,加密方式是phpjm加密
查看更多关于 phpjm加密 的文章,使用的时候是没问题的,但是为了查看是否有后门还是解密看看。
在网上搜了下,发现大部分phpjm解密 查看更多关于 phpjm解密 的文章的工具都是收费的,不过也不贵,但是想着以前也经常看到这种方式的加密文件,要不研究下有没有一劳永逸的解决phpjm加密方式的办法?于是在百度找到了这个免费phpjm解密 查看更多关于 phpjm解密 的文章代码。
使用方法就是通过浏览器运行此解密文件,然后就会会生成一个解密的php文件。
< !--?php $file = 'phpjm.php'; //要解密的文件名 $fp = fopen($file, 'r'); $str = fread($fp, filesize($file)); fclose($fp); copy($file, '0_'.$file); $n = 1; while($n < 10){ $code = strdecode($str); if($n == 1){ $code = str_replace("__FILE__", "'0_$file'", $code); } $replace = '$decode'.$n.'=trim'; if(strpos($code, 'eval(') > 0){ $code = str_replace('eval(', $replace.'(', $code); }else{ preg_match("/@$(.*)($(.*),(.*)(/isU", $code, $res); $code = str_replace($res[3], "'$replace", $code); } $code = preg_replace('/$(.*)=false;(.*?)();/', '', $code); //上一版本 $code = preg_replace('/||@$(.*?)();/', '|| print("ok");', $code); $code = destr($code); $tmp_file = 'detmp'.$n.'.php'; file_put_contents($tmp_file, $code); include($tmp_file); $val = 'decode'.$n; $str = $$val; unlink($tmp_file); if(strpos($str, ';?-->') === 0){
$decode = $str;
break;
}
$str = "< !--?phprn". $str; $n++; } $decode = preg_replace("/^(.*)exit('Access Denied'); /", "<?phprn", $decode); $del = strrchr($decode, 'unset'); $decode = str_replace($del, "rn?-->", $decode);
file_put_contents($file.'.de.php' ,$decode);
unlink('0_'.$file);
echo 'done';
function val_replace($code, $val, $deval){
$code = str_replace('$'.$val.',', '$'.$deval.',', $code);
$code = str_replace('$'.$val.';', '$'.$deval.';', $code);
$code = str_replace('$'.$val.'=', '$'.$deval.'=', $code);
$code = str_replace('$'.$val.'(', '$'.$deval.'(', $code);
$code = str_replace('$'.$val.')', '$'.$deval.')', $code);
$code = str_replace('$'.$val.'.', '$'.$deval.'.', $code);
$code = str_replace('$'.$val.'/', '$'.$deval.'/', $code);
$code = str_replace('$'.$val.'>', '$'.$deval.'>', $code);
$code = str_replace('$'.$val.'<', '$'.$deval.'<', $code);
$code = str_replace('$'.$val.'^', '$'.$deval.'^', $code);
$code = str_replace('$'.$val.'||', '$'.$deval.'||', $code);
$code = str_replace('($'.$val.' ', '($'.$deval.' ', $code);
return $code;
}
function fmt_code($code){
global $vals,$funs;
preg_match_all("/$[0-9a-zA-Z[]']+(,|;)/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('$',',',';'), '', $v);
$deval = destr($val, 1);
$vals[$val] = $deval;
$code = val_replace($code, $val, $deval);
}
preg_match_all("/$[0-9a-zA-Z[]']+=/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('$','='), '', $v);
$deval = destr($val, 1);
$vals[$val] = $deval;
$code = val_replace($code, $val, $deval);
}
preg_match_all("/functions[0-9a-zA-Z[]]+(/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('function ','('), '', $v);
$deval = destr($val, 1);
$funs[$val] = $deval;
$code = str_replace('function '.$val.'(', 'function '.$deval.'(', $code);
$code = str_replace('='.$val.'(', '='.$deval.'(', $code);
$code = str_replace('return '.$val.'(', 'return '.$deval.'(', $code);
}
return $code;
}
function strdecode($str){
$len = strlen($str);
$newstr = '';
for($i=0; $i<$len; $i++){ $n = ord($str[$i]); $newstr .= decode($n); } return $newstr; } function decode($dec){ if(($dec > 126 || $dec<32) && $dec<>13 && $dec<>10){
return '['.$dec.']';
}else{
return chr($dec);
}
}
function destr($str, $val=0){
$k = 0;
$num = '';
$n = strlen($str);
$code = '';
for($i=0; $i<$n; $i++){ if($str[$i] == '[' && ($str[$i+1]==1 || $str[$i+1]==2)){ $k = 1; }elseif($str[$i] == ']' && $k==1){ $num = intval($num); if($val==1){ $num = 97 + fmod($num, 25); } $code .= chr($num); $k = 0; $num = null; }else{ if($k == 1){ $num .= $str[$i]; }else{ $code .= $str[$i]; } } } return $code; } ?>
边栏推荐
- [CV] target detection: derivation of common terms and map evaluation indicators
- Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
- 单片机如何从上电复位执行到main函数?
- Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
- If a university wants to choose to study automation, what books can it read in advance?
- 手把手教您怎么编写第一个单片机程序
- 零基础学习单片机切记这四点要求,少走弯路
- [one click] it only takes 30s to build a blog with one click - QT graphical tool
- NLP路线和资源
- Hard core! One configuration center for 8 classes!
猜你喜欢
What are the models of data modeling
宝塔的安装和flask项目部署
五月集训总结——来自阿光
Control the operation of the test module through the panel in canoe (Advanced)
在CANoe中通过Panel面板控制Test Module 运行(初级)
Redis distributed lock implementation redison 15 questions
Carolyn Rosé博士的社交互通演讲记录
Oom happened. Do you know the reason and how to solve it?
If a university wants to choose to study automation, what books can it read in advance?
History of object recognition
随机推荐
51单片机进修的一些感悟
cmooc互联网+教育
零基础学习单片机切记这四点要求,少走弯路
CANoe CAPL文件操作目录合集
MapReduce instance (IX): reduce end join
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
May brush question 03 - sorting
Function description of shell command parser
宝塔的安装和flask项目部署
大学想要选择学习自动化专业,可以看什么书去提前了解?
AI的路线和资源
17 医疗挂号系统_【微信支付】
CAPL script pair High level operation of INI configuration file
flask运维脚本(长时间运行)
C杂讲 文件 初讲
Regular expressions are actually very simple
Hugo blog graphical writing tool -- QT practice
Une grande vague d'attaques à la source ouverte
There are software load balancing and hardware load balancing. Which one to choose?
[untitled]