# SQL Slammer

**SQL Slammer**（又称蓝宝石蠕虫或SQL地狱蠕虫）是一种内存驻留型计算机蠕虫，于2003年1月25日被释放到互联网上，利用的是微软SQL Server 2000及微软SQL Server桌面引擎（MSDE）2000中SQL Server解析服务的一个缓冲区溢出漏洞。它感染了至少75,000台主机，实际数量可能远不止此，并在释放后10分钟内波及全球超过90%的易感主机，成为当时观察到的传播速度最快的计算机蠕虫。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup><sup> • </sup><sup>[2](https://www.everycrsreport.com/reports/RL32114.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 释放时间 | 2003年1月25日星期六，略早于协调世界时05:30开始感染主机<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> |
| 目标 | SQL Server 2000及MSDE 2000的SQL Server解析服务中的缓冲区溢出，通过UDP端口1434触达<sup>[3](https://seclists.org/cert/2003/3)</sup> |
| 大小 | 376字节蠕虫代码；含报头的单个404字节UDP数据包<sup>[4](https://www.caida.org/catalog/papers/2003_sapphire/)</sup> |
| 速度 | 倍增时间8.5 ±1秒；约3分钟后完整扫描速率超过每秒5500万次扫描<sup>[4](https://www.caida.org/catalog/papers/2003_sapphire/)</sup><sup> • </sup><sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> |
| 波及范围 | 至少75,000台主机被感染；10分钟内超过90%的易感主机<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> |
| 载荷 | 无；该蠕虫仅设计用于传播，危害来自网络过载和数据库服务器瘫痪<sup>[5](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Win32%2FSlammer)</sup><sup> • </sup><sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> |
| 补丁 | 微软安全公告MS02-039，最早于2002年7月24日发布，即爆发前六个月<sup>[5](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Win32%2FSlammer)</sup> |
| 估计损失 | 报道的损失估计在10.5亿至12.5亿美元之间<sup>[6](https://www.govinfo.gov/content/pkg/GAOREPORTS-GAO-04-706/pdf/GAOREPORTS-GAO-04-706.pdf)</sup> |

## 漏洞与蠕虫

该蠕虫利用的是SQL Server解析服务中的栈缓冲区溢出——该组件负责让SQL Server客户端查找命名实例所监听的端口；此服务运行在UDP端口1434上。<sup>[3](https://seclists.org/cert/2003/3)</sup><sup> • </sup><sup>[7](https://learn.microsoft.com/pl-pl/security-updates/securitybulletins/2002/ms02-039)</sup> 下一代安全软件公司的David Litchfield于2002年7月发现了这一底层弱点，微软在漏洞被公开披露之前发布了安全公告MS02-039中的补丁。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> 蠕虫来袭时，许多机器尚未安装该补丁。<sup>[8](https://www.sdsc.edu/pub/envision/v19.1/EnVision-Q1-2003.pdf)</sup>

Slammer是一种内存驻留型蠕虫：它从不将文件写入磁盘，仅存在于被感染的SQL Server进程的内存中。微软的威胁百科指出，它被设计用于传播，似乎不含任何附加载荷。<sup>[5](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Win32%2FSlammer)</sup> 尽管如此，入侵仍使远程攻击者能够以本地SYSTEM用户身份在受害系统上执行任意代码。<sup>[3](https://seclists.org/cert/2003/3)</sup>

## 为何传播如此之快

Slammer的速度源于其扫描方式。由于SQL Server漏洞可通过向UDP端口1434发送单个数据包来利用，蠕虫无需等待潜在受害者的任何响应即可发送扫描。因此，其扫描器仅受限于每台被入侵机器连接互联网的带宽，而非网络延迟。<sup>[4](https://www.caida.org/catalog/papers/2003_sapphire/)</sup>

**与红色代码的比较。** 2001年的红色代码蠕虫通过多线程打开的TCP连接传播，每个线程必须等待SYN/ACK回复或超时后才能再次扫描，因此很快便受限于延迟。相比之下，Slammer受限于带宽，传播速度快了近两个数量级，尽管它感染的机器可能更少。红色代码大小为4 KB，尼姆达为60 KB，都远大于Slammer的376字节。<sup>[4](https://www.caida.org/catalog/papers/2003_sapphire/)</sup> 红色代码的种群倍增时间为37分钟，而Slammer为8.5秒。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup>

其增长遵循有限种群中初始指数传播的经典逻辑斯蒂形式，即随机常数传播模型。该模型与观测数据吻合良好，直到探测速率骤然趋平——带宽饱和以及网络在极端负载下关闭，减缓了蠕虫自身的增长。<sup>[4](https://www.caida.org/catalog/papers/2003_sapphire/)</sup> 理论上，一台拥有100 Mb/s连接的被感染机器每秒可产生超过30,000次扫描；直接观测到的最大探测速率为每秒26,000次扫描，而在早期增长阶段，全网每份蠕虫副本的平均探测速率约为每秒4,000次。<sup>[9](https://skerry-tech.com/papers/2003-slammer.pdf)</sup>

## 影响

尽管该蠕虫不携带恶意载荷，但其扫描流量使网络饱和，并导致数据库服务器停止运行。广泛报道的中断包括华盛顿州贝尔维尤的911紧急数据录入终端故障、[美国银行](https://www.edgepedia.org/zh/bank-of-america)ATM网络的部分瘫痪、航班取消以及选举受到干扰。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> 美国银行约13,000台取款机在ATM与数据中心之间的加密通信速度变得极为缓慢后被迫关闭；大陆航空公司的部分航班因在线售票和电子自助终端无法处理订单而取消；华盛顿州的紧急调度员数小时内不得不改用纸笔工作。<sup>[10](https://www.washingtonpost.com/archive/politics/2003/01/29/internet-worm-unearths-new-holes/1f9b461a-332a-47bc-8f30-ece089b6953d/)</sup>

该蠕虫还侵入了工业控制网络。据[核管理委员会](https://www.edgepedia.org/zh/nuclear-regulatory-commission)证实，Slammer进入了位于奥克港的俄亥俄州戴维斯-贝斯核电站的一个专用网络，导致一套安全监测系统停运近5小时；该电站的过程计算机也发生故障，耗时约6小时才恢复上线。据报道，该蠕虫还影响了至少另外五家公用事业公司控制网络上的通信。<sup>[11](https://gao.justia.com/department-of-homeland-security/2004/3/critical-infrastructure-protection-gao-04-628t/)</sup> 微软自身也未能幸免：该公司已于2002年7月发布了补丁，但媒体报道称蠕虫感染了微软自己的一些未打补丁的系统。<sup>[6](https://www.govinfo.gov/content/pkg/GAOREPORTS-GAO-04-706/pdf/GAOREPORTS-GAO-04-706.pdf)</sup>

一家总部位于英国的安全公司在爆发后数日内估计经济损失超过10亿美元，使其成为当时最具破坏性的恶意软件攻击之一；美国总审计局后来的报告引用的估计数字在10.5亿至12.5亿美元之间。<sup>[12](https://mcpmag.com/articles/2003/01/30/group-estimates-slammer-damage-at-1-billion.aspx)</sup><sup> • </sup><sup>[6](https://www.govinfo.gov/content/pkg/GAOREPORTS-GAO-04-706/pdf/GAOREPORTS-GAO-04-706.pdf)</sup>

## 遏制与响应

CERT/CC于2003年1月25日发布了CA-2003-04号公告，以SQLSlammer、W32.Slammer和蓝宝石等名称标识该蠕虫，并敦促SQL Server 2000和MSDE 2000系统的管理员安装补丁。公告指出，该蠕虫的活动很容易通过小型UDP数据包识别——据报道大小为376至410字节，从看似随机的IP地址发往端口1434/udp。<sup>[3](https://seclists.org/cert/2003/3)</sup> 有效的遏制措施包括过滤发往UDP端口1434的进出流量，并分阶段将受感染的计算机从网络中隔离。<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S1353485803003106)</sup>

由于蠕虫在数分钟内便使网络饱和，在初始传播期间不可能进行任何人工响应；研究人员后来论证，这种在不到半小时内感染数万台主机的时间尺度，使得针对此类蠕虫的人工干预不可行。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup><sup> • </sup><sup>[14](https://www.sciencedirect.com/science/article/abs/pii/S1389128607000710)</sup>

## 蠕虫的技术缺陷

反汇编显示，Slammer使用形如 \( x' = (x \cdot a + b) \bmod m \) 的线性同余伪随机数生成器来选择攻击目标，而其实现包含三处严重错误：由于二进制补码转换错误，参数 \( b \) 的值比正确值大1；对 \( a \cdot X_i \) 项做了减法而非加法；以及使用OR指令而非XOR来清除关键寄存器。这些缺陷使扫描地址的分布发生偏斜，增加了研究人员分析蠕虫传播的难度。<sup>[15](https://www.usenix.org/legacy/event/imc05/tech/full_papers/kumar/kumar_html/)</sup><sup> • </sup><sup>[9](https://skerry-tech.com/papers/2003-slammer.pdf)</sup>

## 遗产

Slammer首次在真实世界中展示了高速蠕虫的能力，研究人员Stuart Staniford、Vern Paxson和Nicholas Weaver此前已从理论上预测了这一点。<sup>[1](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)</sup> 分析人士强调，如果该蠕虫携带恶意载荷、利用更普遍存在的漏洞或针对更流行的服务，其影响可能会更加严重。<sup>[16](https://www.gao.gov/assets/a157542.html)</sup> 这一事件成为补丁管理的标准案例：该漏洞的补丁已发布六个月，但未打补丁的系统——包括微软自己的系统——仍被攻陷。二十年后，安全从业者仍引用这一教训：一台能够访问网络中其他服务器的未打补丁的SQL Server，仍足以在内部传播感染。<sup>[6](https://www.govinfo.gov/content/pkg/GAOREPORTS-GAO-04-706/pdf/GAOREPORTS-GAO-04-706.pdf)</sup><sup> • </sup><sup>[17](https://www.brentozar.com/archive/2023/01/the-20th-anniversary-of-the-sql-slammer-worm/)</sup>

## References

1. [Moore et al., "Slammer: An Internet Superfast Spread" (CAIDA, Sapphire/Slammer analysis)](https://www.caida.org/catalog/papers/2003_sapphire2/sapphire/)
2. [CRS Report RL32114, Botnets, Cybercrime, and Cyberterrorism: Vulnerabilities and Policy Issues for Congress](https://www.everycrsreport.com/reports/RL32114.html)
3. [CERT Advisory CA-2003-04: MS-SQL Server Worm, CERT/CC, January 25, 2003](https://seclists.org/cert/2003/3)
4. [Moore, Paxson, Savage, Shannon, Staniford, Weaver, "The Spread of the Sapphire/Slammer Worm", CAIDA, 2003](https://www.caida.org/catalog/papers/2003_sapphire/)
5. [Win32/Slammer threat description, Microsoft Security Intelligence](https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Win32%2FSlammer)
6. [GAO-04-706, Information Security: Continued Action Needed to Improve Software Patch Management](https://www.govinfo.gov/content/pkg/GAOREPORTS-GAO-04-706/pdf/GAOREPORTS-GAO-04-706.pdf)
7. [Microsoft Security Bulletin MS02-039](https://learn.microsoft.com/pl-pl/security-updates/securitybulletins/2002/ms02-039)
8. [EnVision Science Magazine, Q1 2003, San Diego Supercomputer Center](https://www.sdsc.edu/pub/envision/v19.1/EnVision-Q1-2003.pdf)
9. ["Inside the Slammer Worm", IEEE Security & Privacy Magazine, 2003](https://skerry-tech.com/papers/2003-slammer.pdf)
10. ["Internet Worm Unearths New Holes", The Washington Post, January 29, 2003](https://www.washingtonpost.com/archive/politics/2003/01/29/internet-worm-unearths-new-holes/1f9b461a-332a-47bc-8f30-ece089b6953d/)
11. [GAO-04-628T, Critical Infrastructure Protection: Department of Homeland Security](https://gao.justia.com/department-of-homeland-security/2004/3/critical-infrastructure-protection-gao-04-628t/)
12. ["Group Estimates Slammer Damage at $1 Billion", Microsoft Certified Professional Magazine, January 30, 2003](https://mcpmag.com/articles/2003/01/30/group-estimates-slammer-damage-at-1-billion.aspx)
13. ["The MS-SQL Slammer Worm", ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S1353485803003106)
14. ["Defending against hitlist worms using network address space randomization", ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S1389128607000710)
15. [Kumar et al., USENIX Internet Measurement Conference 2005](https://www.usenix.org/legacy/event/imc05/tech/full_papers/kumar/kumar_html/)
16. [GAO-04-321, Technology Assessment: Cybersecurity for Critical Infrastructure Protection](https://www.gao.gov/assets/a157542.html)
17. ["The 20th Anniversary of the SQL Slammer Worm", Brent Ozar Unlimited, January 2023](https://www.brentozar.com/archive/2023/01/the-20th-anniversary-of-the-sql-slammer-worm/)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Malware and endpoint threats › Named malware specimens

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sql-slammer

English original: https://www.edgepedia.org/sql-slammer
