Background
Search Engine Optimisation (SEO) is a term used to describe a variety of techniques that are used to boost the ranking of web pages in the results listing of search engines. These techniques are being abused by spammers and scammers to increase their own SEO web pages so that they appear high up in any search result. The resultant web page is used to display malicious content and automatically download and run malware on the user's computer.

More recently this approach has been augmented by the scammers running JavaScript within the user's browser to give the impression that a virus scan is occurring, which reports numerous viruses, trojans and spyware on the user's Mac. The purpose of these attacks is to scare the user into purchasing fake antivirus software. See
OSX.MacDefender

To prevent trojans such as MacDefender from being automatically downloaded and unpacked by Safari disable the
‘Open “safe”files after downloading’ option in the General Safari preferences.


Safari_prefs


Note: this will affect all downloads not just trojans!

How to prevent Safari from automatically opening files