什么是勒索软件?文件加密恶意软件与防护策略
Security

什么是勒索软件?文件加密恶意软件与防护策略

勒索软件是一种加密文件并要求支付赎金才能恢复的恶意软件。从2017年WannaCry到2023年LockBit,勒索软件每年造成数十亿美元损失。了解AES+RSA加密机制、RaaS模式和3-2-1备份防护策略。

系列文章: 安全
  1. 1 什么是勒索软件?文件加密恶意软件与防护策略
  2. 2 WAF 是什么?Web 应用防火墙详解
✦ 快速摘要
勒索软件是一种加密文件并要求支付赎金才能恢复的恶意软件。从2017年WannaCry到2023年LockBit,勒索软件每年造成数十亿美元损失。了解AES+RSA加密机制、RaaS模式和3-2-1备份防护策略。
这篇文章怎么样?

勒索软件是现代网络安全领域最危险的恶意软件——它不会悄悄窃取数据,而是将整个系统锁死并当面索要赎金。一次勒索软件攻击可以在几分钟内使医院、学校或跨国企业陷入瘫痪。

什么是勒索软件?定义与影响

勒索软件是一种恶意软件,它加密受害者的文件或整个系统,然后显示要求支付赎金的通知——通常以比特币或门罗币——以换取解密密钥。如果在截止日期前不支付,数据可能被永久删除或公开披露。

与普通恶意软件的核心区别:勒索软件不在暗处运作,而是直接攻击组织的运营能力。受害者立即知道自己遭受了攻击,时间压力迫使他们快速做出决定——这是一种蓄意的心理战术。

全球损失规模巨大。Cybersecurity Ventures估计,勒索软件在2021年造成约200亿美元的损失,是2015年的57倍。2021年,Colonial Pipeline(美国)支付了440万美元;CNA Financial支付了4000万美元;德国一家医院因系统完全被锁而不得不将急诊患者转移到其他机构。

勒索软件的发展历史

勒索软件并非新现象——它已存在超过35年,并持续演进。

**AIDS木马(1989年)**是有记录的第一个勒索软件。生物学家Joseph Popp在世卫组织艾滋病会议上分发了20,000张软盘。该软件在系统重启90次后隐藏目录并加密文件名,然后要求将189美元邮寄到巴拿马的一个邮箱。虽然粗陋,但基本模式已经形成。

**CryptoLocker(2013年)**标志着比特币时代的转折点。使用真实的RSA-2048加密和比特币进行匿名支付,CryptoLocker在2014年被FBI摧毁前收取了超过2700万美元。这是第一个证明该模式可以高度盈利的勒索软件。

**WannaCry(2017年5月)**是一次全球性冲击。利用EternalBlue漏洞(MS17-010)——从NSA窃取——WannaCry通过SMB自动传播,无需任何用户交互。4天内,150个国家超过20万台计算机被感染。英国NHS不得不取消数万个预约;Telefónica、FedEx和德国铁路陷入瘫痪。估计损失:40-80亿美元。

**NotPetya(2017年6月)**看起来像勒索软件,但实际上是俄罗斯国家运营的数据清除程序(wiper)。它覆盖了MBR(主引导记录),使机器无法启动。没有真正的解密能力。马士基损失3亿美元;默克损失8.7亿美元。总损失超过100亿美元——历史上单次网络攻击造成的最大财务影响。

**LockBit(2019-2024年)**是2020年代占主导地位的RaaS团伙。以专业的勒索软件即服务运营,拥有附属计划、数据泄露网站,甚至为自己的恶意软件设立漏洞赏金计划,到2023年LockBit占据了全球勒索软件市场约25%的份额。FBI和欧洲刑警组织于2024年2月摧毁了LockBit的基础设施,但附属成员在新名称下继续运营。

技术机制:AES + RSA混合加密

现代勒索软件的威力来自于结合两种互补的加密算法:

典型的勒索软件加密流程:

1. 恶意软件在受害者机器上运行
2. 生成随机的AES-256会话密钥
3. 枚举文件(*.doc, *.xlsx, *.jpg, *.db, ...)
4. 使用AES-256加密每个文件(快速、对称)
5. 使用RSA-2048公钥加密AES会话密钥
   (公钥硬编码在恶意软件二进制文件中)
6. 从内存中清除AES会话密钥
7. 将RSA加密的密钥存储在勒索通知文件中
8. 显示勒索通知 + 支付说明

只有使用攻击者C2服务器上的RSA私钥才能解密。

