Detecting Drones as Cellular Anomalies

Since the beginning of Russia’s attacks on Ukraine and the rise of the Shahed Drone, I’ve been following the news on the drone’s remote control systems, especially the ones based on cellular networks. Having a bit of experience on cellular networks, I thought I’d share some insights into the pitfalls of cellular remote control.

Rough Cellular Basics

Cellular networks consist of stationary base stations, a backend network which handles authentication and identification and an endpoint containing a modem and a SIM card. The modem, while working and in use, is connected to a single base station and potentially in touch with others. This allows the modem to ensure proper transitioning while on the move. In return, knowing in which cell the modem is, e.g. to which base station it is connected, the network roughly knows where the modem is. With a little bit of logging, it can also produce a rough vector and speed. Adding the “being in touch” with other base stations, triangulation can be used by the network operator to, sometimes, precisely locate a mobile user.
A SIM card, when connecting to a network, will be authenticated against an internal user database, using the IMSI as the SIM’s identity, in addition to some crypto keys used for a range of challenge-response algorithms. If a SIM card is roaming, i.e. in a different country, the authentication is forwarded to it’s home network via the infamous SS7 or Diameter, for modern systems. Federated authentication and key exchange, nothing fancy.
IP traffic is forwarded via tunnels between the mobile device and the backend of the current network. These tunnels are established to what you might know from the APN settings on your phone. When roaming, it is very well possible your current host network will push custom APN settings to your devices. That said, everything else, at least the things we’re interested right now are plain IP: If its wrapped in TLS, we’re fine, if not, then well … :)

The Drone

The discussed drone, is a random long range drone, so we’ll just use a Shahed flavour as an example. Various publications document that the drones have cellular modems on board. For us here, this is the sole fact we’re looking into, even the used technology (2G, 3G, 4G, 5G) doesn’t make any difference for us.
From our technical perspective, we’re seeing a mobile device with a SIM card travelling around.

The SIM Card

In the most stupid scenario, the attacker would utilise a SIM card from one of their own cellular operators. The advantage being, capability to issue an arbitrary amount of new SIM cards every day and making sure they work. The massive downside being attribution.
The defender is easily able to identify where a cellular client comes from by looking at the first three digits of any IMSI, which are called the MCC, Mobile Country Code. Germany is 262, Russia is 250, Ukraine is 255. These digits can’t be fiddled with, as they’re used to identify the peer to contact for the federated authentication. To be precise, the first five digits are used, where for me here 26201 is T-Mobile Germany, 26202 is Vodafone Germany. The last two digits are called the MNC, Mobile Network Code. If these digits would be spoofed, the current cellular network would contact the spoofed network, fetched key material or relay an authentication request which would then not match the keys on the SIM card. Typically, the current network would then simply reject the authentication request and thus leave the device offline.

Note: Until a few years ago, most cellular operators would let any SIM card join in an emergency mode, which would only allow the SIM card to reach the emergency services. Sadly, due to massive miss-use, this had to be deactivated.

The SIM Card on the Drone

Tracking a SIM card is a technical aspect of basic cellular functionality:

  • The mobile device is connected to a base station
  • The network needs to know to which base station the mobile device is connected, to be able to direct signalling messages to the correct base station and reach the device
  • When the mobile device moves, the base station changes (handover) and the entry in the backend is updated

Thus, current cellular networks cannot not track a device!
The first anomaly to discuss is the location of the initial connect / authentication, as the drone will typically enter the network along a border or a front line. Thus, the simple fact that a new, probably foreign SIM card enters the network of a country currently being at war, implies either a crazy tourist or something that simply shouldn’t be there. Both may be treated as anomalies.
From a network perspective, the borders and frontlines are defined as the set of base stations physically standing along them. When they’re known, they can easily be referenced to monitor anything that crosses them.
The second anomaly to discuss is movement, both speed and direction. The type of drone we’re discussing without doubt flies faster than a human would walk. Looking at Shahed’s current velocities of over 150km/h for piston powered versions and over 400km/h for jet powered variants, they’re on average also faster than a typical car. Even without applying detailed tracking, by simply watching how quickly the modems switch between the base stations, rough speeds can be estimated. Talking about war zones, where sports cars are rare, anomalies should be easily defined.
The direction can be derived the same way, by simply noting the sequence of base stations a mobile device passes. Talking about front lines, movement along them should at least be roughly known, and something moving inwards should always be worth a closer look.

Connection-Based Anomalies

When controlling something via cellular networks, you either need to use a typical phone call, which exposes a phone number, a text message, which also exposes a phone number or IP connectivity, which exposes an IP or a URL. No matter which one of the three it is, the sessions run the defender’s networks and can thus be monitored.
Watching for strange outgoing calls, especially when talking about a notable peak in calls or even text messages, and when going to the same or similar numbers, can easily be implemented. The IP based part is trivial for every IT Security Human, as we’re talking about basic C2, command and control traffic. Each drone will call home somewhere, when lucky, all drones will call home to the same Domain, URL, or subnet, which we can detect with existing methods.

Altitude

