Ransomware (analysis and defense)
Ransomware is the malware type with the greatest economic impact of the last decade: it encrypts the victim’s data and demands a ransom (usually in cryptocurrency) to decrypt it, often combined with leak-based extortion (stealing the data before encrypting and threatening to publish it). Understanding how it works, how a sample is analyzed, and —above all— how to prevent and respond to it is critical for any organization. This page approaches it from analysis and defense.
Threat model
Section titled “Threat model”Modern ransomware isn’t a file: it’s an operation. Encryption is the final act of an intrusion lasting days or weeks (initial access → recon → escalation → lateral → exfiltration → encryption). That duration is the defender’s big opportunity: there are many detectable phases before irreversible damage. The asymmetry is in the business model — RaaS (Ransomware-as-a-Service) separates the developer from the affiliate who executes, and access brokers sell initial access, industrializing the whole chain.
RaaS and business model
Section titled “RaaS and business model”- Ransomware-as-a-Service: the operator develops the encryptor and the panel; affiliates pay a cut and run the attacks. Explains why the same family appears with very different TTPs.
- Access brokers: sell already-obtained accesses (RDP/VPN/credentials) to the highest bidder; the affiliate enters with them.
- Double extortion: encrypt and threaten to publish the stolen data on a leak site.
- Triple extortion: add extra pressure — DDoS, notifying the victim’s customers/regulators, direct harassment.
Attack chain
Section titled “Attack chain”flowchart LR A[Initial access<br/>phishing · RDP/VPN · broker] --> R[Recon<br/>network · AD · backups] R --> E[Escalation + lateral<br/>Domain Admin] E --> X[Exfiltration<br/>double extortion] X --> D[Mass deployment<br/>GPO / PsExec] D --> N[Extortion<br/>note + leak site]
Encryption is the last step; before it comes a whole intrusion that offers multiple detection and response opportunities.
Analyzing a sample (Blue Team)
Section titled “Analyzing a sample (Blue Team)”In static analysis (see static analysis), identify family and encryption scheme:
- Crypto imports (
CryptEncrypt, BCrypt, or custom crypto) → AES? RSA? ChaCha? - The ransom note (strings), the appended extension, the victim/campaign ID.
- Anti-recovery logic: Shadow Copy deletion (
vssadmin delete shadows), disabling recovery, stopping services/databases before encrypting (ATT&CK T1490 Inhibit System Recovery).
In dynamic analysis (see dynamic analysis), in an isolated lab with decoy files:
- Observe mass encryption (many rapid writes/renames) → excellent behavioral IOC.
- The key: hybrid scheme? (per-file AES + RSA for the key) → almost always irreversible without the private key.
The encryption scheme (why it’s usually unrecoverable)
Section titled “The encryption scheme (why it’s usually unrecoverable)”Modern ransomware uses hybrid encryption:
- Generates a symmetric key (AES/ChaCha) per file or per victim → encrypts the data (fast).
- Encrypts that key with the attacker’s public RSA key → only they can decrypt it.
Without the attacker’s private key, you can’t decrypt. Exception: families with implementation flaws (predictable keys, weak crypto, reused key) for which free decryptors sometimes exist.
Pay? and recovery
Section titled “Pay? and recovery”- General recommendation: don’t pay — it funds crime, doesn’t guarantee recovery, and in some jurisdictions can carry legal liability if the group is sanctioned.
- Check free decryptors first: No More Ransom (per-family decryptors if the crypto was weak) and ID Ransomware (identify the family by note/extension).
- Real recovery comes from backups (if they exist and are intact).
Payment tracing (blockchain OSINT)
Section titled “Payment tracing (blockchain OSINT)”Even if no one pays, following the money is part of defensive and forensic intelligence:
- The payment addresses in the note are IOCs: checked on blockchain explorers and analytics platforms (Chainalysis, public explorers).
- They allow grouping campaigns (same wallet = same affiliate/operator) and feed attribution alongside TTPs.
- In a real incident, preserve the note and addresses for the report and law-enforcement coordination; tracing is done by specialized teams, but the analyst provides the indicators.
Defense: prevention (the most important)
Section titled “Defense: prevention (the most important)”Close initial-access vectors:
- MFA on VPN/RDP/email; don’t expose RDP to the Internet; patch VPN appliances (see VPN attacks).
- Anti-phishing training, email filtering, macro blocking.
Limit the impact:
- Least privilege and segmentation (so one host can’t encrypt the whole network).
- Harden AD: mass deployments use Domain Admin + GPO/PsExec (see Windows & Active Directory).
Defense: backups (the safety net)
Section titled “Defense: backups (the safety net)”The 3-2-1 rule: 3 copies, 2 different media, 1 offline/immutable (see Backups & recovery).
- Offline or immutable backups the ransomware can’t encrypt or delete.
- Test restores periodically — an unverified backup isn’t a backup.
- Protect the backups themselves (separate credentials; the attacker looks for them first).
Defense: detection and response
Section titled “Defense: detection and response”Early detection (before encryption):
- Recon/lateral/escalation activity in AD (see DFIR).
- Shadow Copy deletion (
vssadmin), mass service stops → high-priority alert. - Mass encryption (many renames/writes) → EDR with rollback and canary files.
Response (see DFIR):
- Immediately isolate affected hosts (contain propagation).
- Identify scope, initial vector, and family.
- Restore from clean backups; rotate all credentials (assume total compromise).
- Investigate exfiltration (double extortion) → legal/notification implications (see GDPR & privacy).
For the defense (summary)
Section titled “For the defense (summary)”- Prevention: MFA, patching, no exposed RDP, anti-phishing, least privilege, segmentation.
- 3-2-1 offline/immutable, tested backups — the most important defense.
- Early detection of the intrusion (not just the encryption): recon/lateral/escalation in AD.
- Rehearsed incident-response plan (see DFIR); EDR with behavioral detection.
- Map to MITRE ATT&CK (TA0040 Impact: T1486 Data Encrypted for Impact).
CVEs and real-world cases
Section titled “CVEs and real-world cases”- WannaCry (2017) — mass encryption spread with EternalBlue (CVE-2017-0144); stopped by a killswitch, it made the risk of unpatched SMBv1 clear.
- LockBit — one of the most prolific RaaS; its infrastructure was hit by an international police operation (Operation Cronos, 2024), an example of a takedown and of the model’s resilience.
- Conti — its leaked chats (2022) exposed the corporate structure of a RaaS group from the inside: payroll, roles, playbooks.
- Appliance exploitation as massive initial access: campaigns against flaws in MOVEit, Citrix, and VPN products have fed waves of ransomware/extortion.
- ATT&CK: T1486 (Data Encrypted for Impact), T1490 (Inhibit System Recovery), T1567 (Exfiltration Over Web Service).
Testing checklist (analysis/defense)
Section titled “Testing checklist (analysis/defense)”- Analysis: family, crypto scheme, note, extension (static)
- Anti-recovery logic (Shadow Copy deletion, service stops)
- Mass-encryption behavior in an isolated lab (dynamic)
- Identify the family (ID Ransomware) and look for a decryptor (No More Ransom)
- Prevention: MFA/patching/RDP/anti-phishing/segmentation
- 3-2-1 offline/immutable backups and tested restore
- Early detection of the intrusion (recon/lateral/escalation)
- Response plan: isolate, scope, restore, rotate credentials, exfiltration
- Preserve note and payment addresses as IOCs (tracing/report)