Malware Types

28/10/2023

🦠 What is Malware?

Malware, short for malicious software, is an umbrella term for any kind of software intentionally developed to infiltrate, damage, or disable computers, systems, or networks without the user's informed consent. Its objectives may include data theft, system disruption, spying, extortion, or unauthorized access. Malware can range from simple nuisances to sophisticated tools crafted by state actors.

📚 In-Depth Breakdown of Major Malware Types

1. Viruses

A virus is a form of malware that requires a host file to function. It's often embedded in a legitimate program or file and activated only when that file is executed. Upon activation, it replicates itself by modifying other programs and inserting its own code. The virus may remain dormant until specific conditions are met (like a date or user action), after which it executes its payload.

Damage caused by viruses can include file corruption, system crashes, or unauthorized data modifications. For example, the infamous ILOVEYOU virus, sent as an email attachment in 2000, disguised itself as a love letter. When opened, it overwrote important files and emailed itself to all contacts, infecting millions of computers globally.

Modern viruses are rare compared to other forms of malware due to improved operating system design, but they remain relevant, especially in offline systems or less-protected environments.

2. Worms

Unlike viruses, worms are standalone programs that self-replicate and spread without requiring a host file or human interaction. They typically exploit vulnerabilities in operating systems or network services. Once inside a system, a worm may scan for other vulnerable systems and replicate itself across networks.

A particularly destructive example was Stuxnet, a worm discovered in 2010. Believed to be developed by U.S. and Israeli intelligence, Stuxnet targeted SCADA (Supervisory Control and Data Acquisition) systems in Iran's nuclear facilities, causing physical damage to centrifuges by altering their spin rates while reporting normal operation.

Worms are dangerous because of their speed and scalability. A single worm can infect hundreds of thousands of devices within hours if the vulnerability is unpatched and unmitigated.

3. Trojans (Trojan Horses)

Named after the myth of the Trojan Horse, Trojans are malicious programs that disguise themselves as legitimate or desirable software. Unlike viruses and worms, Trojans don't replicate themselves. Instead, they rely on social engineering to trick users into installing them.

Once inside the system, a Trojan can perform a wide range of actions, depending on its design: it may open a backdoor for remote attackers, steal data, install additional malware, or disable security mechanisms. Remote Access Trojans (RATs) are a subtype that give attackers complete control over the infected system.

For instance, Emotet began as a banking Trojan and later evolved into a malware loader, facilitating the deployment of ransomware and information stealers across corporate networks.

Trojans often masquerade as:

  • Cracked software or game installers

  • Fake antivirus programs

  • Software updates

  • Spear-phishing email attachments

4. Ransomware

Ransomware is a highly destructive type of malware that encrypts a victim's data or locks access to the system, then demands payment (typically in cryptocurrency) in exchange for the decryption key or restored access.

There are two primary types:

  • Crypto-ransomware, which encrypts files.

  • Locker-ransomware, which locks access to the computer itself.

The WannaCry ransomware, which surfaced in 2017, infected over 200,000 computers across 150 countries in a single day by exploiting the SMB vulnerability EternalBlue. Victims included hospitals, banks, and public infrastructure.

Ransomware is one of the most financially damaging types of malware today, often deployed via phishing or exploit kits, and frequently targeting critical infrastructure, education, and healthcare sectors.

Modern ransomware attacks often include double extortion tactics: after encrypting data, attackers threaten to leak sensitive files unless payment is made.

5. Spyware

Spyware covertly collects information about a user or organization without their knowledge or consent. It monitors activities, tracks keystrokes, records browsing behavior, and can capture screenshots or webcam feeds.

This type of malware is used by:

  • Cybercriminals, for identity theft or financial gain.

  • Advertisers, to collect data for targeted marketing (in a legal gray area).

  • Governments, for surveillance of individuals or groups (e.g., FinFisher).

Spyware often enters systems through bundled software downloads, malicious websites, or phishing attacks. A sophisticated variant, Pegasus, developed by the NSO Group, has been known to exploit zero-day vulnerabilities in mobile devices to spy on journalists, activists, and government officials.

Unlike ransomware, spyware doesn't cause noticeable disruption, making it harder to detect. Its success depends on staying hidden.

6. Adware

Adware is a form of malware that automatically displays or downloads advertisements. While some adware is legitimate and disclosed, malicious adware operates covertly, redirecting browsers, collecting data, and sometimes degrading system performance.

