安全与隐私github.com
Masscan:五分钟扫遍整个互联网的 TCP 端口扫描器
Masscan: TCP port scanner, scanning entire Internet in under 5 minutes
2013 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这个 GitHub 仓库是 Masscan 的源码与文档:一款开源高速 TCP 端口扫描器,宣称能在 5 分钟内扫描整个互联网。它依靠自定义 TCP/IP 栈和无状态扫描等技术实现极高吞吐,常被用于安全研究与大规模资产探测,但也因高速率可能压垮网络、触发 ISP 封禁而伴随争议。
为什么经久不衰:它把全网级端口扫描的速度和成本压到极低,工程实现很有学习价值,同时也是讨论扫描滥用、网络影响与 ISP 封禁的经典案例,因此多年反复被提起。
HN 评论精选
作者用约 13 台按小时租的 VPS、不到 10 美元在一夜内完成全 IPv4 22 端口扫描与 SSH 信息采集,并强调随机化有助于避开告警。
一个非常好、构建得很扎实的工具。它很出色地把序列号用于无状态发送/接收(SYN cookies),源码也文档齐全,读起来很舒服。我 2016 年曾用它扫描整个 IPv4 的 22 端口,得试验速率限制来避免触发告警、被 VPS 供应商转发投诉;巧妙的 IP+端口随机化对此帮助很大。然后对约 2200 万个有响应的 IP 跑 ssh-keyscan,提取并分析约 1500 万条 SSH banner 和公钥,其中不少因 Debian PRNG 等问题是坏的。大部分扫描和提取应该是一夜完成,用了约 13 台按小时租的 VPS,总花费不到 10 美元,投诉很少。
wfn查看英文原文
A very nice and well-built tool. Excellent use of sequence numbers for stateless send/receive (SYN cookies): https://github.com/robertdavidgraham/masscan/blob/master/src/main.c#L526-L534 (very well-documented source too, a pleasure to read). I once (2016) used it to scan port 22 on the whole ipv4 (had to experiment with rate limits to not trigger alarms and get complaints forwarded by my VPS provider; the clever ip+port randomization technique helps a lot with that). Then took the ~22m (iirc) IPs which responded and ran ssh-keyscan on them to extract and analyze some ~15m ssh banners and public keys (a bunch of them broken, through debianized PRNG etc.) I think most of the scanning + extraction was done overnight, via ~13 VPS rented hourly (whole thing cost < $10, and very few complaints). Fun times :) I should write it up some time, and do it again.
过高扫描速率可能造成严重网络故障甚至打挂企业网络,使用时必须谨慎。
警告。Masscan 是我见过的最好的扫描器。我们也曾因速率限制设得太高,把整个企业网络打挂。所以面对 masscan 和它的威力要小心。我们的渗透测试人员 6 个月后也做了同样的事。托管服务商无法解决导致防火墙在快速 masscan 触发时被 DoS 的路由表环路。
unixhero查看英文原文
Warning. Masscan is the best scanner I have ever seen. We have also managed to take down the entire corporate network by using it with a too high rate limit. So tread lightly around massscan and its power. Our pentesters did the same 6 months later. The managed service provider is not able to solve the routing table loop which causes the firewall to DOS when a rapid masscan is triggered.
大规模端口扫描容易被 ISP 检测并封禁,且常违反服务条款。
问题:到底怎么运行它才不会被封?我试这类扫描器时,被本地家庭 ISP 和 Linode 服务器封得很厉害。大规模端口扫描很容易被追踪,而且通常违反所有 ISP 的服务条款。
LeonidBugaev查看英文原文
Question: how do you actually run it without getting banned? I've got banned pretty hard by both my local home ISP and using Linode servers, when tried such scanners. Mass port scanning is easy to track, and it usually forbidden all ISP ToC.
评论认为其自定义 TCP/IP 栈体现了出色的工程能力,README 也值得一读。
这是一件了不起的工程作品。读 README 真的很有趣,自定义 TCP/IP 栈是天才之举。
NelsonMinar查看英文原文
This is a hell of a piece of engineering. Really fun to read the README, a custom TCP/IP stack is genius.
历次讨论
同类还值得读
非法素数
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编辑精选