安全与隐私bamsoftware.com
更强的 zip 炸弹
A better zip bomb
2019 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
David Fifield 介绍的“更好的 zip 炸弹”:一个仅 42KB 的 ZIP 文件,解压后可膨胀到 PB 级别。文章详细讲解了其构造原理——利用 ZIP 格式中重叠文件和中心目录的特性,使多个文件共享同一压缩数据,并讨论了各类 zip 炸弹的防御方法。
为什么经久不衰:它既是格式解析的精彩技术写作,也提醒开发者处理不可信压缩文件时的真实风险,多年后仍是安全领域的经典参考。
HN 评论精选
分享了一个能防御 zip 炸弹的解码器实践,并验证它能识别文中的样本
我最近为扫描邮件附件做了一个 zip 校验和解码器 @ronomon/zip(尚未开源)。它防御了过高压缩比、本地与中心目录头不匹配、歧义文件名、目录穿越和符号链接穿越,以及任何可能利用 zip 实现差异的歧义内容——比如有的实现从前向后解码,有的从后向前。最重要的是,它对任何偏离 zip 格式的情况(包括重叠、稀疏、缓冲区溢出等)都会直接拒绝。至少它把作者的三个样本全部检测为恶意。
jorangreef查看英文原文
I recently created a zip validator and decoder for scanning email attachments, @ronomon/zip. It's not yet open-sourced but it has defenses against excessive compression ratios, mismatching local and central directory headers, ambiguous filenames, directory traversals and symlink traversals, and anything ambiguous that could exploit differences in zip implementations, e.g. some zip implementations decode from the front while others decode from the back. Most importantly, it balks at deviations from the zip format, including any kind of overlapping or sparseness, buffer bleeds etc. At least it detected all three of the author's samples as malicious.
实测连浏览器和杀毒软件都会中招,侧面印证了炸弹的威力
非常强大!很多接触这个文件的程序都出了问题。仅仅在 Chrome 里下载它就引发了麻烦:Chrome 开始把它解压到临时文件夹(大概是做恶意软件扫描?),磁盘迅速被填满。Windows 10 的 Defender 也做了同样的事,不过几秒后被合理的限制中止了。
r1ch查看英文原文
Pretty powerful! Lots of breakage with things that touch this file. Simply downloading it in Chrome caused issues, Chrome began extracting it to a temp folder (presumably for some malware scanning?) and quickly started filling the disk. Windows 10 then began doing the same thing for Windows Defender, but some sane limits aborted it after a few seconds.
提出用 zip 炸弹反击恶意爬虫的思路
有没有办法自动把这个发给 SSH 爆破者/目录扫描机器人?
curiousgal查看英文原文
Is there a way to automatically send this to SSH spammers/directory scanning bots?
历次讨论
同类还值得读
非法素数
Illegal prime
维基百科条目,介绍“非法素数”:某些素数之所以被称为“非法”,是因为它们经特定编码后,恰好对应一段被法律禁止传播的数据——最著名的是 DVD 解密程序 DeCSS 的代码,有人把…
安全与隐私上首页 5 次 · 2010–2021en.wikipedia.org编辑精选关于 /dev/urandom 的常见误区
Myths about /dev/urandom
(Thomas Hühn 撰写,2014 年首发并持续更新)逐条反驳关于 /dev/urandom 的常见误解:它与 /dev/random 使用的是同一个 CSPRNG,一旦完…
安全与隐私上首页 5 次 · 2014–20202uo.de编辑精选AES 高级加密标准火柴人图解
A Stick Figure Guide to the Advanced Encryption Standard (AES)
一篇用火柴人漫画形式讲解 AES(高级加密标准)算法的经典科普文章。
安全与隐私上首页 5 次 · 2009–2022moserware.com编辑精选指纹是用户名,不是密码
Fingerprints are Usernames, not Passwords
作者(eCryptfs 维护者、Ubuntu 安全工程师)认为指纹等生物特征是公开、不可更改的标识,应视作用户名而非密码,不能当作秘密凭据用于认证。
安全与隐私上首页 4 次 · 2013–2017blog.dustinkirkland.comHTTPS 连接的最初几毫秒(2009)
The First Few Milliseconds of an HTTPS Connection (2009)
逐毫秒拆解一次 HTTPS 连接建立时发生了什么,重点讲 TLS 握手、证书验证、RSA 签名与密钥协商等机制,面向不熟悉该领域的读者。
安全与隐私上首页 4 次 · 2009–2020moserware.com编辑精选