Is phishing or installing viruses, trojans, or other badware used a ranking factor by Google and other search engines? Yes, according to the following official statement:
“some examples of malicious behavior include: […] installing malware, trojans, spyware, ads or viruses on a user’s computer” source
Not only this tactic is strongly penalized by Google, but it’s illegal as well. In many cases, the websites are hacked to include bad content, without the owners knowing what’s happening.