为什么同时使用两者?AES-256加密速度快(几秒内处理千兆字节),但是对称的——加密和解密使用相同的密钥,无法安全隐藏密钥。RSA-2048解决了密钥分发问题:可以将公钥(用于加密AES密钥)嵌入恶意软件中而不泄露私钥。私钥只存在于攻击者的C2服务器上。

结果:即使拥有完整的恶意软件源代码、所有加密文件以及世界上所有的计算能力,没有RSA私钥就仍然无法解密。这就是为什么现代勒索软件能有效击败除干净备份之外的所有应对措施。

一些勒索软件还会增加额外层次:分块加密文件、重命名扩展名(.locked.wncry),以及多次覆盖原始文件以防止法证恢复。

感染途径

了解勒索软件如何入侵是有效预防的第一步。

钓鱼邮件仍然是首要攻击途径。攻击者发送伪造的发票、快递通知或内部文件。附件通常是带有恶意宏的Word/Excel文件(提示用户"启用内容"),或带有指向投放程序链接的PDF。单击一下就足以启动感染链。

RDP暴力破解是第二常见的途径。数百万台Windows机器将3389端口(远程桌面协议)暴露在互联网上——许多机器使用弱密码或默认密码。攻击者使用自动化工具每天尝试数百万个密码。一旦进入,他们就可以以管理员权限直接部署勒索软件。

**EternalBlue漏洞(MS17-010)**是WannaCry利用的漏洞。微软于2017年3月修补了该漏洞,但当WannaCry于5月爆发时,数十万台机器仍未打补丁。如今,EternalBlue仍在被使用,因为许多遗留系统仍未修补。

供应链攻击日益普遍。Kaseya VSA(2021年):REvil攻击IT管理软件Kaseya VSA,通过使用Kaseya的托管服务提供商影响了1500家企业。SolarWinds(2020年,非勒索软件但相同途径)展示了供应链攻击的极度危险性。

偷渡式下载和恶意广告通过合法网站上的恶意广告攻击用户,自动下载并运行投放程序,除了使用未修补浏览器访问网站外无需任何交互。

双重勒索与RaaS模式

勒索软件已经远远超出了最初的简单模式。

双重勒索于2019年随Maze勒索软件出现。攻击者不只是加密文件,而是在加密之前先窃取(外泄)数据。如果受害者拒绝支付,他们威胁将在暗网泄露网站上公布敏感数据——客户记录、商业机密、人事数据。这产生了双重压力:既要支付以解密,又要支付以防止数据泄露。一些团伙甚至使用三重勒索——对受害者网站添加DDoS攻击以增加压力。

**RaaS(勒索软件即服务)**是最重要的商业模式转变。运营商团队(勒索软件开发者)不直接攻击——他们构建基础设施:恶意软件、C2服务器、支付门户和客户服务(帮助受害者支付)。附属成员(合作伙伴)购买或租用套件,自行寻找受害者并部署攻击。收入分配:附属成员保留70-80%,运营商获得20-30%。

这一模式使勒索软件大众化——攻击者不需要编程或密码学技能,只需要基本的入侵技能和运行工具的能力。LockBit、BlackCat(ALPHV)、Conti和Cl0p均采用RaaS模式运营,拥有数十至数百个附属成员。

这些团伙在Tor上维护泄露网站——发布拒绝付款的受害者名单,并附上样本窃取数据作为证明。这是极其有效的公开施压工具。

勒索软件防护

没有任何单一措施能保证100%安全。勒索软件防护需要分层策略(纵深防御)。

勒索软件防护检查清单:

备份:
□ 3-2-1备份:3份副本、2种介质类型、1份离线/气隙隔离副本
□ 每月测试恢复——无法恢复的备份毫无价值
□ 离线备份始终与网络断开连接

补丁与加固:
□ 在关键补丁发布后72小时内修补操作系统和应用程序
□ 如不需要则禁用RDP;如需要RDP则使用VPN + MFA
□ 为普通用户禁用Office宏
□ 最小权限原则——用户不应是本地管理员

检测与遏制:
□ EDR(端点检测和响应)——检测异常行为
□ 网络分段——防止勒索软件在系统间传播
□ 电子邮件网关过滤恶意附件

安全意识:
□ 定期为全体员工提供钓鱼识别培训
□ 每季度开展钓鱼模拟演练

