I have a simple WordPress website for a local fitness club http://atanas-georgiev.com/ . I recently decided to check it out and see if anything is broken unfortunately its posts was hijacked with malicious script that inserted some link <a>
tags that was forwarding the user to difference sites.
I have saved the scripts before removing them and here are they.
https://gist.github.com/AdelinGhanaem/56db49f8d24e6f7f04c6
- I want to know how this could happen ?
- How can someone do it with XSS attacks ?
- How to prevent it from happening again ?
- Any WordPress plugins for security ?
If you have a VPS or dedicated server, then check your logs. Hopefully someone might have left a fingerprint somewhere. Or if you are using a shared host, then you can ask them to look into this for you.
Mostly this happens by having a weak password that could be found in dictionary. Just follow these steps for any new wordpress project and you will save a lot of headaches in the future.
capitalized, alpha numberic and special characters)
username. (by choosing admin as the username 50% of the effort is
reduced as he now only has to guess the password)
If it’s only in your posts, maybe consider to have a captcha for guests if they want to post to the site.
WordPress is very vulnerable to such attacks. There are a lot of things you can do to stop this. Some simple tips :
On the question of how it can happen the link above has an estimate of that:
platform
they were using
Plugins they were using
password