1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <?php function decode($filename){ $lines = file($filename);
if(preg_match("/O0O0000O0\('.*'\)/",$lines[1],$y)){ $content=""; if(preg_match("/O0O0000O0\('.*'\)/",$lines[1],$y)) { $content=str_replace("O0O0000O0('","",$y[0]); $content=str_replace("')","",$content); $content=base64_decode($content); } $decode_key=""; if(preg_match("/\),'.*',/",$content,$k)) { $decode_key=str_replace("),'","",$k[0]); $decode_key=str_replace("',","",$decode_key); } $str_length=""; if(preg_match("/,\d*\),/",$content,$k)) { $str_length=str_replace("),","",$k[0]); $str_length=str_replace(",","",$str_length); } $Secret=substr($lines[2],$str_length);
file_put_contents($filename, "<?php\n" . base64_decode(strtr( $Secret, $decode_key, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' )) ."?>"); } }
function file_list($path) { $files = array(); if(is_dir($path)){ if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($path."/".$file)){ file_list($path."/".$file); }else{ $fileType = pathinfo($file, PATHINFO_EXTENSION); if($fileType == "php"){ $realpath = $path. "/" .$file; echo "success!file decoding:" .$realpath. "<br>"; decode($realpath); } } } } closedir($handle); } } }
$mulu = $_REQUEST['dir']; file_list($mulu); ?>
|