Many early infectious programs, including the first Internet Worm, were written as experiments or pranks.
Programs designed to monitor users' web browsing, display unsolicited advertisements, or redirect affiliate marketing revenues are called spyware.