3-2-1备份是最重要但也是最常被忽视的防御层。三个要素:保留3份数据副本,存储在2种不同的介质类型上(如内部硬盘和云端),至少1离线或气隙隔离——不连接网络。勒索软件通常会搜索并加密在线备份;离线副本不受影响。同样重要:定期测试恢复。未经测试的备份不是真正的备份。

快速打补丁是对抗漏洞利用的最佳防御。WannaCry用一个两个月前就已被修补的漏洞感染了20万台机器。关键补丁必须在72小时内应用——而不是"有时间的时候"。

最小权限防止勒索软件提升权限。如果受感染的用户不是本地管理员,勒索软件将难以加密系统文件并通过网络共享传播到其他机器。大多数办公用户无需管理员权限即可完成工作。

EDR(端点检测和响应)解决方案,如CrowdStrike Falcon、Microsoft Defender for Endpoint或SentinelOne,能检测异常的大规模加密行为,并可在勒索软件完成加密之前终止进程。

网络分段限制了传播范围。如果防火墙规则配置正确,一个VLAN内的勒索软件无法自动跳转到另一个VLAN。

遭受攻击后的应对——事件响应

如果能快速正确地响应,遭受勒索软件攻击不一定会造成灾难。

第一个小时的优先事项:
1. 隔离受感染机器——断开网络(拔网线 / 禁用WiFi / VLAN隔离)
2. 不要完全关机——RAM中仍保留法证证据
3. 在做任何其他操作之前对硬盘进行快照/镜像
4. 确定范围——哪些机器受影响,哪些数据被加密
5. 通知:IT安全团队、法务、管理层、网络保险

后续步骤(第2-24小时):
6. 联系CSIRT / 相关国家网络安全机构
7. 查看nomoreransom.org——某些变种有免费解密工具
8. 评估备份——是否有干净的离线副本?
9. 关于赎金支付的决定(法务 + 保险 + FBI指导)
10. 清除恶意软件 → 从干净备份恢复 → 事后回顾

立即隔离是最重要的单一行动。每一秒的延迟都会给勒索软件更多时间加密更多文件并通过网络共享传播到其他机器。立即拔掉网线、禁用WiFi,或移入隔离VLAN。

不要关机是反直觉但至关重要的规则。RAM可能包含尚未清除的加密密钥、正在运行的进程列表和网络连接——所有这些都是宝贵的法证证据。关机会清空RAM。

nomoreransom.org是欧洲刑警组织、FBI和安全公司之间的合作项目。他们维护着数百种勒索软件变种的免费解密工具库,这些密钥是从执法行动中获取的。始终首先检查这里。

赎金支付决定很复杂。FBI和CISA建议不要支付,但实际上取决于:是否有备份?数据有多敏感?网络保险是否覆盖?当地法律是否禁止向受制裁团伙支付?许多企业最终因没有备份而支付——大约65%收到了可用的解密密钥(但35%没有)。

什么是木马?

什么是僵尸网络?

什么是网络钓鱼?识别和防范欺诈

Ransomware is the most dangerous type of malware in today's cybersecurity landscape — it doesn't silently steal data but locks your entire system and demands payment right in front of you. A ransomware attack can cripple a hospital, school, or multinational corporation within minutes.

What is Ransomware? Definition and Impact

Ransomware is malicious software that encrypts files or an entire system, then displays a message demanding payment — typically in Bitcoin or Monero — in exchange for a decryption key. If not paid within the deadline, data may be permanently deleted or publicly disclosed.

The core difference from ordinary malware: ransomware doesn't operate in the shadows — it directly attacks an organization's ability to operate. Victims know immediately that they've been attacked, and time pressure forces rapid decisions — an intentional psychological tactic.

The global scale of damage is enormous. Cybersecurity Ventures estimates ransomware caused approximately $20 billion USD in damage in 2021, a 57-fold increase from 2015. In 2021, Colonial Pipeline (USA) paid $4.4 million; CNA Financial paid $40 million; a hospital in Germany had to divert emergency patients to other facilities because its systems were completely locked.

History of Ransomware

Ransomware is not a new phenomenon — it has existed for over 35 years and continues to evolve.

AIDS Trojan (1989) was the first documented ransomware. Joseph Popp, a biologist, distributed 20,000 floppy disks at the WHO's AIDS conference. The software hid directories and encrypted file names after 90 system reboots, then demanded $189 be mailed to a P.O. box in Panama. Primitive, but the basic model was established.

CryptoLocker (2013) marked the turning point of the Bitcoin era. Using real RSA-2048 encryption and Bitcoin for anonymous payments, CryptoLocker collected over $27 million before being taken down by the FBI in 2014. It was the first ransomware to prove the model could be highly profitable.

