· 3 min read · Gaia Lab

Talking through the baseband: RRC and NAS injection

With a command of our own in the modem firmware we stop being spectators: the terminal can emit RRC and NAS messages it has not generated itself.

Up to here the modem was an object of study: we looked at it. The next step was to turn it into an instrument: to make it emit messages it has not decided itself.

A command of our own in the firmware #

The route was to add a custom AT command to the modem firmware. It takes a PDU in hexadecimal, hands it to the protocol stack and returns the result. Underneath there are two different paths:

  • RRC, towards the radio access layer: setup and information transport messages.
  • NAS, towards the core: mobility and session messages, encapsulated in the NAS transport over RRC.

The first to work was an RRC setup message. Then came NAS: a UL NAS TRANSPORT with a hand-made PDU.

What this is for #

It is not a toy. It is good for three very concrete things:

  • Testing an IDS with traffic a normal handset does not generate. If you want to know whether your detector sees an anomalous RRCSetupRequest or a NAS out of sequence, you need to be able to emit it at will.
  • Seeing how the network reacts. An unexpected message provokes a rejection, a release or silence; all three say something about the state of the core and of the cell.
  • Reproducing scenarios. A fault that happens once every thousand records can be turned into a reproducible test case.

What it costs #

The protocol stack is a strict state machine. Injecting a message in the wrong state does not give a clean error: the modem runs out of context, stops answering or reboots. You have to respect which state the RRC is in (idle or connected), which identity the terminal has been assigned and which integrity and ciphering protections are active.

There is also a boundary of responsibility: this is done on our phone, on our network and with our core. A hand-made PDU against someone else’s network is not an experiment, it is something else.

The interesting consequence is conceptual: the terminal stops being a box that obeys and becomes a participant you can hold a dialogue with. And that is worth as much for attacking as for defending.

Next instalment: guessing an instruction set.

Glossary #

  • RRC (Radio Resource Control): the signalling layer of the radio access: it sets up the connection, configures bearers and handles handovers.
  • NAS (Non-Access Stratum): signalling between the terminal and the core that travels inside the radio access.
  • PDU (Protocol Data Unit): a protocol’s message once encoded, exactly as it travels.
  • Core : the core network: the nodes that authenticate the terminal, give it a session and carry its traffic out to the Internet.