解码混淆的PHP源代码 [英] Decode obfuscated PHP source code
问题描述
如何将每个文件重写为可读代码?
例如,在源代码中有如下变量:
$ {\x47\x4c\x4f\x42\x41\x4cS} [y\x61 \x72 \x64s\ x70 \x71] =va\x6cu\x65;
如何将它转换为可读代码,例如:
$ somevariable =somevalue;
这不是UTF8,这只是一些想法以使脚本更不可读。您可以将每个字符串转换为其字符表示形式。例如 \x41
表示captial A。
您不必自己转换这些值。当你回显字符串时,它会显示它的实际值。
这些荣誉只是一个方法使用一个字符串值作为变量名,所以
$ {'foo'} = 10;
会将变量 $ foo
设置为10.
< pre> b
在这种情况下, <?php
// $ {\x47\x4c\x4f\x42\x41\x4cS} [y\x61\x72 \x64s\\ \\x70\x71] =va\x6cu\x65;
echo
'这意味着:'。
'$ {'。\x47\x4c\x4f\x42\x41\x4cS。
'} ['。y\x61 \x72 \x64s\x70\x71。'] ='。
va \x6cu\x65。';&br>';
// = $ GLOBALS ['yardspq'] ='value';
var_dump($ {\x47 \x4c\x4f\x42\x41\x4cS});
?>
How can I rewrite each file into readable code?
For example in the source code there's variables like this:
${"\x47\x4c\x4f\x42\x41\x4cS"}["y\x61\x72\x64s\x70\x71"]="va\x6cu\x65";
How can I convert that into readable code such as:
$somevariable = "somevalue";
That's not UTF8, that's just some obfuscation someone thought of to make the script less readable. You can convert every string to its character representation. For instance \x41
means 'captial A'.
You don't have to convert these values yourself. When you echo the string, it will show its actual value.
The accolades are just a way to use a string value for a variable name, so
${'foo'} = 10;
will set the variable $foo
to 10.
In your case, you got a script that's messing with your globals.
<pre><?php
//${"\x47\x4c\x4f\x42\x41\x4cS"}["y\x61\x72\x64s\x70\x71"]="va\x6cu\x65";
echo
'It means: ' .
'${"' . "\x47\x4c\x4f\x42\x41\x4cS" .
'"}["' . "y\x61\x72\x64s\x70\x71" . '"]="' .
"va\x6cu\x65" . '";<br>';
// = $GLOBALS['yardspq'] = 'value';
var_dump(${"\x47\x4c\x4f\x42\x41\x4cS"});
?>
这篇关于解码混淆的PHP源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!