系统与基础设施gkbrk.com编辑精选
逆向分析酒店里的一段神秘 UDP 流
Reverse engineering a mysterious UDP stream in my hotel (2016)
2018 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
2016 年的一篇经典抓包逆向记录:作者在酒店网络里发现一条持续不断、来源不明的 UDP 流,经过分析头部、写脚本提取数据,最终确认它其实是酒店公共区域播放的背景音乐。文章完整展示了一个从困惑到定位协议的推理过程。
为什么经久不衰:它把一次酒店房间里的日常抓包变成了可复现的逆向小项目,既有趣又涉及多播、IGMP snooping、RTP 等至今仍常见的网络知识。
HN 评论精选
作者能收到这条流,很可能是因为多播被交换机当成广播泛洪,未启用 IGMP snooping。
这看起来像是酒店里有人配置了多播(挺聪明),但交换机不支持多播或没开 IGMP snooping。于是交换机收到包后不知道它是多播,就当成广播转发给所有接入端点。默认情况下,未配置 IGMP 的交换机会把多播流量转发到所有端口,由设备自行过滤不想要的流量。
cimnine查看英文原文
This seams like someone configured multicast (smart!) in the hotel but did not use multicast-aware switches or did not turn on IGMP snooping. So the switches retrieved the package, did not know it was multicast and delivered it as broadcast to all connected endpoints. > By default, a network switch which is not configured to use IGMP will forward Multicast traffic to all switchports on the switch. Devices will be responsible for filtering out the traffic that they do not want to receive. https://service.shure.com/Service/s/article/multicast-and-igmp-in-depth?language=en_US
补充了另一则相关故事:酒店按房间号分配 IP,导致灯光控制系统可被接管。
英文文章少了点东西,可惜。法语文章结尾还讲了另一个与灯光有关的故事:有人把笔记本电脑接在控制灯光的平板和网线之间,从而控制另一家酒店所有卧室的灯。有趣的是 IP 按房间号分配,例如 714 房的 IP 是 172.16.20.7.14。补充:第二个故事虽出现在法语文章里,但作者是 Matthew Garrett,英文版在链接中。
hivacruz查看英文原文
There is something missing from the English article, which is a shame. In the French article [1], he talks about another story at the end that implies lights. He was able to control lights from all the bedrooms in another hotel by putting his laptop between the tablets controlling the lights and the ethernet cables. Funny story, the IP adresses were assigned based on the bedroom number, eg the bedroom 714 had an IP of 172.16.20 7.14. Edit: my bad, the second story was included in the French article but was written by another person, Matthew Garrett. Here is the story in English: https://mjg59.dreamwidth.org/40505.html [1]: https://linuxfr.org/news/son-et-lumiere-a-l-hotel
推荐用 binwalk 自动按偏移寻找隐藏数据格式,比手写偏移脚本更省事。
我决定再写一个 Python 脚本,带偏移保存包数据:test1 跳过包中 1 字节保存,test2 跳过 2 字节,以此类推。有一个很有用的工具叫 binwalk,它会逐字节扫描二进制寻找类似签名。不确定在这里是否有效,但它在从文件里发现隐藏数据格式方面很棒,最初是为分析固件而做的。
bonyt查看英文原文
> I decided to write another Python script to save the packet data with offsets. This way it would save the file test1 skipping 1 byte from the packet, test2 skipping 2 bytes and so on. There is a useful tool called ‘binwalk’ that goes through a binary offset by offset looking for signatures like this. Don’t know if it would’ve worked here, but it’s pretty awesome for finding various data formats hidden in files, and was originally made for analyzing firmware files.
Wireshark 的 RTP 解码可作为捷径;同时提醒 RTP 头长度可能是 12 字节而非 8 字节。
不知道在 Wireshark 里选 “Decode as RTP” 是否能省下搞清头部情况的时间。不过我记得头部是 12 字节,不是 8 字节。
syntheticnature查看英文原文
One wonders if selecting "decode as RTP" in Wirehshark might've saved some time figuring out the header situation. Though I thought that was 12 bytes, not 8, offhand.
历次讨论
同类还值得读
TTY 揭秘(2008)
The TTY demystified (2008)
经典文章深入剖析了 Unix/Linux 中 TTY 子系统的工作原理,包括线路规程、终端驱动、信号与控制字符等机制。
系统与基础设施上首页 11 次 · 2009–2025linusakesson.net编辑精选为什么 GNU grep 这么快
Why GNU grep is Fast
FreeBSD 邮件列表上一篇广为流传的帖子,解释 GNU grep 为什么快:核心在于 Boyer-Moore 字符串搜索算法配合精心优化的内部循环和 I/O,让程序在搜索时“…
系统与基础设施上首页 9 次 · 2010–2022lists.freebsd.orgXplain:为普通人讲解 X11
Xplain – Explaining X11 for the rest of us
《Xplain》是作者(HN 用户 Jasper_)写的一系列 X11 长文,用他在浏览器中重建的 X11 绘图模型做交互演示,讲解 X11 的绘图模型与窗口系统设计。
系统与基础设施上首页 6 次 · 2013–2020magcius.github.io编辑精选旋风教程:为 Linux 创建极小 ELF 可执行文件(1999)
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (1999)
breadbox 写于 1999 年的经典教程,主题是如何为 Linux 手工构造并裁剪出体积极小的 ELF 可执行文件。
系统与基础设施上首页 6 次 · 2007–2025muppetlabs.comPostgreSQL 内部原理
The internals of PostgreSQL
《The Internals of PostgreSQL》是一本免费在线书籍,系统讲解 PostgreSQL 的内部实现,包括查询处理、并发控制、WAL、缓冲区管理等核心机制。
系统与基础设施上首页 5 次 · 2017–2025interdb.jp编辑精选