Solved

Word Press - Someone wrote to index.php

Posted on 2015-02-07
6
89 Views
Last Modified: 2015-02-09
I was visiting a website I created in WordPress.  When I went to www.mywebsite.com, I got this javascript alert:
"your site may be victim of hackers we offer a solution can contact us sebastiano.gz123@gmail.com"

after downloading the site files, I see that index.php has been physically changed to include this code at the very top:
<script>
alert('your site may be victim of hackers we offer a solution can contact us sebastiano.gz123@gmail.com')
</script>

I removed it and the site is back to normal.

What I'm wondering is, how can someone write to index.php?  Are there security settings I should've been aware of?
I'm using a theme I made - only the second one I've ever done, but I don't know how that would open up WordPress to a hacker.

No other sites on my server seem to be affected (including WordPress sites).

Any suggestions on things I can do to make sure this hack doesn't happen again?  I'm sure it will...

Thanks!
0
Comment
Question by:slightlyoff
  • 3
  • 2
6 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 250 total points
ID: 40596307
What I'm wondering is, how can someone write to index.php?  Are there security settings I should've been aware of?

Sort of.  What happened is your hosting is compromised or you have vulnerability in a plugin or theme file that is being exploited.

I've written an in-depth article on this:

http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_10806-Recovering-From-and-Preventing-WordPress-Site-Hacks.html
0
 
LVL 7

Assisted Solution

by:Alicia St Rose
Alicia St Rose earned 250 total points
ID: 40597814
You might want to sign up for Sucuri.net services. They are WordPress friendly! They will monitor your site and stamp out anything they find right when it's starts to happen.

They got rid of some crazy Viagra links that wouldn't die from one of my client's sites.
0
 
LVL 1

Author Closing Comment

by:slightlyoff
ID: 40598319
Thank you for the help!  I'll take a look at Securi - I downloaded and installed the plugin so we'll see how that goes.
I appreciate the info as well!
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40598424
Sucuri's plugin does very little by itself.  You would be better off with WordFence...
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 40598430
I'll take a look at that one as well.  Thanks for the heads up.  I might use the service Sucuri offers as well - but being that this was my first theme - I wanted to really know what I missed (if it's my theme that's causing the leak)...  very annoying.  

Thanks again for the help!!!
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40598448
Might be your theme, but if you hand-coded it yourself then it's more likely a plugin or a folder/file permission set too high. If you altered an existing theme, it might be there.

If you are willing to pay for Sucuri's service, then the plugin and the service get a lot more awesome.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question