Spyware can be installed on a computer by a computer virus, by an e-mail trojan such as the United States FBI's Magic Lantern program, or may be hidden within the otherwise-innocuous installation a new program.
Data collecting programs installed with the user's knowledge are not, properly speaking, spyware, if the user fully understands what data is being collected and with whom it is being shared. The HTTP cookie is a well-known mechanism for storing information about an Internet user on their own computer. However, the existence of cookies and their use is generally not concealed from users, who can also disallow access to cookie information. Nevertheless, to the extent that a Web site stores information in a cookie that the user is unaware of, the cookie mechanism could be considered a form of spyware.
See also adware.
A number of software applications are available to help computer users search for and remove spyware programs.