Fake Apple warnings
When using Safari I have started being switched from the web page that I am visiting to a page that looks like the Apple home page containing a warning that my iMac has been infected and a timer appears for me to take action by clicking a link to possible solutions. The web address of this new page is a combination of numbers and letters and does not contain Apple.inc. and is not a pop-up. I am sure that this is some sort of scam, but cannot seem to stop it happening. I have Sophos antivirus running but this has not found anything. I am thinking of returning the Mac to Factory Settings, hoping that this will cure the problem, but would like a less drastic solution.
Any ideas?
iMac, OS X El Capitan (10.11.6)