What Is Malware? 7 Types, How It Works & How Hackers Use It (2026)
What is Malware? Every Type Explained — How It Works, Real Examples & How to Remove It (Complete 2026 Guide)
In early 2025, a new malware family called PROMPTFLUX was observed actively querying large language models mid-execution — using AI to generate custom evasion code on the fly in response to the specific security software it detected on each infected machine. When PROMPTFLUX encountered Windows Defender, it asked an LLM how to evade Windows Defender specifically, and implemented the response in real time. When it encountered a different endpoint product, it adapted accordingly. Traditional signature-based detection, which works by recognising known malware patterns, was useless against malware that rewrites itself differently for each target.
That is 2026-era malware. But understanding it requires understanding the full spectrum — from the decades-old foundations to the AI-powered variants emerging today. This guide covers every malware type, how each works technically, real attack examples, and exactly what you can do to protect against each one.
- What malware is — and why "virus" is the wrong word for most of it
- How malware infects a system — the full infection chain
- Every malware type explained with real examples
- Fileless malware — the most dangerous modern variant
- AI-powered malware — the 2026 escalation
- Signs your device is infected — what to look for
- How to remove malware — step-by-step
- Prevention — how to avoid infection in the first place
What Malware Is — And Why "Virus" Is the Wrong Word for Most of It
Malware (malicious software) is any software designed to damage, disrupt, gain unauthorised access to, or perform unwanted actions on a computer system, network, or device — without the owner's knowledge or consent.
The word "virus" is colloquially used to mean all malware, but a virus is actually one specific category with specific characteristics (self-replication by attaching to existing files). Modern attacks rarely use traditional viruses. They use trojans, spyware, ransomware, rootkits, and increasingly fileless and AI-powered variants that are far more sophisticated and harder to detect than the viruses of the 1990s and 2000s.
Understanding the specific type of malware matters because each type has different infection methods, different behaviours on the infected system, different goals, and different removal requirements. A rootkit requires a completely different response from a browser hijacker, even though both are "malware."
How Malware Infects a System — The Full Infection Chain
A Typical Modern Malware Infection — Step by Step
Delivery: The malware reaches the target system via a phishing email attachment, a malicious download link, a compromised website (drive-by download), an infected USB drive, a malicious advertisement (malvertising), or a supply chain compromise (malware hidden in a legitimate software update). The delivery method is almost always social engineering — getting a person to take an action that initiates the infection.
Execution: The malicious code runs. This might require the user to open a file (macro-enabled Office document, a fake PDF, an executable disguised as a legitimate file), or it might happen automatically through a browser vulnerability exploited by a malicious webpage (drive-by download).
Establishment: The malware establishes persistence — a mechanism to survive a reboot. Methods include: adding registry entries, creating scheduled tasks, modifying startup folders, or installing a service. At this stage, the malware will reload automatically every time the system restarts.
Command and Control (C2): The malware contacts a remote server controlled by the attacker — called a C2 or C&C server. This connection allows the attacker to send commands, receive stolen data, and update the malware. C2 communication is often disguised as normal HTTPS traffic to avoid detection.
Payload execution: The malware performs its primary function — stealing credentials, encrypting files, logging keystrokes, mining cryptocurrency, providing remote access, exfiltrating data, or spreading to other systems on the same network. This is the phase that produces visible damage or enables further attacks.
Every Malware Type Explained — With Real Examples
Virus
A virus attaches itself to a legitimate file and replicates when that file is executed or shared — like a biological virus that needs a host cell. When an infected file runs, the virus code runs too, infecting additional files on the same system. Viruses spread to other computers when infected files are shared (email attachments, USB drives, file sharing). Traditional viruses are less common in modern attacks because they require a host file to execute and are reliably detected by signature-based antivirus software.
Trojan (Trojan Horse)
A trojan disguises itself as legitimate, useful software to trick users into installing it. Unlike a virus, it does not self-replicate — it relies on social engineering to spread. Once installed, it performs malicious actions hidden from the user: opening backdoors for remote access, downloading additional malware, stealing credentials, or providing a foothold for further attacks. Trojans are the most common malware type used in targeted attacks because they can be customised to specific objectives and disguised as any type of software.
Spyware
Spyware secretly monitors user activity and sends collected data to the attacker. It operates without the user's knowledge or consent, harvesting information over time rather than causing immediate visible damage. Types range from commercial-grade spyware marketed as "parental monitoring" software to sophisticated nation-state tools that intercept encrypted communications. The defining characteristic is covert observation and data exfiltration without the user's awareness.
Keylogger
Records every keystroke the user types and sends the log to the attacker. This captures usernames, passwords, credit card numbers, personal messages, and anything else typed on the keyboard. Keyloggers may be software-based (installed on the operating system) or hardware-based (physical devices attached between the keyboard and computer, often used in corporate espionage or targeted attacks on specific workstations).
Rootkit
A rootkit conceals itself and other malicious software from the operating system and security tools by modifying the OS itself at a fundamental level. Once installed, a rootkit can hide processes, files, registry entries, and network connections — making other malware running on the system effectively invisible. The name comes from "root" (administrator) access on Unix systems. Rootkits are the most technically sophisticated malware and the hardest to remove — because the tools you would use to detect them are themselves running on an OS that the rootkit controls.
Worm
Unlike a virus, a worm does not need a host file — it is a self-contained, self-replicating program that spreads across networks without user interaction. Worms exploit vulnerabilities in network services, operating systems, or applications to propagate automatically from machine to machine. A single infected system on a corporate network can infect thousands of other systems within hours through automated scanning and exploitation. Worms often carry a secondary payload — they may spread ransomware, install backdoors, or form botnets.
Fileless Malware
Fileless malware operates entirely in system memory (RAM) and uses legitimate operating system tools to carry out malicious actions — never writing a file to disk. Because traditional antivirus software detects malware by scanning files, fileless malware is invisible to most signature-based security tools. It loads into memory through an existing process (typically a browser, document viewer, or system utility), executes its payload, and may disappear entirely when the system is rebooted — leaving minimal forensic evidence.
AI-Powered Malware
The newest and most concerning category. AI-powered malware uses large language models (LLMs) to dynamically adapt its behaviour, evade detection, and improve its own effectiveness during execution. Mandiant confirmed the existence of two AI-querying malware families in M-Trends 2026: PROMPTFLUX (queries LLMs mid-execution to generate evasion code specific to the detected security software) and PROMPTSTEAL (uses LLMs to identify and extract credentials and configuration files based on the specific environment it finds itself in). The QUIETVAULT credential stealer was observed executing predefined prompts against local AI command-line tools on infected machines to locate configuration files.
Signs Your Device May Be Infected With Malware
- Unexplained slowness or high CPU/memory usage — especially if a specific process you don't recognise is consuming resources (cryptomining malware, spyware)
- Browser behaviour changes — new homepage or search engine you didn't set, new toolbars or extensions, redirects to unexpected websites (browser hijacker, adware)
- Security software disabled or won't start — many malware types disable antivirus as a first step after infection (rootkits, advanced trojans)
- Unusual network activity — high outbound traffic when you're not using the internet, connections to unknown IP addresses (C2 communication, data exfiltration)
- Files encrypted or inaccessible — the most visible sign of ransomware (covered in the ransomware guide)
- Accounts logged into from unexpected locations — indicates credential theft by a keylogger or spyware
- Unexpected pop-ups or advertisements — even outside the browser (adware)
- Your contacts receive strange messages from you — indicates your email or social media accounts have been compromised, possibly by a worm spreading itself
How to Remove Malware — Step by Step
Disconnect From the Network
Immediately disconnect the infected device from the internet and from any internal network. Disable WiFi, unplug ethernet. This stops data exfiltration, cuts C2 communication, and prevents network-spreading worms from infecting other devices. Do not reconnect until the device is confirmed clean.
Boot Into Safe Mode
Safe Mode loads Windows with only essential drivers and processes — most malware does not load in Safe Mode because it runs as an optional service or startup program. Performing the scan in Safe Mode prevents the malware from actively interfering with detection and removal. On Windows: restart, hold Shift while clicking Restart, then Troubleshoot > Advanced Options > Startup Settings > Restart > Safe Mode with Networking.
Run a Dedicated Malware Scanner
Your regular antivirus may have been compromised or may not detect the specific malware. Use a second-opinion scanner: Malwarebytes Free, HitmanPro, or Microsoft's standalone Malicious Software Removal Tool (MSRT). These tools use different detection engines and may catch what your primary tool missed. Run a full system scan, not a quick scan.
Check Startup Programs and Scheduled Tasks
Open Task Manager > Startup tab and Process Monitor (Sysinternals) to identify any suspicious processes or startup entries. Review scheduled tasks (Task Scheduler) for any unknown entries. Many malware families achieve persistence through these mechanisms. Research any unfamiliar entry names before disabling them.
Change All Passwords From a Clean Device
Assume any password typed on the infected device has been captured by a keylogger. Change all passwords — especially email, banking, social media, and work accounts — from a different, uninfected device. Do this after the infected device has been cleaned, not before, otherwise you may be keyllogging your new passwords too. Enable MFA on all accounts if not already active.
For Severe Infections: Wipe and Reinstall
For rootkits, bootkits, fileless malware, or any infection where you cannot be certain of complete removal: the safest approach is a full wipe and OS reinstallation from a known-clean source. Backup data to an external drive (scan the backup), format the drive, reinstall the OS, restore data, and reinstall applications. Time-consuming but the only guarantee of a clean system for severe infections.
Prevention — How to Avoid Malware Infection
Malware Prevention Checklist
- Keep everything updated. The OS, browsers, browser plugins, and all installed software. The majority of drive-by downloads and worm propagations exploit known, patched vulnerabilities. Unpatched systems are the primary attack surface for automated malware campaigns.
- Never open email attachments or links without verifying the sender. Malware delivery is dominated by phishing emails. No legitimate service will send you an attachment you didn't request. Apply the SLAM method from the phishing guide to every unexpected email.
- Only download software from official sources. Pirated software, cracked applications, and unofficial download sites are the primary distribution vector for trojans. The risk of malware in pirated software is not theoretical — it is near-certain for popular titles.
- Use a reputable endpoint security product and keep it updated. No tool provides complete protection, but modern EDR (Endpoint Detection and Response) products detect behavioural anomalies that signature-based tools miss. Free options (Windows Defender, Malwarebytes Free) provide meaningful protection. Paid EDR solutions add behavioural analysis, memory scanning, and threat hunting capabilities.
- Enable a firewall and review outbound traffic rules. A host-based firewall that blocks unexpected outbound connections can detect C2 communication — a malware-infected machine suddenly attempting to connect to unusual IP addresses on unusual ports is a detectable signal.
- Disable macros in Office documents by default. Macro-enabled Office documents remain one of the most common malware delivery mechanisms. Default macro settings in Office should block macros from running in documents received from email or the internet. Enable macros only for documents from trusted sources where you can verify the need.
- Back up data regularly to an offline location. Backups do not prevent malware infection, but they remove the leverage ransomware has over you and allow recovery from destructive malware. Follow the 3-2-1 backup rule as described in the ransomware protection guide.
- Be suspicious of any USB drive you didn't personally purchase and insert. Never plug in a USB drive you found, received unexpectedly, or cannot trace to a verified source. The baiting technique in social engineering exploits exactly this scenario.
Comments
Post a Comment