When going into slightly more complex approaches, even the altitude of a mobile client may be estimated. Typically we would locate a mobile device using triangulation, which works of measuring the distance between the target and at least three cell masts. The picture below shows why we require three masts, as otherwise we have two possible locations.

Two Masts Triangulation
2 Masts 3 Masts

What our 2D picture hides, is that what we see as a radius of a circle, is actually the radius of a sphere. Thus, we can also get an altitude.

Vertical

Here it is vital to understand, that existing metrics will fail: At ground level, buildings, trees and hills will notably reduce power, which doesn’t happen when looking upwards. Additionally, and the probably even larger issue, most modern antennas have directional characteristics, thus there is a notable chance that reception above certain altitudes will be bad, as the antennas are pointed towards the ground. In return, if there is no reception, there also isn’t an anomaly to detect…

The IMEI

Each cellular modem has an IMEI, the International Mobile Equipment Identity, which can be compared to a MAC address, which should also be globally unique and also contains the ID of the manufacturer. For the IMEI this is the first 8 digits, which is called TAC, Type Allocation Code. The IMEI is usually transmitted while a device signs into the network for the first time and thus is known to the network. This also allows for anomaly detection based on the device ID / IMEI, especially when a nation state configures, builds and literally burns modems, they might reuse certain IDs, which may be detected. Also Samsung, LG and Nokia only rarely produce modems, which are placed as modules on PCBs. These are usually produced as embedded modems by other companies which in return could also be detected or monitored. That said, many legit devices also utilise embedded modems and might also be flagged.

Combinations

As with all anomaly detection, the combination of multiple smaller anomalies may add up to a major anomaly, which in return may result in an actual problem. This could be

  • A foreign SIM card appearing in a certain dead zone
  • A bunch of new foreign SIM cards appearing at once
  • Re-Used IMEIs, which were already flagged in the past
  • A SIM card moving along a strange path
  • IP traffic to newly registered domains
  • IP traffic towards certain countries

Just be creative :)

Watching the Enemy?

In Defence, we sometimes lean back and watch an attacker for a while, would this also make sense here? Using cellular networks as detection mechanism is, as discussed, very feasible. Especially when also adding isolating measures, like prohibiting outgoing IP traffic along the cellular network, or preventing calls to foreign numbers, risks can be reduced. In return, the network itself might also be a helpful system for navigation. Cell masts only rarely move and send out regular signals, additionally each cell, of which a single mast may send out multiple ones, has a regionally unique ID, similar to the BSSID in Wi-Fi, in contrast to the ESSID, which is just the network name. The regional uniqueness is in 2G ensure via an additional LAC, Location Area Code and the TAC, Tracking Area Code in 4G and 5G. After a little bit of recon, the enemy will note which cell mast transmits which code, and could thus calculate a relative position. Practically, cellular standards allow for dynamic rotation of Cell IDs, LACs and TACs, which takes us to a potentially vital defensive measure.

Attacking the Enemy

Lets imagine we have a stealthy enemy, that only utilises its own cellular networks, prior crossing the border / front line. Technically, this would be a simple blacklist, for the MCC of the target state, which in return would also allow usage of foreign networks, while being close to third party borders.
GSM, 2G, has one major design flaw, because of which many states are switching it off: While the network is able to authenticate the mobile device via the SIM, the mobile device is not capable of authenticating the network. Similar to the BSSID in WiFi, the MCC, MNC and network name, which is just a string, can simply be spoofed. Thus, a potential foreign device could be tricked into seeing their home network and motivated to connect at a physical location, where this should not be happening. Practically, this is just what a fake base station does.
Sadly the most simple attacks only work again 2G/GSM, as in 3G, 4G and 5G the mobile device can also authenticate the network. That said, there are known attacks, flaws and fallback mechanisms, which may be exploited to achieve similar attacks, even if the victim does not support 2G, which currently is super rare.

IP Based Attacks

As previously stated, IP based traffic from a mobile device is simple IP based traffic as we know it very well. Talking generic C2 traffic, we have all options available.

Defensive Measures for the Defenders

  1. Enable your mobile operators to perform the following measures
  2. Lock out your enemy’s SIM cards
  3. Lock out your enemy’s friend’s SIM cards
  4. Identify all your cellular base stations along your borders, and dynamically adjust your front lines
  5. Heavily monitor all traffic on these flagged base stations
  6. Define a physical perimeter and document all base stations within it, to allow for simple anomaly detection for conspicuous speeds and vectors. Define minimal frequencies for handovers for simple anomaly definition. Define sequences of base stations, for simply direction detection
  7. Prepare for IT anomaly detection on IP uplinks on cellular networks
  8. Prepare for regular rotation of Cell IDs and Tracking Area Codes
  9. Carefully perform risk assessments on the various strategies and implications of lettings cellular networks up during drone attacks, vs. switching them off vs. using offensive, potentially mobile, fake base stations
  10. Implement anomaly detection on IMEIs

Questions? Thoughts? Ideas? Need for Assistance?

Should you be interested in going deeper or more practical, feel free to drop me a message or invite me for a cup of coffee.

A Final Note

Everything in this blog post is based on common knowledge, standards and public documentation. Nothing of it is a secret, but potentially just something not a lot of people have brought together.