WannaCry (May 2017) was a global shock. Exploiting the EternalBlue vulnerability (MS17-010) — stolen from the NSA — WannaCry spread automatically via SMB without requiring any user interaction. Within 4 days, over 200,000 computers in 150 countries were infected. The UK's NHS had to cancel tens of thousands of appointments; Telefónica, FedEx, and Deutsche Bahn were paralyzed. Estimated damage: $4–8 billion USD.

NotPetya (June 2017) looked like ransomware but was actually a wiper operated by the Russian state. It overwrote the MBR (Master Boot Record), making machines unbootable. There was no real decryption capability. Maersk lost $300 million; Merck lost $870 million. Total damage exceeded $10 billion USD — the largest financial impact of a single cyberattack in history.

LockBit (2019–2024) was the dominant RaaS group of the 2020s. Operating as a professional Ransomware-as-a-Service with an affiliate program, a leak site, and even a bug bounty program for its own malware, LockBit held approximately 25% of the global ransomware market by 2023. The FBI and Europol dismantled LockBit's infrastructure in February 2024, but affiliates continued operating under new names.

Technical Mechanism: AES + RSA Hybrid Encryption

The power of modern ransomware comes from combining two complementary encryption algorithms:

Typical ransomware encryption process:

1. Malware executes on victim's machine
2. Generate a random AES-256 session key
3. Enumerate files (*.doc, *.xlsx, *.jpg, *.db, ...)
4. Encrypt each file using AES-256 (fast, symmetric)
5. Encrypt the AES session key using RSA-2048 public key
   (public key hardcoded in the malware binary)
6. Erase the AES session key from memory
7. Store the RSA-encrypted key in the ransom note file
8. Display ransom note + payment instructions

Decryption is only possible with the RSA private key from the attacker's C2 server.

Why use both? AES-256 encrypts quickly (gigabytes in seconds) but is symmetric — the same key is used for encryption and decryption, making it impossible to hide the key safely. RSA-2048 solves the key distribution problem: the public key (used to encrypt the AES key) can be embedded in the malware without revealing the private key. The private key only exists on the attacker's C2 server.

The result: even with the full malware source code, all the encrypted files, and all the computing power in the world, you still cannot decrypt without the RSA private key. This is why modern ransomware effectively defeats all response measures except clean backups.

Some ransomware adds additional layers: encrypting files in chunks, renaming extensions (.locked, .wncry), and overwriting original files multiple times to prevent forensic recovery.

Infection Vectors

Understanding how ransomware gains entry is the first step toward effective prevention.

Phishing email remains the number one attack vector. Attackers send fake invoices, shipping notifications, or internal documents. Attachments are typically Word/Excel files with malicious macros (prompting users to "Enable Content"), or PDFs with links to a dropper. A single click is enough to start the infection chain.

RDP brute force is the second most common vector. Millions of Windows machines expose port 3389 (Remote Desktop Protocol) to the internet — many with weak or default passwords. Attackers use automated tools to try millions of passwords every day. Once inside, they can deploy ransomware directly with admin privileges.

EternalBlue exploit (MS17-010) is the vulnerability WannaCry exploited. Microsoft patched it in March 2017, but hundreds of thousands of machines were unpatched when WannaCry erupted in May. Today, EternalBlue is still used because many legacy systems remain unpatched.

Supply chain attacks are increasingly common. Kaseya VSA (2021): REvil attacked IT management software Kaseya VSA, affecting 1,500 businesses through Managed Service Providers using Kaseya. SolarWinds (2020, not ransomware but the same vector) demonstrated the extreme danger of supply chain compromises.

Drive-by downloads and malvertising target users through malicious ads on legitimate websites, automatically downloading and running a dropper with no interaction beyond visiting an unpatched browser.

Double Extortion and the RaaS Model

Ransomware has evolved far beyond its simple original model.

Double extortion emerged in 2019 with Maze ransomware. Rather than only encrypting files, attackers exfiltrate (steal) data first before encrypting it. If a victim refuses to pay, they threaten to publish sensitive data — customer records, trade secrets, personnel data — on dark web leak sites. This creates dual pressure: pay to decrypt AND pay to prevent data disclosure. Some groups even use triple extortion — adding a DDoS attack on the victim's website to increase pressure.

