On a wordpress site a malformed div tag and a link to thepiratebay.in.ua are being inserted through some kind of attack.
The inserted code is:
div style="position:absolute;top:-1488px;"><a href="http://thepiratebay.in.ua">torrents,pirate,piratebay,software torrents,porn,porn download</a>
On a clone of the site, I have switched from the current theme to the default theme and I have also disabled all of the active plugins, but the problem persists.
grep’ing all the site files for ‘porn’ or ‘piratebay’ finds nothing and the same is true for searching the database. The insertion happens after the completion of the footer, in the middle of loading the scripts at the bottom of the <body>
tag.
The attack also seems to have allowed eastern europeaan spammers to send mail as in:
Tylko spojrzcie jak ten dran zarabia!
Has anyone seen this? Or have suggestions on next steps for remediating?
Thanks
I suffered the exact same problem and just got it solved. Check you index.php
Mine was modified a few days ago and comparing to other wordpress installations I saw it had these extra lines at the beggining:
To check the last modified files I run:
(96 is for 4 days)
I just removed the lines and the div was gone!
I hope it solves it for you too.
Edit: Btw I had big mailing problems last days, I was attacked by a backscatter, sending hundreds of misdirected bounces every hour and my Ip was in 15 blacklists at MxToolBox. I don’t know if that was the cause but fortunately it’s now solved. So If I were you I’d check your Ip there or in a similar page.
First, check the entire WP install to see which were the most recent files updated. That would be where you start looking. Often the code is encrypted, which is why you can’t find it using grep. Look for something like:
Try grep’ing for “eval” or “base64_decode”.
Often this code is inserted into the functions.php file, or your theme’s footer. You can test that by activating another theme. Also, try disabling all the plugins and see if that eventually removes the code.
This is a handy guide for resolving and prevention:
http://codex.wordpress.org/FAQ_My_site_was_hacked
Google each plugin name followed by vulnerability. I had a similar issue where the attackers came in through a plugin.