当前位置:网站首页>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; } ?> 边栏推荐
- C杂讲 文件 初讲
- Une grande vague d'attaques à la source ouverte
- Several ways of MySQL database optimization (pen interview must ask)
- C杂讲 文件 续讲
- Control the operation of the test module through the panel in canoe (primary)
- 华南技术栈CNN+Bilstm+Attention
- June brush question 01 - array
- The governor of New Jersey signed seven bills to improve gun safety
- [NLP] bert4vec: a sentence vector generation tool based on pre training
- Vh6501 Learning Series
猜你喜欢

Solve the problem of too many small files

Selection of software load balancing and hardware load balancing

C杂讲 动态链表操作 再讲

Hero League rotation chart manual rotation

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

Redis distributed lock implementation redison 15 questions

Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work

What are the models of data modeling

Control the operation of the test module through the panel in canoe (Advanced)

Counter attack of noodles: redis asked 52 questions in a series, with detailed pictures and pictures. Now the interview is stable
随机推荐
Solve the problem of too many small files
Some thoughts on the study of 51 single chip microcomputer
嵌入式中的合作开发--函数指针
Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
The 32-year-old fitness coach turned to a programmer and got an offer of 760000 a year. The experience of this older coder caused heated discussion
What you have to know about network IO model
手把手教您怎么编写第一个单片机程序
Regular expressions are actually very simple
CAPL script pair High level operation of INI configuration file
Yarn organizational structure
在CANoe中通过Panel面板控制Test Module 运行(初级)
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
Can I learn PLC at the age of 33
[deep learning] semantic segmentation: thesis reading (neurips 2021) maskformer: per pixel classification is not all you need
I2C summary (single host and multi host)
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
Delayed note learning
Cmooc Internet + education
CANoe不能自动识别串口号?那就封装个DLL让它必须行
Vh6501 Learning Series