CH5 — Subscriber Harvest
Same UDR endpoint as CH2 — different target, different lesson. This time you enumerate which subscriber has the flag. This is bulk harvesting.
CH5 vs CH2 — What Is Different?
CH5 uses the same UDR endpoint as CH2 — /nudr-dr/v1/subscription-data/.
The difference is not the vulnerability itself but what the challenge teaches. In CH2, you were handed
the IMSI and asked to fetch one subscriber's credentials. In CH5, you must determine which
IMSI has the flag. That distinction is the entire lesson: unauthenticated UDR access is not
just a targeted credential theft risk — it is a bulk subscriber surveillance capability.
Credential Theft — Targeted
Subscriber Harvest — Bulk
imsi-999700000000088.
But understanding why this challenge exists means understanding what happens when an attacker does not
have the hint — they iterate every possible IMSI in the network's PLMN range and harvest every K key
returned. With no OAuth2 on the UDR, that is a single loop over HTTP/2 requests. No rate limiting.
No authentication. Every subscriber exposed.
SUPI Disclosure at Scale
A SUPI (Subscription Permanent Identifier) is the 5G successor to the IMSI — the permanent identity of a subscriber. The UDR endpoint that returns authentication data also reveals the SUPI, the K key, the OPc parameter, and the sequence number for every subscriber it is queried about. Without OAuth2 enforcement, there is no constraint on who can ask or how many times.
A carrier network may have millions of subscribers. Their IMSIs follow a predictable structure: MCC + MNC + MSIN (Mobile Subscriber Identification Number). Given the PLMN (999-70 in this lab), an attacker can enumerate all valid IMSIs and query the UDR for each one. The result is a complete copy of the subscriber database — every K key, every OPc, every authentication secret in the network.
The Attack
The attack is identical to CH2 at the HTTP level. The difference is that in CH5 the IMSI is provided
as a challenge hint — because the real point is understanding what bulk enumeration looks like, not
spending the workshop session iterating IMSIs. Query the UDR authentication subscription endpoint
for imsi-999700000000088. The encPermanentKey value in the response is the flag.
--http2-prior-knowledge
to every curl command or you will receive no response. The UDR is at 10.100.200.50:7777.
TWIN{},
and submit. The value for IMSI imsi-999700000000088 differs from the CH2 subscriber —
each provisioned subscriber has a unique K key.
| Field | What It Is | CH5 Context |
|---|---|---|
| encPermanentKey | K — the permanent subscriber key (128-bit / 32 hex chars) | This is the flag. In bulk harvest, this field is returned for every IMSI queried — no rate limiting, no auth. |
| encOpcKey | OPc — operator-specific parameter for MILENAGE | Required alongside K for a complete software SIM clone. Also returned with no auth check. |
| authenticationMethod | 5G_AKA or EAP-AKA' — the authentication protocol to use | Reveals whether the subscriber is using the stronger 5G-AKA protocol or the legacy EAP path. |
| sqn | Sequence number — anti-replay counter per subscriber | In a bulk harvest, knowing each subscriber's SQN lets an attacker forge valid auth vectors without triggering sync failures. |
Real World Impact
The distinction between targeted credential theft and bulk subscriber harvesting is the difference between a breach affecting one person and a breach affecting an entire country's mobile subscribers. The same unauthenticated endpoint that powers CH2 and CH5 would, in a real carrier, expose every subscriber with a single loop.
-
Complete subscriber database exfiltration With no auth and no rate limiting on the UDR, an attacker iterates every IMSI in the network's PLMN range. Depending on the carrier, that is millions of records. Each query returns K, OPc, SQN — everything needed to clone any subscriber's SIM. This is the equivalent of exfiltrating the entire HSS/HLR database from a 4G network.
-
Mass SIM cloning capability Every K key returned is a SIM clone waiting to happen. With K and OPc, a software SIM (e.g., srsRAN, Open5GS UE, a programmable SIM) can be configured to impersonate any subscriber. At scale, this means an attacker can impersonate any subscriber in the network — for calls, data, SMS, and location.
-
Retroactive decryption of all captured traffic All 5G session keys, ciphering keys, and integrity keys are derived from K using 5G-AKA. An attacker who has been passively recording encrypted radio traffic — not yet able to decrypt it — can apply the harvested K keys retroactively to decrypt everything they captured before the breach was even discovered.
-
This is why HSMs exist — and why open5GS is for labs only Production carriers store K inside Hardware Security Modules that never expose the raw key material over any software interface. The UDR sits in front of the HSM and only returns derived authentication vectors — not K itself. Open5GS stores K in MongoDB plaintext specifically because it is designed for development. The lesson of CH5 is what happens when that design assumption is violated by deploying it without the hardening a real deployment requires.
Flag Format
The flag is the value of
encPermanentKey in the UDR authentication subscription
JSON response for the target subscriber IMSI imsi-999700000000088.Take the 32-char hex string, wrap it in
TWIN{}, and submit.
This value is different from the CH2 flag — each subscriber has a unique K key provisioned in the lab.
imsi-999700000000088.
Note the last three digits: 088, not 099 (which is CH2's target).
Using the wrong IMSI format returns a 400 Bad Request. The IMSI must be 15 digits after the imsi- prefix.