当前位置:网站首页>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; } ?>
边栏推荐
- Control the operation of the test module through the panel in canoe (primary)
- Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
- Leetcode:608 tree node
- Write your own CPU Chapter 10 - learning notes
- CANoe仿真功能之自动化序列(Automation Sequences )
- A new understanding of RMAN retention policy recovery window
- Defensive C language programming in embedded development
- docker MySQL解决时区问题
- What you have to know about network IO model
- Constants and pointers
猜你喜欢
South China Technology stack cnn+bilstm+attention
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
如何让shell脚本变成可执行文件
Nc17 longest palindrome substring
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
51单片机进修的一些感悟
History of object recognition
大学C语言入门到底怎么学才可以走捷径
16 医疗挂号系统_【预约下单】
随机推荐
Contest3145 - the 37th game of 2021 freshman individual training match_ B: Password
[one click] it only takes 30s to build a blog with one click - QT graphical tool
美疾控中心:美国李斯特菌疫情暴发与冰激凌产品有关
Why data Tiering
16 医疗挂号系统_【预约下单】
CDC: the outbreak of Listeria monocytogenes in the United States is related to ice cream products
May brush question 26 - concurrent search
flask运维脚本(长时间运行)
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
May brush question 27 - figure
Flash operation and maintenance script (running for a long time)
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
There are software load balancing and hardware load balancing. Which one to choose?
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
I2C summary (single host and multi host)
May brush question 03 - sorting
面试突击62:group by 有哪些注意事项?
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
Solve the problem of too many small files
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]