当前位置:网站首页>简单解决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; } ?> 边栏推荐
- The replay block of canoe still needs to be combined with CAPL script to make it clear
- 为什么大学单片机课上51+汇编,为什么不直接来STM32
- Segmentation sémantique de l'apprentissage profond - résumé du code source
- Teach you how to write the first MCU program hand in hand
- Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
- Which is the better prospect for mechanical engineer or Electrical Engineer?
- Pointer learning
- A wave of open source notebooks is coming
- Several silly built-in functions about relative path / absolute path operation in CAPL script
- Cooperative development in embedded -- function pointer
猜你喜欢

Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)

Why can't TN-C use 2p circuit breaker?

Combined search /dfs solution - leetcode daily question - number of 1020 enclaves

五月集训总结——来自阿光

MapReduce instance (V): secondary sorting

CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
![[deep learning] semantic segmentation - source code summary](/img/2c/50eaef4a11fe2ee9c53a5cebdd69ce.png)
[deep learning] semantic segmentation - source code summary

C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library

112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx

Listen to my advice and learn according to this embedded curriculum content and curriculum system
随机推荐
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?
Competition vscode Configuration Guide
Control the operation of the test module through the panel in canoe (Advanced)
嵌入式中的合作开发--函数指针
Mexican SQL manual injection vulnerability test (mongodb database) problem solution
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
Regular expressions are actually very simple
五月刷题26——并查集
Why is 51+ assembly in college SCM class? Why not come directly to STM32
cmooc互联网+教育
51单片机进修的一些感悟
C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library
Hero League rotation map automatic rotation
May brush question 03 - sorting
Carolyn Rosé博士的社交互通演讲记录
大学C语言入门到底怎么学才可以走捷径
在CANoe中通过Panel面板控制Test Module 运行(高级)
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks
一大波開源小抄來襲
Constants and pointers