What Is Malware and How Does It Work?

Malware — a portmanteau of malicious and software — is a blanket term for all harmful software designed to affect an electronic device’s normal behavior. Malware can infect all different types of computing devices. Personal computers (Macs included), smartphones, tablets, servers, and more. Basically, if a device has computing capabilities, it can become infected with malware.

How does malware work?

Different types of malware work in different ways, but in general, malware will infect a device by tricking a user into clicking on and/or installing a malicious program. Upon installation, malware may perform many malicious actions including:

  • Installing additional malicious programs.
  • Hogging computing resources, slowing down the system.
  • Covertly capturing keystrokes (to steal passwords and other sensitive data).
  • Restricting a user’s ability to access files, folders, or even the entire system.
  • Replicating itself on the infected device.
  • Spamming a browser or desktop with non-stop ads.
  • Deleting necessary components, rendering a device 100% unusable.

The above list is by no means exhaustive, however. Malware creators are always looking for new ways to inflict harm on users.

What are the different types of malware?

There are lots of different types of malware, including:


All viruses spread the same way — by infecting clean files and then spreading to other clean files. A virus can quickly spread uncontrollably and render an entire system unusable by deleting or corrupting all files and folders.

You may be wondering “what’s the difference between a virus and malware?” Well, a virus is just one type of malware. So, all viruses are malware, but not all malware are viruses.

We also have a whole series on viruses that you’re sure to enjoy, too!


A worm is similar to a virus, but it does not need a host computer to function. A worm can travel through an entire network, replicating itself and infecting increasing numbers of devices as it spreads.

Worms exploit vulnerabilities in security software to steal sensitive information, corrupt files, install backdoors, and cause harm in many other ways.

Trojan horses

A Trojan horse is a type of malware that misleads users of its true intent by disguising itself as a legitimate program. Unlike viruses and worms, Trojan horses can’t replicate themselves ­— they need to be installed by users.

Trojan horses are often hidden as email attachments or offered as free-to-download files. Once a user unknowingly installs the nefarious program, its malicious code will run and it will perform whatever task it has been designed for.


Spyware, as you may have guessed, allows cybercriminals to spy on their victims. This type of malware allows criminals to access their victims’ personal information, including usernames, passwords, keystrokes, and lots more.


Compared to other types of malware, adware is the least harmful, but it is still malicious. Adware causes ads to be displayed on victims’ devices, generating revenue for the attacker.

Although it is comparatively less harmful, adware frequently comes bundled with other forms of malware and the ads it generates can often present an easy way for other malware to infect a system.


Although not technically malware, botnets can be devastating. A botnet is a network of infected computers working together under the control of a cybercriminal. They are used to commit distributed denial of service (DDoS) attacks on websites and other systems.

Looking to read more about malware?

Great! We’ve got lots of other awesome content on the site about malware (and other super interesting topics)! You can check out our other articles about malware below:

Famous Malware Attacks
How to Prevent and Remove Malware
How to Detect Malware on iPhone