/nl_img1

当你坐在行驶的火车上参加你的 Zoom 会议时,你的移动设备(即 User Equipment, UE)必须在你进出信号范围时无缝切换基站。 这个概念称为mobility(移动性),仍然是移动网络的核心要求,但它也是一个核心安全漏洞。

你看,你可能就在悠闲地在火车上开会时被黑了,而且你永远不会知道。

GSM (也就是更广为人知的 2G) 协议存在一个安全漏洞,该漏洞以明文形式暴露用户的个人标识符 (IMSI),从而允许进行归属和地理定位。 这个漏洞也存在于 UMTS (又名 3G) 规范和 LTE (4G) 规范中。 虽然该漏洞最终在 NR (5G) 中得到了解决,但它并不完美,仍然是一个可利用的 5G 网络漏洞……也是我最喜欢的网络安全话题。

在本文中,我将介绍这个长期存在的安全漏洞,也就是所谓的 IMSI catcher,讨论关于 2G-4G IMSI catcher 的一些高级技术方面,最后讨论 5G 安全性的改进以及 5G IMSI catcher 的可能性。

什么是 IMSI?

蜂窝网络上的每个帐户都有一个唯一的标识符,用于将 SIM 卡连接到信用卡,该标识符称为 International Mobile Subscriber Identity (IMSI,发音为“IM-zee”)。 该号码包含 3 条信息:发行网络运营商的 Mobile Country Code (MCC)、发行网络运营商的 Mobile Network Code (MNC) 以及仅存在于该 SIM 卡的唯一号码。 IMSI 最终用于确保你已支付账单并且允许你注册到网络。

什么是 IMSI catcher?

IMSI catcher 是一种收集蜂窝信号并解码数据包以访问和保存 IMSI 的工具。 IMSI catcher 有两种类型:主动式和被动式

Diagram showing a person with a cell phone that's interacting with an IMSI catcher because it has a stronger signal than a nearby 5G cell tower. So, the IMSI catcher is directly catching the phone's IMSI. This illustrates Active IMSI Catching.

主动式 IMSI Catcher

主动式 IMSI catcher 也称为基站模拟器或恶意基站,是两者中更有效的一种。 缺点是它需要 RF 传输,这违反了 FCC 法律(以及国际同等法律)并且是可检测的。

Diagram showing a person with a cell phone that's interacting with a 5G tower, and the IMSI catcher is listening in, and thus catching the phone's IMSI. This illustrates Passive IMSI Catching.

被动式 IMSI Catcher

这种类型需要更多的规划,并且可能无法产生那么多的 IMSI。 但是,它是无法检测到的(从 RF 的角度来看),并且反映了网络的真实情况,而没有干扰。

用一个类比来说,主动式 IMSI catcher 就像穿着官方制服站在杂货店外面,要求人们出示许可证来记下号码; 在有徽章的人出现之前,它可能会起作用。

另一方面,被动式 IMSI catcher 就像坐在收银台旁边的单向玻璃后面,拍摄每个人打开钱包时许可证的照片一样——难以检测且不违法,因为它就在眼前(可能……我不是律师,这也不是法律建议)。

IMSI catcher 是如何工作的?

(注意:本文的剩余部分仅指被动式 IMSI catcher。)

UE(User Equipment,例如你的智能手机)不断执行选择、重选和注册程序,以保持移动性并访问蜂窝网络。 这些过程在技术层面上非常复杂,但从概念上讲却非常简单。

  1. 在根据测量和控制信息选择一个蜂窝基站后,UE 发送一个请求以连接到该蜂窝基站。
  2. 如果允许 UE 连接,则蜂窝基站和 UE 来回几次以协商一些参数,最后 UE 发送其 IMSI。
  3. 蜂窝基站开始与网络进行新的来回通信,以确定 IMSI 是否有效、激活和已付款。
  4. 如果允许 UE 连接到网络,则蜂窝基站启动身份验证过程,并且从此时开始的所有内容都已加密。

如果不是因为移动性,那么故事就到此为止了。 同样,移动性既是一个功能,也是一个网络漏洞。 每次 UE 切换到另一个基站时,它都必须重复注册过程。 (好吧,不是每次,但每次 UE 处于 IDLE 模式时,都是这样。切换是另一个完全不同的讨论。)

