As desktops become more secure, spammers are hacking poorly secured websites. They then “game” search-engine results so their pages appear at the top of search lists, letting them make money through advertising.