Copy Code code as follows:
<?php
/***********************************
* Granville Shield PHP encryption expert decryption algorithm BY:NEEAO
*http://neeao.com
*2009-09-10
***********************************/
$filename = "play-js.php";//Files to decrypt
$lines = file ($filename);//0,1,2 Line
The first time Base64 decryption
$content = "";
if (Preg_match ("/o0o0000o0\" ('. * ')/", $lines [1], $y))
{
$content =str_replace ("O0o0000o0", "", $y [0]);
$content =str_replace ("')", "", $content);
$content =base64_decode ($content);
}
Find the key in the first Base64 decrypted content
$decode _key= "";
if (Preg_match ("/\"), '. * ',/', $content, $k))
{
$decode _key=str_replace ("), '", "", $k [0]);
$decode _key=str_replace ("',", "", $decode _key);
}
Find the length of the string to intercept
$str _length= "";
if (Preg_match ("/,\d*\),/", $content, $k))
{
$str _length=str_replace ("),", "", $k [0]);
$str _length=str_replace (",", "", $str _length);
}
Encrypted ciphertext after intercepting the file
$Secret =substr ($lines [2], $str _length);
Echo $Secret;
Direct Restore ciphertext output
echo "<?php\n". Base64_decode (Strtr ($Secret, $decode _key, ' abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/')). "? > ";
?>
Micro Shield PHP script hack
Copy Code code as follows:
<?php
function Get_filetree ($path) {
$tree = Array ();
foreach (Glob ($path. '/* ') as $single) {
if (Is_dir ($single)) {
$tree = Array_merge ($tree, Get_filetree ($single));
} else {
$tree [] = $single;
}
}
return $tree;
}
function Eval_decode ($File)
{
$Lines = file ($File);
$Content;
if (Preg_match ("/o0o0000o0\"/", $Lines [1], $S)) {
$Content = Str_replace ("O0o0000o0", "", $S [0]);
$Content = Str_replace ("')", "", $Content);
$Content = Base64_decode ($Content);
} else {
Return ' File not encode! ';
}
$Key;
if (Preg_match ("/\"), '. * ',/', $Content, $K)) {
$Key = Str_replace ("), '", "", $K [0]);
$Key = Str_replace ("',", "", $Key);
} else {
Return ' not decode key! ';
}
$Length;
if (Preg_match ("/,\d*\),/", $Content, $K)) {
$Length = Str_replace ("),", "", $K [0]);
$Length = Str_replace (",", "", $Length);
} else {
Return ' not decode Base64 string! ';
}
$Secret = substr ($Lines [2], $Length);
$Decode = "<?php". Base64_decode (Strtr ($Secret, $Key, ' abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/')). "? > ";
File_put_contents ($File, $Decode);
Return "file decode success!";
}
$filelist = Get_filetree ("D:/PHPNOW/HTDOCS/1");
foreach ($filelist as $value) {
echo $value. ": \t\t". Eval_decode ($value). "\n\r<br>";
}
?>