为了最大限度地减少 UE 使用未加密的 IMSI 注册的次数,网络会颁发一个 Temporary Mobile Subscriber Identity (TMSI,发音为“TIM-zee”)。 TMSI 是通过加密连接颁发的,并且与网络侧的 IMSI 相关联。 为了本文的目的,我们将 TMSI 视为一个不可利用的解决方案(……事实并非如此)。

有 3 种方法可以捕获 IMSI: LOCATION, LOCATION, LOCATION!

如前所述,开发被动式 IMSI catcher 的技术方面非常复杂。 (如果你对此主题感兴趣,请发送电子邮件至 hello@zetier.com。)简化的解释是:有时手机以明文形式发送 IMSI,如果你在正确的时间和正确的地点进行收集,你就会捕获它们。 相反,即使你拥有完美的 IMSI catcher,但你所在的地点不正确,你也永远无法捕获 IMSI。

那么,在哪里可以捕获 IMSI?

在 2G 和 3G 协议中,IMSI 在以下 3 种情况下以明文形式发送:

  1. Initial attach(初始连接)
  2. Crossing a Location Area Code (LAC) boundary(跨越 Location Area Code (LAC) 边界) (注意:根据系统配置,TMSI 可以在 LAC 之间共享)
  3. Location Update Request (LUR)(位置更新请求)

此外,这些协议利用下行链路中心频率周围的频谱进行 Radio Resource Control (RRC),这意味着无线电只需要调谐到单个频率即可获得这些特定消息的下行链路和上行链路,这非常方便。 然而,我最喜欢关于日益减少的 2G/3G 基站的一点是,初始连接程序包括 inter-RAT (Radio Access Technology ) 重选。 这意味着你可以在 UE 回退到 2G 或 3G 的任何 LTE 盲区中获取 IMSI。

4G 就不那么方便了:上行链路和下行链路通道是必需的,并且它们必须部分同步。 这最终是一个可以通过计算能力克服的技术问题。 此外,初始连接实际上是可靠地获取 IMSI 的唯一可行选项,但它非常不可靠。 可以在 PLMN 边界(例如,国界、机场、漫游边界)和较旧的 RAT 边界(例如,从 2G 或 3G 基站重选边界)上找到 4G IMSI。 如果 4G/LTE 引起了你的好奇心,你可能想要探索 IMSI extractor

5G 最终解决了明文 IMSI 网络漏洞。 IMSI 现在被称为 Subscription Permanent Identifier (SUPI,发音为“SOUP-ee”),并且唯一标识符部分使用公钥密码术进行加密,以创建 Subscription Concealed Identifier (SUCI,发音为“SU-shi”)。

总而言之,5G SUPI 和 SUCI 充分解决了 5G 网络漏洞:SUCI 以明文形式传输(而不是 5G SUPI),但 SUCI 不可用于识别或地理定位。

那么就这样了吗? IMSI catcher 已经死了?

从纯粹的学术角度来看,IMSI catcher 在完全修补的、全功能的、全网络范围的 5G 部署上可能变得不切实际。 但这种完美仍然极不可能,我预计会出现几个机会:

  1. 5G 是一个多阶段的推广,任何 5G Non-Standalone (NSA) 部署都具有与 4G 相同的所有漏洞!
  2. 从 5G 降级到 4G 支持切换(即,TMSI 在 RAT 之间传递),但我多年来见过太多配置错误的基站,所以我认为降级是容易受到攻击的。
  3. 移动运营商也可能根本不使用 SUCI。 我不确定这种漏洞在野外有多普遍,但我相信它不是零。

如何阻止 IMSI catcher

没有办法阻止 IMSI catcher。 你可以做的唯一简单的事情,并且可能会产生影响,是将你的网络优先级设置为 5G-SA,但大多数手机不支持此功能。

如果你真的很偏执,请保持在飞行模式,直到你处于非常密集的覆盖区域。 虽然这远非保证,但 IMSI catcher 更有可能位于信号质量受损的区域。

最后,你可以将手机放在 Faraday 袋中,它可以提供高达 100 dB 的信号衰减。

总会有漏洞存在

