Highly unlikely that you have a virus. Macs may get trojan horses if you open the flood gates, but normally it is the case of a bad proxy server setting, a bad installed system utility (you shouldn't install any other than a backup), or a hard drive that is too full. The hard drive should remain less than 85% full. Mackeeper is the worst utility of its kind. If you installed any other utility, contact the vendor for removal directions. If you setup Proxy server settings through Apple menu -> System Preferences -> network, remove them and any through your web browser settings. Clear cookies in web browser preferences for websites you don't have passwords you desire to keep.
Only install Adobe Flash from http://www.adobe.com/ and not any updater window.
Same with Java from http://www.java.com/ If you installed it from a separate window, go to their respective websites to replace the software over again.
Repair permissions with Applications -> Utilities -> Disk Utility.
If you leave your machine shut down, in energy saver, or the lid closed at night, try turning on screen saver instead of energy saver, and let the machine run its built-in logfile cleanup overnight with screen lid open.