For decades, antivirus worked the same way: researchers analysed malware samples, wrote signatures (patterns of bytes, hashes or rules that identify a sample or family), and pushed them to every endpoint. When a file matched, it was blocked.
Over the last several years, "next-generation" endpoint products have argued that signatures cannot keep up, and that machine learning should take their place. Attackers generate huge numbers of new malware samples every day, many differing only slightly from existing ones.
So, can ML detect malware better than signatures? The honest answer is: differently, and best in combination.
How signatures work
A signature can be:
- a hash of a known malicious file (exact match),
- a byte pattern or string unique to a family, or
- a rule, for example a YARA rule combining strings, file structure and conditions.
rule Example_Loader_Family
{
meta:
description = "Illustrative rule for a loader family"
strings:
$mutex = "Global\\x7fA1c9Loader" ascii
$cfg = { 8B 45 ?? 33 C9 8A 0C 08 80 F1 5A } // XOR-decoding loop
$ua = "Mozilla/4.0 (compatible; MSIE 8.0; LoaderAgent)" ascii
condition:
uint16(0) == 0x5A4D and 2 of them
}Strengths: precise, fast, explainable ("it matched this rule"), with very low false positives when well written.
Weaknesses: they only catch what someone has already analysed. Changing a few bytes, repacking or recompiling the malware can defeat hash and simple byte signatures, and good rules take expert time to write.
How ML malware classifiers work
An ML classifier learns from large labelled datasets of benign and malicious files. For Windows executables, typical static features include:
- header fields and section characteristics (sizes, entropy, permissions),
- imported libraries and functions,
- embedded strings and resources,
- byte and opcode statistics, and
- packer and signature information.
A model such as gradient-boosted trees or a neural network learns which combinations indicate malice. Public research datasets like EMBER (released in 2018) have made this easier to study. Some research models, such as MalConv, even learn directly from raw bytes.
flowchart LR
F[New file] --> X[Extract features<br/>headers, imports, strings,<br/>entropy, sections]
X --> M[Trained classifier]
M --> P{Score > threshold?}
P -->|yes| B[Block / quarantine]
P -->|no| A[Allow, keep monitoring]Strengths: ML generalises. A new variant that shares characteristics with a known family, or with malware in general, can be caught without any signature. It also works offline on the endpoint.
Weaknesses:
- False positives, especially for unusual but legitimate software: internal tools, packers used by legitimate vendors, niche applications.
- Explainability: "87% malicious" is harder to act on than a named rule match.
- Adversarial evasion. In 2019, researchers showed that appending strings taken from a popular game to malicious files was enough to make one leading ML-based product classify them as benign. Models can learn shortcuts that attackers can exploit.
- Concept drift: as software and malware evolve, models need retraining.
The layer both miss: behaviour
Static analysis, whether signatures or ML, examines a file before it runs. Increasingly, attacks avoid malicious files entirely:
- fileless techniques using PowerShell, WMI and other built-in tools ("living off the land"),
- malicious documents that download payloads at runtime, and
- hands-on-keyboard intrusions using legitimate administration tools.
Behavioural detection watches what processes do: spawning shells from Office documents, injecting into other processes, dumping credentials from LSASS, encrypting many files quickly. Endpoint detection and response (EDR) tools combine behavioural rules and ML models over this telemetry.
What effective endpoint defence looks like
The strongest approach layers all three, backed by response:
- Signatures and threat intelligence for fast, precise blocking of known threats.
- ML static analysis to catch new variants before execution.
- Behavioural detection for fileless, living-off-the-land and hands-on-keyboard attacks.
- EDR and response: the ability to investigate, isolate hosts and roll back changes.
- Hardening: application control, macro restrictions, attack-surface reduction rules and least privilege, so fewer attacks get a chance to run.
Questions to ask endpoint vendors
- How do you combine signatures, ML and behaviour, and which layer caught recent real-world threats?
- What is your false-positive rate, and how do we handle legitimate software that gets flagged?
- How do you test against adversarial evasion?
- How quickly do models and signatures update?
- What telemetry do we get for investigation and threat hunting?
The bottom line
Machine learning did not make signatures obsolete; it filled a gap they could not. Signatures remain the most precise tool for known threats, ML extends coverage to new variants, and behavioural detection catches what never touches disk. Attackers target whichever layer is weakest, so the answer is all three, with skilled people watching the results.
Our endpoint security and managed detection and response services combine layered prevention with 24×7 investigation and response.