当前位置:网站首页>Simple solution to phpjm encryption problem free phpjm decryption tool
Simple solution to phpjm encryption problem free phpjm decryption tool
2022-07-06 10:01:00 【Office template library material frog】
You may have seen several recent posts based on Empire CMS Developed templates , It's all done SEO Optimized processing template , I bought another one recently , But when scanning the back door, I found that many files were encrypted , It's encrypted phpjm encryption
See more about phpjm encryption The article , There is no problem when using , But in order to check whether there is a back door or decrypt .
I searched the Internet , Found most of phpjm Decrypt See more about phpjm Decrypt The tools of the article are all charged , But it's not expensive , But I used to see this way of encrypting files , Or study whether there is a once and for all solution phpjm Encryption method ? So I found this free in Baidu phpjm Decrypt See more about phpjm Decrypt Article code .
The way to use it is to run the decrypted file through the browser , Then a decrypted php file .
< !--?php $file = 'phpjm.php'; // The file name to decrypt $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); // Last version $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; } ?> 边栏推荐
- Canoe CAPL file operation directory collection
- South China Technology stack cnn+bilstm+attention
- Docker MySQL solves time zone problems
- 一大波开源小抄来袭
- What are the models of data modeling
- I2C summary (single host and multi host)
- 14 医疗挂号系统_【阿里云OSS、用户认证与就诊人】
- Automation sequences of canoe simulation functions
- 单片机如何从上电复位执行到main函数?
- Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)
猜你喜欢

一大波开源小抄来袭

CAPL 脚本对.ini 配置文件的高阶操作

嵌入式開發中的防禦性C語言編程

面试突击62:group by 有哪些注意事项?

Docker MySQL solves time zone problems

The programming ranking list came out in February. Is the result as you expected?

一大波開源小抄來襲
![[flask] crud addition and query operation of data](/img/fc/7a12ede31befed5f42b32b94ae5ecf.jpg)
[flask] crud addition and query operation of data

PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
![17 medical registration system_ [wechat Payment]](/img/b4/f9abfa0fb0447d727078069d888b57.png)
17 medical registration system_ [wechat Payment]
随机推荐
[untitled]
Function description of shell command parser
Target detection -- yolov2 paper intensive reading
VH6501学习系列文章
Listen to my advice and learn according to this embedded curriculum content and curriculum system
How can I take a shortcut to learn C language in college
手把手教您怎么编写第一个单片机程序
cmooc互联网+教育
There are software load balancing and hardware load balancing. Which one to choose?
Which is the better prospect for mechanical engineer or Electrical Engineer?
嵌入式开发比单片机要难很多?谈谈单片机和嵌入式开发设计经历
颜值爆表,推荐两款JSON可视化工具,配合Swagger使用真香
May brush question 26 - concurrent search
Redis集群方案应该怎么做?都有哪些方案?
PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
tn-c为何不可用2p断路器?
oracle sys_ Context() function
Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable
Some thoughts on the study of 51 single chip microcomputer
Tianmu MVC audit II