RaaS (Ransomware-as-a-Service) represents the most important business model shift. The operator group (ransomware developers) doesn't directly attack — they build the infrastructure: malware, C2 servers, payment portals, and customer service (helping victims pay). Affiliates (partners) buy or rent the kit, find their own victims, and deploy the attacks. Revenue splits: affiliates keep 70–80%, operators take 20–30%.

This model democratizes ransomware — an attacker doesn't need programming or cryptography skills, only basic intrusion skills and the ability to run tools. LockBit, BlackCat (ALPHV), Conti, and Cl0p all operated under the RaaS model with dozens to hundreds of affiliates.

These groups maintain leak sites on Tor — websites that publish lists of victims who refused to pay, along with sample stolen data as proof. This is an extremely effective public pressure tool.

Ransomware Prevention

No single measure guarantees 100% safety. Ransomware prevention requires a layered strategy (defense in depth).

Ransomware prevention checklist:

Backup:
□ 3-2-1 backup: 3 copies, 2 media types, 1 offline/air-gapped copy
□ Test restores monthly — a backup is worthless if it cannot be restored
□ Keep offline backups disconnected from the network at all times

Patch & Hardening:
□ Patch OS and applications within 72 hours of a critical patch release
□ Disable RDP if not needed; use VPN + MFA if RDP is required
□ Disable Office macros for regular users
□ Least privilege — users should not be local admins

Detection & Containment:
□ EDR (Endpoint Detection and Response) — detect abnormal behavior
□ Network segmentation — prevent ransomware from spreading across systems
□ Email gateway to filter malicious attachments

Awareness:
□ Regular phishing recognition training for all staff
□ Quarterly phishing simulation exercises

3-2-1 backup is the most important and often overlooked defense layer. Three elements: keep 3 copies of data, on 2 different media types (e.g., internal hard drive and cloud), with at least 1 copy offline or air-gapped — not connected to the network. Ransomware typically searches for and encrypts online backups; an offline copy cannot be affected. Equally important: test restores regularly. An untested backup is not a real backup.

Fast patching is the best defense against exploits. WannaCry infected 200,000 machines with a vulnerability that had been patched two months earlier. Critical patches must be applied within 72 hours — not "when there's time."

Least privilege prevents ransomware from escalating permissions. If an infected user is not a local admin, ransomware struggles to encrypt system files and spread to other machines via network shares. Most office users don't need admin rights to do their work.

EDR (Endpoint Detection and Response) solutions like CrowdStrike Falcon, Microsoft Defender for Endpoint, or SentinelOne detect abnormal mass-encryption behavior and can kill ransomware processes before they complete.

Network segmentation limits the scope of spread. Ransomware inside one VLAN cannot automatically jump to another VLAN if firewall rules are properly configured.

Responding to an Attack — Incident Response

Being hit by ransomware doesn't have to be a disaster if you respond quickly and correctly.

Priorities in the first hour:
1. Isolate infected machines — cut network (unplug cable / disable WiFi / VLAN isolation)
2. Do NOT fully power off — forensic evidence is still in RAM
3. Snapshot/image the hard drive before doing anything else
4. Determine scope — which machines are affected, what data is encrypted
5. Notify: IT security team, legal, management, cyber insurance

Next steps (hours 2-24):
6. Contact CSIRT / relevant national cybersecurity authority
7. Check nomoreransom.org — some variants have free decryptors
8. Assess backups — is there a clean offline copy?
9. Decision on ransom payment (legal + insurance + FBI guidance)
10. Eradicate → Restore from clean backup → Post-incident review

Immediate isolation is the single most important action. Every second of delay gives ransomware more time to encrypt more files and spread to other machines via network shares. Unplug the network cable, disable WiFi, or move to a quarantine VLAN immediately.

Do not power off is a counterintuitive but critical rule. RAM may contain encryption keys not yet erased, a list of running processes, and network connections — all valuable forensic evidence. Shutting down wipes RAM clean.

nomoreransom.org is a collaborative project between Europol, the FBI, and security companies. They maintain a library of free decryptors for hundreds of ransomware variants whose keys have been recovered from law enforcement operations. Always check here first.

The ransom payment decision is complex. The FBI and CISA advise against paying, but in practice it depends on: is there a backup? How sensitive is the data? Does cyber insurance cover it? Does local law prohibit paying groups under sanctions? Many businesses ultimately pay because they have no backup — and approximately 65% receive a working decryption key (but 35% do not).

What is a Trojan?

What is a Botnet?

What is Phishing? How to Recognize and Prevent Scams