Anybody know ow he did it?
Download your entire public/www folder to your PC (including databases) and you need to make a comparison from your backup files, assuming you have clean versions. That's a first step. This will potentially reveal compromised files, shell scripts and some database injections, if any.
If above turns out clean, you might not be hacked in the common terms, as CONEJO explained above, look for holes in your server access (FTP, terminal, passwords...), also running other scripts/CMS will open your sites/server to their vulnerabilities, too.
Unfortunately, not an easy task, it requires time and knowledge.