Fireball, a large-scale adware campaign originating in China, affected over 250 million computers. It hijacked browsers, manipulated web traffic, and had the potential to download additional malware.

Adware may be bundled with free software (especially from untrusted sources) and can often include tracking mechanisms, blurring the line between adware and spyware.

7. Rootkits

A rootkit is a collection of tools designed to hide the existence of certain processes or programs from normal detection methods and allow privileged, stealthy access to a computer.

Rootkits operate at a low level, often within the operating system's kernel, giving them deep control over the system. They're extremely difficult to detect because they alter system processes and may disable security software.

The Sony BMG scandal involved CDs that secretly installed rootkits on users' computers to enforce digital rights management (DRM). These rootkits exposed the systems to further exploitation.

Rootkits can be delivered via Trojans, infected drivers, or system vulnerabilities. Removal is complex, often requiring a complete system reinstallation or replacement of firmware.

8. Keyloggers

Keyloggers are surveillance tools that record every keystroke a user types. They are typically used to steal login credentials, financial information, and sensitive communications.

They can be:

  • Software-based: Installed via malware (often bundled in Trojans).

  • Hardware-based: Small physical devices inserted between keyboards and computers.

Keyloggers are frequently part of larger malware campaigns and are often undetected by users. Some are even marketed as legitimate parental monitoring tools.

HawkEye, a popular keylogger sold on cybercrime forums, has been used in corporate espionage and credential theft.

9. Botnets

A botnet (short for robot network) is a collection of devices infected with malware (called bots or zombies) and controlled by a command-and-control (C&C) server. The owner of the botnet can remotely instruct all devices to perform actions simultaneously.

Botnets are used for:

  • Distributed Denial of Service (DDoS) attacks

  • Spamming

  • Brute-force attacks

  • Spreading additional malware

  • Cryptocurrency mining

The Mirai botnet, built from infected IoT devices (like cameras and routers), launched a massive DDoS attack on Dyn in 2016, temporarily taking down Twitter, Reddit, and Netflix.

Botnets continue to be a major threat due to the poor security of IoT devices and the rise of malware-as-a-service (MaaS) marketplaces.

🛡️ Final Thoughts on Protection

Malware threats continue to evolve, becoming more targeted, stealthy, and automated. Effective defense requires a multi-layered security strategy:

  • Regular software patching

  • Up-to-date antivirus and endpoint detection

  • Behavioral analytics and anomaly detection

  • Email filtering and phishing protection

  • Network segmentation

  • Strong authentication and access control

  • Frequent, secure backups stored offline

Multiple-choice questions (MCQs) on malware

🧠 Basic Level MCQs

1. What does "malware" stand for?
A. Malicious Warranty
B. Malfunctioning Software
C. Malicious Software
D. Machine Learning Software
✔️ Answer: C. Malicious Software

2. Which type of malware spreads without human interaction?
A. Trojan
B. Virus
C. Worm
D. Keylogger
✔️ Answer: C. Worm

3. What is the main purpose of ransomware?
A. To steal user credentials
B. To spy on users
C. To demand payment in exchange for data
D. To show advertisements
✔️ Answer: C. To demand payment in exchange for data

4. A Trojan horse virus typically appears as:
A. A firewall
B. An operating system
C. Legitimate software
D. Antivirus software
✔️ Answer: C. Legitimate software

5. Which malware logs keystrokes to steal passwords?
A. Ransomware
B. Worm
C. Keylogger
D. Rootkit
✔️ Answer: C. Keylogger

⚙️ Intermediate Level MCQs

6. Which malware type can hide its presence and grant elevated privileges to an attacker?
A. Adware
B. Worm
C. Spyware
D. Rootkit
✔️ Answer: D. Rootkit

7. Which malware was used in the 2017 global attack exploiting the SMB protocol?
A. Zeus
B. Stuxnet
C. Mirai
D. WannaCry
✔️ Answer: D. WannaCry

8. What is a botnet primarily used for?
A. File compression
B. Remote system repair
C. Distributed cyberattacks
D. Email filtering
✔️ Answer: C. Distributed cyberattacks

9. Which malware type is commonly bundled with free software to deliver unsolicited advertisements?
A. Worm
B. Adware
C. Keylogger
D. Rootkit
✔️ Answer: B. Adware

