SIM Security & IMSI Catchers
Mobile Network Security · Mobile Exploitation track
15 min read
In this module
SIM Card Internals
A SIM card is not a memory stick with a fancy outline. The Subscriber Identity Module is a tiny, hardened computer — its own CPU, RAM, ROM, persistent storage, and a miniature operating system built on the Java Card platform. Its job is to hold the subscriber's authentication credentials and run cryptographic operations on demand, all without ever exposing the secret key material to the phone it's plugged into.
Physical Architecture
A modern UICC (Universal Integrated Circuit Card - the formal name for the SIM card) contains:
- CPU: Typically a 16-bit or 32-bit processor (often ARM SecurCore or similar secure microcontrollers designed to resist physical attacks).
- ROM: Stores the card's operating system (the Java Card Virtual Machine and the card's base firmware).
- EEPROM/Flash: Stores the file system, applets, subscriber data, and authentication keys. Sizes range from 64 KB to several megabytes on modern cards.
- RAM: Working memory for active operations. Typically 4-16 KB.
- Crypto co-processor: Hardware acceleration for DES, 3DES, AES, and RSA operations.
The wire between SIM and phone runs the ISO 7816 smart-card standard over a slow serial interface. The phone fires APDU (Application Protocol Data Unit) commands at the SIM and waits for replies. There is no shortcut to the memory; everything goes through the APDU interface.
The Java Card Platform
Modern SIMs run the Java Card platform, which lets several independent applications (applets) coexist on a single card. The Java Card VM hands you:
- Application isolation: Each applet runs in its own sandbox. One applet cannot access another's data or code.
- Firewall enforcement: The Java Card runtime enforces access controls between applets at the bytecode level.
- Post-issuance loading: New applets can be loaded onto the SIM after it has been manufactured and deployed, using Over-The-Air (OTA) provisioning.
Standard applets on a SIM include:
- SIM/USIM applet: Handles authentication (A3/A8 for 2G, AKA for 3G/4G/5G), key storage, and network access.
- ISIM applet: Used for IMS (IP Multimedia Subsystem) registration, required for VoLTE.
- SIM Toolkit (STK) applets: Allow the operator to provide value-added services (mobile banking, interactive menus).
- Global Platform: The framework for managing applet installation, deletion, and lifecycle on the card.
When the SIM Itself Is the Target
That programmability has been attacked directly. At Black Hat 2013, Karsten Nohl showed that some SIMs answered a badly signed OTA command with an error message signed using the card's DES key. That handed an attacker a known plaintext and signature to crack the 56-bit key offline, and with the key they could install their own Java Card applets over SMS. In 2019 AdaptiveMobile disclosed Simjacker: crafted binary SMS messages driving the old S@T Browser applet on some SIMs, which would obey commands such as fetching the phone's location and texting it back, with no sign on the screen. WIBattack, published weeks later, did the same through the similar Wireless Internet Browser (WIB) applet. Both worked only where operators had shipped those legacy applets with no security level required on incoming messages, and operators can block the messages in the network.
Key Material: Ki and OPc
The most security-critical data on a SIM card is the Ki (the individual subscriber authentication key), a 128-bit symmetric authentication key that is:
- Generated by the mobile operator during SIM manufacturing.
- Stored in the SIM card's secure EEPROM.
- Stored in the operator's Authentication Centre (AuC).
- Never transmitted over any interface. All cryptographic operations using Ki happen inside the SIM card.
For 3G/4G/5G USIM applets, the key material includes:
- K: The 128-bit or 256-bit permanent key (equivalent to Ki).
- OPc: An operator-specific constant derived from OP (Operator Key) and K using AES. OPc is stored on the USIM and used in the Milenage algorithm for authentication.
- SQN: The sequence number counter, maintained in synchronisation with the AuC to prevent replay attacks.
The whole security model of SIM-based auth rests on one rule: Ki/K never leaves the card. When the network wants to authenticate a subscriber, it sends a challenge (RAND). The SIM crunches the response internally using its stored Ki, then ships back only the result. Phone and radio network never glimpse Ki. So even a totally rooted phone OS can't pull the auth key out — the SIM is a separate, hardened computer guarding it.
SIM Cloning: Historical Attacks
COMP-128v1 Vulnerability
The original 2G authentication algorithm, COMP-128v1, had a brutal flaw uncovered by Marc Briceno, Ian Goldberg, and David Wagner in 1998. Certain internal operations had a too-narrow output distribution, exploitable through a chosen-plaintext side-channel attack:
- The attacker sends approximately 100,000-150,000 carefully chosen challenges (RAND values) to the SIM card.
- By analysing the corresponding responses (SRES values), the attacker can deduce the Ki through differential cryptanalysis.
- The entire process takes several hours of physical access to the SIM card (using a smart card reader).
With Ki in hand, the attacker burns it (and the IMSI) onto a blank SIM and walks away with a cloned SIM. The clone registers on the network as the victim, snags their calls and SMS, and runs up the bill in their name.
COMP-128v2 and COMP-128v3 patched the algorithm. v3 also generates full 64-bit session keys, where v1 zeroed the last 10 bits and quietly weakened encryption. Most operators had moved off v1 by the mid-2000s.
Milenage Algorithm
3G, 4G, and 5G authenticate with Milenage, an AES-128-based design. It produces all five auth parameters (XRES, CK, IK, AK, AUTN-MAC) from the permanent key K, the operator constant OPc, and the random challenge RAND. Nobody has shown a chosen-plaintext break of Milenage on the scale of the v1 disaster.
Physical Attacks Against Modern SIMs
Despite algorithmic improvements, physical attacks against SIM cards remain a concern:
- Power analysis: Measuring the SIM's power consumption during cryptographic operations can reveal information about the key. Differential Power Analysis (DPA) and Simple Power Analysis (SPA) are well-established techniques.
- Electromagnetic analysis: Measuring EM emissions during computation.
- Fault injection: Introducing voltage glitches, clock manipulation, or laser pulses to cause computational errors that leak key information.
- Microprobing: Physically exposing the chip die and using conductive probes to read data from the EEPROM or bus lines. This is invasive and destructive but can extract key material from SIMs with weak physical countermeasures.
Modern SIMs ship with serious physical countermeasures: active mesh shields that scream when probed, glitch detectors, light sensors that flag decapping, randomised computation timing, and dummy operations layered on top of the real ones to confuse power analysis.
eSIM and iSIM
eSIM (Embedded SIM)
The eSIM (eUICC — embedded Universal Integrated Circuit Card) is a SIM chip soldered onto the device's PCB instead of slotted in. The trick is remote provisioning: the eSIM can download and activate subscriber profiles from any operator over the internet, no plastic-swapping required.
The eSIM architecture includes:
- eUICC: The embedded secure element that stores and executes subscriber profiles.
- SM-DP+ (Subscription Manager - Data Preparation): The server that prepares and encrypts subscriber profiles for download.
- SM-DS (Subscription Manager - Discovery Server): Helps the eUICC discover which SM-DP+ holds its pending profiles.
- LPA (Local Profile Assistant): Software on the device that manages the download and installation of profiles.
Security improvements over traditional SIM cards:
- Mutual TLS authentication: The eUICC and SM-DP+ mutually authenticate using certificates issued by the GSMA's Certificate Issuer (CI).
- Bound profile packages: Downloaded profiles are encrypted specifically for the target eUICC using its unique EID (eUICC Identifier) and cannot be intercepted and installed on a different device.
- Profile isolation: Multiple profiles on a single eUICC are isolated from each other by the Java Card firewall.
- Remote management: Operators can remotely enable, disable, or delete profiles, improving response to compromise.
iSIM (Integrated SIM)
iSIM keeps going down the integration road. The SIM stops being a chip at all and becomes a secure enclave inside the device's SoC, running the USIM applet from the same silicon as everything else.
iSIM advantages:
- Reduced physical attack surface: No separate chip to remove, probe, or replace.
- Lower manufacturing cost and space: Eliminates a discrete component.
- Hardware-level isolation: The SIM function runs in a Trusted Execution Environment (TEE) or dedicated secure processing element within the SoC.
The catch with iSIM: SIM and application processor now share silicon. Compromise the SoC's TEE or secure enclave and the SIM credentials are along for the ride. That's a meaningfully different threat model from a discrete card, where the physical separation acted as an extra wall.
IMSI Catchers (Stingrays)
An IMSI catcher — sold under brand names like Stingray (Harris Corporation) — is a device that masquerades as a real cell tower to vacuum up mobile traffic. Buyers include law enforcement, intelligence services, and, with falling hardware costs, organised crime.
How IMSI Catchers Work
An IMSI catcher leans on two convenient facts about cellular networks:
-
Phones chase the loudest signal. They pick whichever tower is screaming the strongest, which means an IMSI catcher parked next to the target only needs to outshout the local cell.
-
2G has one-way authentication. GSM lets the network authenticate the phone, but never asks the phone to authenticate the network back. So a catcher can claim to be any tower it wants, and the handset never bothers to check.
Against a modern phone the attack runs in three moves: push the handset off 4G, catch it on a fake 2G cell, then ask for what it wants. The next section explains the downgrade step in more detail.
Downgrade Attacks
Modern handsets on 3G/4G/5G mutually authenticate with the network, so a fake cell can't complete authentication or set up encryption. That doesn't stop identity harvesting outright: an LTE catcher can send an Identity Request before any authentication happens, and the phone replies with its IMSI, so 4G catchers still collect IMSIs. What it stops is the catcher keeping the phone and intercepting traffic. For that, downgrade remains the main route, forcing the phone down to 2G:
- The IMSI catcher broadcasts on 4G/5G frequencies and sends reject messages (e.g., RRC Connection Reject, Attach Reject with cause code indicating network congestion or incompatibility) to force the device off the 4G/5G network.
- Alternatively, it uses radio jamming on 3G/4G/5G frequencies, making those bands unusable.
- The device falls back to 2G (GSM), which lacks mutual authentication.
- The IMSI catcher then operates as a 2G base station, capturing the IMSI and controlling the connection.
Once the device is connected, the IMSI catcher can:
- Harvest the IMSI: Identify all devices in the area.
- Intercept calls and SMS: Act as a man-in-the-middle, relaying traffic through the legitimate network while recording it.
- Force no encryption: Send a Cipher Mode Command with A5/0 (no encryption), and the phone will comply.
- Track location: By monitoring which devices connect and at what signal strength.
IMSI catchers don't aim. Switch one on and you scoop up the IMSI and communications of every device in range. In a dense city street, that's hundreds or thousands of bystanders alongside any actual target. The bulk-collection problem is the loudest privacy objection to IMSI catchers, especially when they're deployed by police without warrants or under sweeping surveillance authorities.
Types of IMSI Catchers
IMSI catchers vary in capability:
- Passive catchers: Only listen to radio traffic without transmitting. They can detect IMSI numbers sent in cleartext during attach procedures but cannot force connections or downgrade encryption. Passive catchers are undetectable but limited in what they can capture.
- Active catchers (Stingrays): Transmit a fake base station signal, actively forcing devices to connect. These can intercept content and inject traffic but are detectable by their radio emissions.
- Semi-active catchers: Use a combination of passive listening and selective active interference (e.g., jamming specific frequencies to force downgrades while passively collecting on others).
Commercial IMSI catchers include Harris Corporation's Stingray and Hailstorm, plus offerings from Rohde & Schwarz and Septier. Prices land anywhere from the low tens of thousands to several hundred thousand dollars. Stripped-down DIY versions, built on a software-defined radio plus open-source stacks, run for a tiny fraction of that.
5G Countermeasures: SUPI and SUCI
5G tackles IMSI-catcher leakage head-on with the SUPI/SUCI mechanism introduced in Lesson 1. The cryptographic detail is worth a proper look.
SUPI (Subscription Permanent Identifier)
The SUPI is 5G's IMSI in everything but name. Same format (MCC + MNC + MSIN), same job: permanent subscriber identifier. The headline change is that the SUPI is never sent in cleartext over the air.
SUCI (Subscription Concealed Identifier)
When the device needs to identify itself to the network (during initial registration), it computes a SUCI from the SUPI using the ECIES (Elliptic Curve Integrated Encryption Scheme) profile specified by the home network:
- The home network's public key is provisioned on the USIM.
- The device generates an ephemeral key pair.
- The MSIN portion of the SUPI is encrypted using the shared secret derived from the ephemeral private key and the home network's public key.
- The SUCI contains the encrypted MSIN, the ephemeral public key, and the MCC/MNC (which remain in cleartext, as the serving network needs them to route the message to the home network).
- Only the home network (UDM/SIDF) can decrypt the SUCI using its private key.
Each SUCI is unique per registration attempt, because a fresh ephemeral key pair gets generated every time. An eavesdropper sees a different SUCI for the same subscriber on every attach, with no way to correlate them.
5G-GUTI (5G Globally Unique Temporary Identifier)
Once initial registration is done with the SUCI, the network hands the device a 5G-GUTI: a temporary identifier the device uses for everything that follows. The network rotates the 5G-GUTI on its own schedule. Between the encrypted SUCI on first contact and the rolling 5G-GUTI afterwards, the subscriber's permanent identity stays invisible, provided the conditions in the next paragraph hold.
Those conditions matter. SUCI only protects a phone registering on a standalone 5G core. Most 5G is still non-standalone (NSA), where the phone attaches through the 4G core and is identified the 4G way, IMSI included. The standard also allows a null scheme that sends the identifier unencrypted, used when the operator hasn't provisioned a home-network public key. And a catcher can still push the phone down to 4G or 2G.
5G's SUCI scheme uses Elliptic Curve Integrated Encryption Scheme (ECIES) to protect subscriber identity. The home network provisions its public key on the USIM. For each registration, the device generates a fresh ephemeral key pair, derives a shared secret with the home network's public key, and encrypts the subscriber identifier. Only the home network's private key can decrypt it. Because a new ephemeral key is used each time, each SUCI is cryptographically unlinkable - even an attacker who captures multiple SUCI values from the same device cannot determine they belong to the same subscriber. None of this applies under the null scheme or on non-standalone 5G, which still attaches through 4G.
Detecting IMSI Catchers
Several approaches exist for detecting the presence of IMSI catchers:
Signal Anomaly Detection
IMSI catchers exhibit detectable radio characteristics:
- Unusually strong signal: An IMSI catcher must overpower legitimate towers, resulting in abnormally high received signal strength from a previously unobserved cell.
- New Cell-ID: The appearance of an unfamiliar Cell-ID in a known area.
- Missing neighbouring cells: Legitimate towers broadcast information about neighbouring cells. An IMSI catcher may not accurately replicate this information.
- Abnormal LAC (Location Area Code): The IMSI catcher may use a LAC that differs from legitimate towers in the area.
Protocol Anomaly Detection
- Forced cipher downgrade: If the network suddenly instructs the phone to use A5/0 (no encryption) or A5/1 (weak encryption) in an area that previously used A5/3, this may indicate an IMSI catcher.
- Identity requests: Frequent IMSI requests in an area where the device is already registered are suspicious. Legitimate networks typically use the TMSI (Temporary Mobile Subscriber Identity) after initial registration.
- Authentication failure patterns: An IMSI catcher operating in 2G mode cannot produce valid authentication tokens for 3G/4G/5G. If a device is repeatedly rejected from 3G/4G and forced to 2G, this is suspicious.
- Rejection cause analysis: Specific reject cause codes (e.g., "network failure", "congestion") that are inconsistent with actual network conditions may indicate active downgrade attempts.
Detection Tools
Several applications and devices attempt to detect IMSI catchers:
- Android IMSI-Catcher Detector (AIMSICD): An open-source Android application that monitors cell tower information and alerts on anomalies. Limited by the information available through Android's telephony APIs.
- SnoopSnitch: An application by Security Research Labs that analyses radio signalling data on rooted Android devices with compatible Qualcomm chipsets to detect IMSI catcher activity.
- CryptoPhone: A hardened mobile phone by GSMK that includes baseband monitoring and alerts for cipher downgrade attacks and IMSI catcher indicators.
- Crocodile Hunter: An open-source tool that uses a software-defined radio to detect 4G IMSI catchers by monitoring for rogue base stations.
Limitations of Detection
Detection is genuinely hard. A well-built catcher mimics the radio behaviour of a real tower — correct neighbour lists, plausible signal strength, the lot. All detection comes down to anomaly hunting, and any decent attacker is busy minimising those anomalies. The arms race between catcher vendors and detector authors never really pauses.
The honest answer is the protocol-level fix: 5G's SUCI scheme removes the cleartext identity whether you spot the catcher or not. But that protection only holds on standalone 5G with a real protection scheme. Attach through a 4G core, as non-standalone 5G does, or get downgraded to an earlier generation, and you're back in catcher territory.