当前位置:网站首页>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; } ?>
边栏推荐
- Defensive C language programming in embedded development
- Vh6501 Learning Series
- MySQL ERROR 1040: Too many connections
- 再有人问你数据库缓存一致性的问题,直接把这篇文章发给他
- Safety notes
- The programming ranking list came out in February. Is the result as you expected?
- The governor of New Jersey signed seven bills to improve gun safety
- June brush question 02 - string
- Southwest University: Hu hang - Analysis on learning behavior and learning effect
- Can I learn PLC at the age of 33
猜你喜欢
Redis distributed lock implementation redison 15 questions
Southwest University: Hu hang - Analysis on learning behavior and learning effect
A wave of open source notebooks is coming
手把手教您怎么编写第一个单片机程序
华南技术栈CNN+Bilstm+Attention
Programmation défensive en langage C dans le développement intégré
cmooc互联网+教育
33岁可以学PLC吗
大学想要选择学习自动化专业,可以看什么书去提前了解?
[NLP] bert4vec: a sentence vector generation tool based on pre training
随机推荐
嵌入式开发比单片机要难很多?谈谈单片机和嵌入式开发设计经历
51单片机进修的一些感悟
Can I learn PLC at the age of 33
C杂讲 动态链表操作 再讲
The 32 year old programmer left and was admitted by pinduoduo and foreign enterprises. After drying out his annual salary, he sighed: it's hard to choose
flask运维脚本(长时间运行)
vscode 常用的指令
Embedded development is much more difficult than MCU? Talk about SCM and embedded development and design experience
May brush question 03 - sorting
颜值爆表,推荐两款JSON可视化工具,配合Swagger使用真香
Cooperative development in embedded -- function pointer
Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
AI的路线和资源
Competition vscode Configuration Guide
CANoe不能自动识别串口号?那就封装个DLL让它必须行
美新泽西州州长签署七项提高枪支安全的法案
Carolyn Rosé博士的社交互通演讲记录
嵌入式开发中的防御性C语言编程
33岁可以学PLC吗