Solution:1
- Backup database and themes.
- Remove WordPress.
- Remove any suspicious files.
- Install newest WordPress.
- Keep new WordPress files write protected
- Slap so-called “administrator” for not updating on time.
- Profit.
No need for some crazy scripts and whatnot. Hacks on PHP cannot work unless the file is infected. Removing it solved the problem.
And yes, it’s possible to do even if you have multiple wordpress installations on the same server (WHY?!).