蜂窝移动性将始终具有内在的漏洞。 3GPP 5G-NR 规范是对抗归属攻击的巨大改进,这绝对对用户有利。 至于 CNE 开发人员,它已将问题从技术转移到地理位置。 主动式 IMSI catcher 和主动式干扰仍然是可行的选择,但它们与以往一样具有相同的风险。 从好的方面来看,仍然有工作要做,而且这是一项非常有趣的工作!

如果你对此领域感兴趣,请随时与我们联系,或者探索我们在蜂窝领域的 OSS:Bungeegum,我们用于模拟真实世界条件的免费 Android 测试工具,以及 Lariat,另一个用于处理各种 Android 设备的开源测试工具,这两者都是在 Zetier 内部开发的。

插图由 Rebecca DeField 创作。

觉得这篇文章很有趣?

在 HackerNews 上分享 →

LinkedIn Facebook X Reddit Hacker News

你的下一次阅读

Oops, there goes the OPSEC

Breadcrumbs are left throughout computer systems that hackers can use to track attribution or recover sensitive information that was unintentionally …

February 2024 watercooler topics

Recent conversations around the Zetier watercooler covered a range of topics in IT, cybersecurity, and technology innovations. Our discussions sp…

Meet Snipey: Snipe-IT asset management

Introduction Introducing Snipey: The Ultimate Command-Line Companion for Snipe-IT Asset Management Managing IT assets effectively is crucial fo…

December 2023 watercooler topics

At Zetier, throughout the month we share news and articles of interest over Slack. This serves as a virtual watercooler for us as our team is spread a…

Using JTAG to dump parallel NOR flash

Reading Parallel NOR Flash with JTAG Still have that old development kit kicking around from college or high school? Yeah, me too. Don't have a pr…

Android testing with Lariat

Introducing Lariat Howdy partners! At Zetier, we realize Android testing can be difficult, tedious, and less fun than walking 20 miles with a pebb…

Sharing our knowledge

Sharing knowledge is in Zetier’s corporate DNA, and this expresses itself in multiple ways. For example, we participate in conferences, we ho…

Power up your power supplies

In cyber vulnerability research and reverse engineering, professionals frequently encounter hardware with specific power requirements not met by …

2023 corporate offsite

Zetier’s team are scattered across the country in nine states, from New York to California to Florida. We communicate daily on the phone, by …

Poor man’s 3D tomography

Overview Reverse engineering printed circuit boards is generally regarded as a time-intensive and sometimes difficult process as the interconnect …

CodeQL for security research

What is CodeQL CodeQL is a declarative query language for code, currently maintained by GitHub. GitHub maintains a decently sized set of queries t…

Speedrunners = vulnerability researchers

Thousands of video game enthusiasts are developing experience in the cybersecurity industry by accident. They have a fun hobby, pouring over the deta…

The mystery of $0 HP printers

Recently, I picked up a few printers from Craigslist... for the unbeatable price of $0. My goal was to use them for a trade-show simulation network, …

Making the podium at DEFCON 2024

Editor's Note: This post is written from the first-person perspective of a Zetier team member, reflecting on his experience at the DEFCON 2024 confer…

Our 2024 open-source contributions

Open-source contributions play a critical role in advancing technology, and this year, our team caught – and fixed – bugs in a variety of project…

Is it hard to port Frida on OpenWrt?

Frida “just works” on many common platforms: Windows Linux, glibc-based Android macOS and iOS But what about porting it to your …

Android testing with Bungeegum

Comprehensive testing capabilities are vital for building robust and secure Android applications in the world of Android cyber tool development. O…

A small box contains a big surprise

While scrolling mischievously at midnight on eBay, I came across an item of interest. It was obviously sealed deliberately, military-related, and fro…

Being a reservist at Zetier

Getting a job while in the reserves is pretty easy. Keeping one while being activated and while life is happening is another story. Zetier is a compa…

Something fishy happens when compiling Tshark with Lua

Wireshark has long been a standard tool for engineers across many disciplines. With its rich feature set, protocol support, and outstanding GUI,…

flaShMASH your dumps

While inspecting an electrocardiograph (ECG) device from Spacelabs (specifically the 90496 shown in Figure 1) I ran into a little issue. Upon dum…

Oops, there goes the OPSEC

Breadcrumbs are left throughout computer systems that hackers can use to track attribution or recover sensitive information that was unintentionally …