In fact, you will know when your website has been hacked if it does not look like usual, your browser tells you your website is 'phishing' or if Google warns you when clicking on your website in the search engine. The symptoms below are frequent, but not all:
- There is an unknown piece of JavaScript in one of your pages.
- There is an unknown 'iframe' in one of your pages.
- There is a virus notification upon visiting one of your pages.
- There is a phishing notification when visiting your website.
- Your website is marked as 'unsafe' at Google.
- All your files have been removed or replaced with malicious content.
Do note that there is a difference between a virus, a hacker, or that someone else has the credentials and abused them. Unfortunately, this difference is hard to detect.
If you are sure that this is someone you know, change the credentials immediately and wonder whether you want to grant this person access again. In all other cases, you can follow a safe restoration procedure.