Published May 12, 2023Updated Jun 5, 2023
Contribute to Docs

Malware is malicious software that is intentionally designed to infiltrate, harm, or disable computer systems, networks, and devices. Depending on the malware’s objective, the effect of malware can vary, ranging from data to financial theft or sabotaging the system’s accessibility.

Types of Malware

There are different types of malware for different objectives, some of which are:

  • A virus attaches itself to other programs and replicates once installed.
  • Spyware monitors user activities and reports back to the author.
  • Adware is designed to show advertisements to trick users into installing malicious software.
  • Ransomware is designed to lock and encrypt files to force the user into paying a ransom to regain access.
  • Trojans, the most dangerous type of malware, designed to be disguised as legitimate software, can steal financial information or install other types of malware.
  • Worms are similar to viruses. They are self-replicating but have the ability to spread across systems on their own.
  • Keyloggers record user keystrokes, capturing data, and reporting it back to the author.
  • Rootkits provide the author with “root” access while remaining hidden from the user, other software, and the operating system itself.

Countermeasures to Avoid Malware

  • Update the operating system and security software when possible; outdated software may contain vulnerabilities which makes it easier for the device to get infected.
  • Never click links that are found on suspicious popups or websites, especially those that offer free access to paid programs.
  • Never leave a device unattended and unlocked in a public place; applications disguised as spyware can be installed without the user’s knowledge.
  • Beware of emails that appear to be from service providers such as banking institutions, Netflix, Microsoft, GMail, and wireless carriers with whom the user may have an account and request the user click a link to update the password or regain access to the account. It is recommended to visit the official website and log in from there.
  • Only purchase and download software and programs from official websites or retail stores. Do not download from suspicious sites offering paid programs for free, as they may contain malware.


Adware is software that displays unwanted (and sometimes irritating) pop-up adverts which can appear on a computer or mobile device.
Keyloggers are a type of computer malware that records keystroke events on the keyboard and saves them to a log file, allowing the theft of sensitive data like passwords.
Ransomware is a cyber-attack that blocks and prevents a user from accessing important files or personal data that is located on a device or computer.
A Rootkit is a program, or a collection of software tools, that covertly grants cybercriminals the ability to gain remote access on a targeted computer or system.
Spyware is malicious software designed to gather personal data from a device in order to send it to other third-party apps or companies without consent from the user.
Disguises itself as a legitimate application to trick users into installing it, thus taking control of over their computer and other devices.
A virus is a type of malware that can infect a system.

All contributors

Looking to contribute?

Learn Cybersecurity on Codecademy