10. Which of the following best describes spyware?
A. Software that deletes files
B. Software that encrypts user data
C. Software that monitors user activity
D. Software that fixes security vulnerabilities
✔️ Answer: C. Software that monitors user activity

🔬 Advanced-Level Malware MCQs (with Explanation)

11. Which of the following best describes a polymorphic virus?
A. A virus that changes its location in the file system
B. A virus that only infects boot sectors
C. A virus that encrypts its code differently with each infection
D. A virus that installs a backdoor

✔️ Answer: C. A virus that encrypts its code differently with each infection
Explanation: A polymorphic virus mutates its code using encryption or code obfuscation every time it replicates, making it harder to detect using signature-based antivirus systems.

12. What distinguishes fileless malware from traditional malware?
A. It requires no execution to infect
B. It doesn't use the Windows registry
C. It resides only in RAM and uses legitimate system tools
D. It can only infect mobile devices

✔️ Answer: C. It resides only in RAM and uses legitimate system tools
Explanation: Fileless malware avoids leaving traditional footprints on disk by operating in memory (RAM), often abusing legitimate tools like PowerShell or WMI, making it stealthier than file-based malware.

13. Which malware typically uses command and control (C&C) servers to receive instructions after infection?
A. Trojan
B. Botnet
C. Keylogger
D. Adware

✔️ Answer: B. Botnet
Explanation: Botnets rely on C&C servers to coordinate actions across thousands or millions of infected devices (bots), enabling attackers to launch DDoS attacks, send spam, or deploy more malware.

14. What is the primary purpose of a loader-type Trojan like Emotet in modern cyberattacks?
A. To encrypt files
B. To collect and sell credentials
C. To load and deploy additional malware payloads
D. To alter hardware configurations

✔️ Answer: C. To load and deploy additional malware payloads
Explanation: Modern loader Trojans like Emotet act as a foothold, allowing attackers to drop additional malware such as ransomware, spyware, or banking Trojans after initial infection.

15. Why is a rootkit particularly dangerous in terms of detection and removal?
A. It spreads through phishing
B. It encrypts data and holds it for ransom
C. It mimics the user's behavior
D. It integrates into the operating system kernel to hide its presence

✔️ Answer: D. It integrates into the operating system kernel to hide its presence
Explanation: Kernel-level rootkits operate at the core of the OS, allowing them to intercept and modify system operations, making them almost invisible to traditional security tools and extremely difficult to remove.

16. Which malware classifies as an Advanced Persistent Threat (APT) component due to its long-term, stealthy presence?
A. Worm
B. Spyware
C. Ransomware
D. File Infector Virus

✔️ Answer: B. Spyware
Explanation: Spyware is often part of APTs because it can stealthily collect intelligence over long periods. Nation-state actors frequently use such tools for espionage, targeting high-value organizations.

17. The malware 'Stuxnet' was specifically designed to:
A. Steal credit card information
B. Mine cryptocurrency
C. Damage industrial control systems via PLC manipulation
D. Hijack DNS servers

✔️ Answer: C. Damage industrial control systems via PLC manipulation
Explanation: Stuxnet targeted Siemens PLCs used in nuclear enrichment facilities. It caused physical damage while masking its presence from monitoring systems, a hallmark of highly targeted, state-sponsored malware.

18. What technique does ransomware often use to increase the pressure on victims to pay?
A. Cross-site scripting
B. Keylogging
C. Double extortion (encrypt and leak data)
D. Code obfuscation

✔️ Answer: C. Double extortion (encrypt and leak data)
Explanation: In double extortion, ransomware not only encrypts files but also exfiltrates sensitive data, threatening public leaks unless the ransom is paid — increasing legal and reputational pressure.

19. Which component is typically abused in fileless attacks on Windows systems?
A. BIOS
B. Windows Registry and PowerShell
C. Host file
D. Graphics drivers

✔️ Answer: B. Windows Registry and PowerShell
Explanation: Fileless malware commonly abuses PowerShell, WMI, and registry entries to run malicious code in memory, avoiding detection by traditional file-scanning methods.

20. Why are Internet of Things (IoT) devices commonly recruited into botnets like Mirai?
A. They are immune to firmware updates
B. They use outdated encryption standards
C. They often run full operating systems
D. They have weak or hardcoded credentials and lack security updates

✔️ Answer: D. They have weak or hardcoded credentials and lack security updates
Explanation: Many IoT devices ship with default credentials and lack patching mechanisms, making them easy targets for automated botnet malware like Mirai.