00:00:00.033,00:00:03.103 >>I'm really excited about this, about this talk. Uh, I have a little bit of background, and 00:00:03.103,00:00:09.576 uh, in GSM and so, uhm, I hope you guys, uh, really enjoy this. Uh, we have Cambell Murray, uh, 00:00:09.576,00:00:14.581 Eoin Buckley and, uhm, what? James, uh, uh, Kulikowski. Here to to talk about, uh, GSM - we 00:00:17.217,00:00:22.222 can hear everyone now. Please give them a warm welcome. [applause] >>Uh, good afternoon 00:00:26.927,00:00:30.397 everyone. Uhm, thanks for having us, first and foremost. And thanks for the Scotch - that was 00:00:30.397,00:00:35.636 really really good. Great way to start a talk off. Uh, so, I'm just gonna take up the first 00:00:35.636,00:00:40.707 kind of 5 to 10 minutes of the talk today. I'm gonna give you a, a bit of a background into 00:00:40.707,00:00:46.380 how we lead up to, sort of finding, uh, some of the issues that we'll be presenting today. 00:00:46.380,00:00:50.684 Sorry, that was really strong Scotch. [laughter] Uh, and... [laughter] And a, uhm, a little 00:00:50.684,00:00:55.555 bit of an overview, uh, kind of about how, uh, our methodology and how we actually, uhm, 00:00:55.555,00:00:59.760 arrived, uh, at this point in time. Uhm, there are quite a few people - my name is Campbell 00:00:59.760,00:01:03.897 Murray. I'm a, uh, I'm kind of a team lead, globally, for BlackBerry. Uh, but there are a 00:01:03.897,00:01:08.535 lot of people involved in the team and I'm a real believer in the right person for the right 00:01:08.535,00:01:12.839 job always making sure you've got the, the expertise there. Uh, the concept behind what 00:01:12.839,00:01:16.743 we're presenting today were actually, originally, thought up by Eoin, uh, Eoin is our crypto 00:01:16.743,00:01:21.515 guy. Uh, this guy has forgotten more about crypto than I will ever remember. Uhm, we got with 00:01:21.515,00:01:26.620 us today also James Kulikowski, who's our hardware dude. Uh, not with us today, sadly, but also 00:01:26.620,00:01:30.490 very important to the team effort in, uh, making this presentation happen was Bartek 00:01:30.490,00:01:35.429 Piekarski, uh, who's our software, uh, expert and there's a few other people who need to 00:01:35.429,00:01:41.234 be mentioned as well. Uh, in our UK team is Anthony Goodyear, uh, senior technical consultants as 00:01:41.234,00:01:45.439 well. And, uh, another one, uh, a colleague of Eoin's particularly, called Tom Martin 00:01:45.439,00:01:49.643 - uh, who sadly couldn't make it today either. Uh, so, there’s quite a few people, quite a bit 00:01:49.643,00:01:55.148 of background. Uh, a lot of expertise, uh, went into several months of making this happen. 00:01:55.148,00:01:59.453 Not just from concept, from a concept point of view, from purely looking at the crypto 00:01:59.453,00:02:03.357 flaws; looking at the actual algorithms and developing the concept, but to actually putting 00:02:03.357,00:02:08.595 it all together and there's some serious hardware behind it which we'll get to see later. Uh, so, 00:02:08.595,00:02:12.499 say, I'm only gonna take up a few minutes of your time. Uh, I'm gonna give you a brief intro 00:02:12.499,00:02:18.205 to GSM. So, uh, just so that everybody's kind of on a level footing, so that everybody, not 00:02:18.205,00:02:21.508 everyone's a GSM expert, although, of course this is DefCon, so I appreciate that 00:02:21.508,00:02:26.380 some really, really, scarily good technical brains in the audience here. But, just so that 00:02:26.380,00:02:29.716 everyone's, you know, starting out in a fair place. So, I'll give you a very brief, high 00:02:29.716,00:02:35.188 level overview of how GSM comms work. Uh, Eoin's then gonna pick with concept overview from a far 00:02:35.188,00:02:40.460 more, uh, deeply technical point of view. Uh, James is gonna explain the test lab and all of 00:02:40.460,00:02:45.132 the really really fun hardware, uh, and the amount of money that we spend making this happen. 00:02:45.132,00:02:49.002 Which is just the best part of security research... [laughter] Is seeing those dollars going 00:02:49.002,00:02:54.141 out the door. And then we'll have a general, sort of, uhm, wrap it up with a, a 00:02:54.141,00:02:59.146 conversation about cellular, uh, security. So, I'm going to give you a real rough, high-level 00:03:01.348,00:03:08.221 introduction to GSM. And concepts for, uh, for GSM's been around since. uh, late 80s - a 00:03:08.221,00:03:13.326 major improvement over the analogue mobile, uh, phone system - of course. Uhm, GSM 00:03:13.326,00:03:18.331 started to be implemented in 19, between 1991 and 1995. And, uh, out of all of the mobile phones 00:03:20.367,00:03:23.603 standards of which there are several, uh, it's the first one to have really considered 00:03:23.603,00:03:28.608 security in its uh, in its actual design. Uh, key features, key functions of GSM, which you 00:03:30.744,00:03:37.451 need to be aware of, are of course TDMA, uh, Time Division, uh, Multiple Access. Uhm, in the 00:03:37.451,00:03:42.622 way that GSM assigns timeslots, instant communications, uh, GSM also introduced the concept of 00:03:42.622,00:03:47.828 the SIM, uh, Subscriber Identity Module - which was completely different to CDMA, uh, which is 00:03:47.828,00:03:51.531 still in use. Now, I did some Googling earlier and of course, Google's like 100 percent 00:03:51.531,00:03:56.803 accurate - all the time, every time. And this claims that CDMA is still in use in 47 percent of 00:03:56.803,00:04:00.774 communications in, uh, North America, on mobile phones. Which I find kind of hard to believe. 00:04:00.774,00:04:05.979 But, you know, Google, right? It's never wrong. Uhm, so, GSM's were introduced for us time 00:04:05.979,00:04:12.018 slots. It's introduced to us, uh, individual subscriber identity modules as well. Uh, 00:04:12.018,00:04:16.256 but it does have several design issues in that there are multiple ciphers that could be 00:04:16.256,00:04:20.727 used in GSM, uh, but the prevalent ones that are in use today only support key sizes 00:04:20.727,00:04:27.434 that are less than 64 bits. And, uh, the encrypted data contains redundancy for signal cleaning - 00:04:27.434,00:04:32.439 which Eoin will go into far more detail later. So, looking at timeslot concept round, uhm, 00:04:34.608,00:04:39.713 GSM, I'll speak a little bit about how the actual cipher is generated in the next slide. 00:04:39.713,00:04:44.251 But, uh, GSM introduction on timeslots uh - there are 8 timeslots available, uh, in the 00:04:44.251,00:04:49.990 frame, uh, when your mobile phone connects to a base station it's negotiating timeslots being 00:04:49.990,00:04:55.395 one of the factors used in generating the cipher key. Uh, which of course produce the 00:04:55.395,00:05:02.102 cipher text. In the GSM ecosystem, uh, frames ah- across the, across the base station are 00:05:02.102,00:05:08.308 put into multiframes and super frames. Uh, and overriding long into a hyper frame which has a 00:05:08.308,00:05:14.114 total time life span of just under 3 and a half hours. So, all the time slots after 3 and a 00:05:14.114,00:05:20.053 half hours are reset and re, and begin again. Time Slots within that hyper frame can not exist 00:05:20.053,00:05:25.058 beyond that, uh, beyond that period of time. The actual cipher itself is based on 00:05:27.127,00:05:31.264 symmetric encryption which of course means there is a shared key, uh, between handset and 00:05:31.264,00:05:37.170 base station. Uh, the actual cipher stream itself is made up, uh, cipher itself, the A5 cipher 00:05:37.170,00:05:42.175 itself is made up of, uh, 3 key components - uh, the KC value is produced by KI and Rand value in 00:05:44.811,00:05:49.716 the SIM card itself, hence why we mentioned, yes i'm introducing SIMs, earlier on - 00:05:49.716,00:05:54.754 uh it's one of the values. Uh, the cipher stream element is built up of four bursts of 114 00:05:54.754,00:06:00.660 bits each and contains a total of 228 bits for the up and down stream. Uh, the frame number, 00:06:00.660,00:06:05.832 again, as we looked at timeslots just a few minutes ago, again, all of this being relevant from 00:06:05.832,00:06:11.471 a very very high level, top down view of actually how GSM, uh, works as a mechanism. Also 00:06:11.471,00:06:16.843 provides, uh, an element of entropy into producing the cipher. Uh, currently there are 00:06:16.843,00:06:21.848 2 main ciphers in use, A5-1 and A5-3, uh, there is A5-4 which does allow 128 bits but its only 00:06:25.185,00:06:31.324 in use in very very specific locations and via some uh very particular, actual mobile phones 00:06:31.324,00:06:37.564 cellular operators. So, that, whilst obviously a, a much more daunting proposition for 00:06:37.564,00:06:41.401 examining the crypto in A5-4 - it's not something we're actually going to give too much 00:06:41.401,00:06:47.574 prevalence to today because it is, it is quite an issue still. Uh, worth noting the A5-2 was 00:06:47.574,00:06:54.514 disallowed, uh, sometime 2000s was a paper by, uh, dadada, uh Barkham, thank you, Viam and 00:06:54.514,00:07:01.321 Keller along the GSMA who released the paper in 2006 - which discounted the use of, uh, 00:07:01.321,00:07:07.360 A5-2 encryption. Uh, of course in this guidance for encryption, uh, currently and a guidance 00:07:07.360,00:07:12.299 often being guidance and not always practically implemented is calling for 112-bit security 00:07:12.299,00:07:18.038 strength, uh, based on the standards today. So, from a very, very basic introduction to 00:07:18.038,00:07:22.876 GSM what I'm going to do is hand you over to Eoin Buckley who's gonna, uh, start looking at the 00:07:22.876,00:07:29.816 concept from the design flaws that, uh, been identified in GSM implementation standards. So, 00:07:29.816,00:07:34.821 please, Eoin. >>Thanks a lot Campbell. So, in this section we'll, uh, go over from uh- a 00:07:39.492,00:07:45.665 high level the concept of, of the attack and, uh, what we're going to be focusing in on. So, 00:07:45.665,00:07:50.670 as Campbell mentioned, earlier, one of the features that GSM came in, comes in with for A5-1 00:07:52.672,00:07:59.312 and A5-3 is a small key size - up to 64 bits in length. And, uh, yeah with the 00:07:59.312,00:08:04.918 recommendations from this with a 112-bit key length you can see there's a large gap there. So, 00:08:04.918,00:08:09.923 uhm, there, that should, that should already be of concern. Uhm, a second. Uhm, feature in 00:08:12.559,00:08:17.564 GSM is, uh, the, their use of "error control coding", so, uhm, error-control coding it adds 00:08:20.633,00:08:26.206 redundancy to a packet that's transmitted. It actually has a very good use in wireless 00:08:26.206,00:08:31.978 communication. When you're transmitting a packet across a channel, there's fading, there's 00:08:31.978,00:08:36.983 interference from other cells, there's thermal noise in the, in the RF receive chain. So, it's a 00:08:39.819,00:08:46.626 very noisy single, signal that's received in the base band. So, uhm, we've gone through, we add 00:08:46.626,00:08:52.565 error control coding in order to clean up the signal - to figure out what is the correct message? 00:08:52.565,00:08:57.771 Now what, what has happened in GSM is they actually per, uh, performed the error control 00:08:57.771,00:09:02.842 coding before the encryption, so as we shou- should see on the slide here - first you get your, 00:09:02.842,00:09:08.848 your message, the second you put it through the error control coding which adds in redundancy. 00:09:08.848,00:09:12.786 And then you carry out the encryption. And that's what we're gonna make use of. 00:09:12.786,00:09:17.190 Because, once you have redundancy in a message, uhm, if, if you're in the crypto 00:09:17.190,00:09:21.594 world, you know, that's bad. That can be used to figure out what the key is. And that's 00:09:21.594,00:09:27.667 exactly what we're gonna show today. Uhm, we'll mention, uh, again later but in later 00:09:27.667,00:09:34.274 standards - like in 3G, 4G, 5G, uh and in most wireless standards, uh what they do is 00:09:34.274,00:09:38.778 actually carry out the encryption of the message before error control coding. So, that's 00:09:38.778,00:09:43.783 the issue that we're gonna be making use of today. Uhm, yea, so, as, as we see on the slide 00:09:46.186,00:09:50.423 here, the error control coding is usually used to get rid of the noise on the channel. We're 00:09:50.423,00:09:56.796 gonna be using that to identify the cipherstream and therefore the key that's been used to, to 00:09:56.796,00:10:01.801 carry out the encryption. Getting in, into a little bit more depth, uhm, in GSM, just 00:10:05.638,00:10:11.544 because of the time that GSM was created, or, in the late 80s or standardized in the late 80s, 00:10:11.544,00:10:18.017 uhm, the, the error control code that was used then, was a convolutional code. So, that's 00:10:18.017,00:10:23.022 what we're gonna be using today. Uhm, the, in general, uhm, an attack isn't really uh, focussed 00:10:25.458,00:10:31.965 on the convolutional code, uhm, if there was any other, uh, error-control code and there, in 00:10:31.965,00:10:38.238 principal, should be an approach to use that infor, redundancy that's in the message. Uhm, what 00:10:38.238,00:10:44.010 we're gonna be doing is we're gonna be, uh, capturing the encrypted error control codework 00:10:44.010,00:10:49.282 that's transmitted across the air. We're gonna capture it in a, a, we're gonna capture it 00:10:49.282,00:10:54.287 using an SDR. We're gonna do a little bit of, uh, mathematical computation using the 00:10:57.123,00:11:01.895 characteristics of the error-control code which happens to be a convolutional code. And, 00:11:01.895,00:11:06.065 we're gonna figure out an indicator. So, we're gonna use the term "indicator" a lot. What 00:11:06.065,00:11:11.404 that is, is, I, I was speaking to pentester which used a very good phrase - "It's a 00:11:11.404,00:11:16.409 fingerprint for the key." So, our indicator will be, uh, the fingerprint for the key that's 00:11:18.645,00:11:23.650 used for, for the encryption. Uhm, and, uh, we'll, uh, in principal, our overview of the 00:11:25.818,00:11:30.590 attack is we'll use that fingerprint to look up a rainbow table to identify what, which, 00:11:30.590,00:11:36.162 uh, key is being used for the encryption. So, specifically in the- in our, in our 00:11:36.162,00:11:41.167 demonstration which we'll show in a little bit, we're gonna go after this SACCH channel because 00:11:41.167,00:11:47.941 it's well-known and, uhm, it's, it's quite regular and it's something we, we, uh, can easily 00:11:47.941,00:11:54.013 find, uh, just makes the demonstration very very easy. Uhm, the nice thing about SACCH 00:11:54.013,00:11:59.385 is once you compromise a SACCH channel, it's a control channel. Uh- You'll also get the key for 00:11:59.385,00:12:04.257 voice. The same keys used for both cases. And SACCH stands for "Slow Associated Control 00:12:04.257,00:12:10.463 Channel" and when you go into a cell, it's used for, it's got several uses - one of them is uh 00:12:10.463,00:12:15.001 to give you information about neighbour cells. Uhm, so you can go and take measurements on 00:12:15.001,00:12:20.006 them. Uh, one key feature of, uhm, using this redundancy in the message is our, our, this 00:12:22.976,00:12:27.981 attack will work for any message on this SACCH channel. We don't care what the message is. Uh, we 00:12:30.216,00:12:36.122 will just be using the redundancy that's added in there to compute the indicator. So, 00:12:36.122,00:12:42.595 it's not a plaintext attack at all. [cough] Uhm, we'll be just using the parody bits that come 00:12:42.595,00:12:47.433 from the error control code to help us figure out what that indicator is. That's a great 00:12:47.433,00:12:52.438 freedom. Uh, so, in the past, uhm I think SACCH has, uh... [coughing] There's only a few 00:12:56.542,00:13:01.614 messages which are transmitted on the SACCH channel, even if they- they were randomized we 00:13:01.614,00:13:07.820 wouldn't care. We're using the error control code properties and that's all we need. So, uhm, 00:13:07.820,00:13:13.326 this slide, it's getting a bit more down into the details, uhm, I'll start off by saying what I 00:13:13.326,00:13:19.599 want out of this slide is just to give you, you an idea of the complexity of, uh, computing the 00:13:19.599,00:13:24.404 indicator. We don't have to understand every detail of this slide. Uhm, so, error control 00:13:24.404,00:13:29.742 coding and convolutional codes for the SACCH channel we use what's called a "raid 1 half 00:13:29.742,00:13:34.747 code". So, the "raid 1 half" mean - what "raid 1 half" means is we take one, uhm, stream of 00:13:37.817,00:13:43.489 message input into the error control code and we get two streams out - we get the upper 00:13:43.489,00:13:47.660 stream which is called the "parody one" stream and a lower stream which is called the 00:13:47.660,00:13:52.665 "parody two" stream. Those streams are then, uhm, encrypted using the A5-1 or A5-3 or A5-4 00:13:57.303,00:14:02.241 cipher. Uhm, so what that's transmitted over the air is the encrypted parody 1 or parody 2 00:14:04.577,00:14:09.582 stream which is shown as by those red arrows. That's is what we capture. So, uhm, just to 00:14:12.485,00:14:16.322 talk, talk a little bit about the mechanics about what goes on with the error control coding 00:14:16.322,00:14:22.862 itself. The upper stream, uh, that’s formed by what's called uh, by using what’s called a 00:14:22.862,00:14:29.869 generator polynomial and I put that down here as G1. And the lower stream is, is uhm, is 00:14:29.869,00:14:35.208 formed by what's called a gen, a second generator polynomial which we call G2. These 00:14:35.208,00:14:41.781 generator poly, polynomials - they're defined by 5 bits, okay? Uh, we don't have to go into too 00:14:41.781,00:14:45.952 many details about the generator polynomials but really all you're doing is you're putting 00:14:45.952,00:14:51.891 your message through, uh, a 5 element register. And then you're tapping off these 00:14:51.891,00:14:56.896 registers and XORing them together. So, for the lower, the G2, uhm, since it's got 1 1 0 1 00:14:58.931,00:15:04.370 1, it means that you're taking the first, second, fourth and fifth register; seeing what 00:15:04.370,00:15:09.442 values of the message are in there and XORing them together and that'll produce your lower, 00:15:09.442,00:15:14.447 uhm, parody 2 stream. Uhm, I'm sure it's described there on Wikipedia, just know that it's a 00:15:17.917,00:15:22.922 register that, that you're just convolving with the, uh- input message string. And again, as, 00:15:25.658,00:15:31.664 as we mentioned earlier, then that's put through, uhm, A5, uhm, A5 encryption algorithm. 00:15:31.664,00:15:37.970 What we are gonna do to, to use our, uh, to, to compute our indicator is we're gonna carry 00:15:37.970,00:15:43.810 out something called "deconvolution". So, what we're gonna decon, deconvolve the 00:15:43.810,00:15:50.750 stream with is the exact same generator polynomials. So, we're, uh, for example, for the 00:15:50.750,00:15:55.755 upper stream its gonna, it's of 228 bits long. We're gonna carry out, we're gonna get our 5, uhm, 00:15:59.792,00:16:06.299 generator polynomial bits and just deconvolve it in, as, like, as, as a window. All the way 00:16:06.299,00:16:11.304 along the stream to get a 224-bit output and that 224-bit output will be called "cube 1" 00:16:14.740,00:16:20.613 and we do, uh, we perform a similar operation, uh, on parody 2 stream and we XOR them 00:16:20.613,00:16:26.018 together. Uhm, the mathematics behind this is given in the appendix. Uh, but from our, for 00:16:26.018,00:16:31.457 our purposes all we need to know here is we're carrying out a deconvolutional operation on the 00:16:31.457,00:16:37.897 top stream, deconvolutional operation on the bottom and then we're gonna XOR the two streams 00:16:37.897,00:16:42.902 together. As far as how complex that is, uhm, in the simulations we've run, on our accelerated 00:16:45.338,00:16:50.343 GPUs, uhm, it takes about half the complexity of running, uh, a cipher to carry out these two 00:16:53.679,00:16:58.684 deconvolutions and computing our indicator. So, it's not a very, very, uhm, com, complex action. 00:17:02.989,00:17:08.261 It can be something, done, it's a, it's half the complexity of actually running the ciphers 00:17:08.261,00:17:15.201 themselves, so it's, it's something very feasible. Uh, getting into the indicator 00:17:15.201,00:17:20.206 itself, Uh, the indicator we produce is, uh, 224 bits long - quite a long indicator and to 00:17:25.878,00:17:32.151 compute it we need to capture the full four bursts of a SACCH message. Uh, we have to go 00:17:32.151,00:17:37.857 through the full process of deinterleaving that, demodulating that. Uhm, and then 00:17:37.857,00:17:44.730 forming an actual - getting it back into a state of a convolutional codework. Uh, the 00:17:44.730,00:17:49.735 indicator we compute is fully determined by the convolutional code and the cipher stream 00:17:53.773,00:17:58.778 that's encrypting, uh, the, the, the SACCH message. The indicator that we, we get is 224 bits long 00:18:06.152,00:18:09.755 and you can imagine if we're getting an indicator that's 224 bits long, and we're trying to 00:18:09.755,00:18:15.861 use that to indicate our 64-bit key - we've got a lot of redundancy there that's left. We 00:18:15.861,00:18:19.732 only need 60, a 64-bit indicator, so what we're actually gonna do in the 00:18:19.732,00:18:25.871 demonstration is just take the first 64 bits and use that in our, uh, mini rainbow table that 00:18:25.871,00:18:30.876 we've got set up. Okay? So, the next section is James. >>Gonna fit this... Alright, so, uh, in 00:18:50.463,00:18:54.400 this section we're just gonna go through what our current lab setup is. Uh, so we actually 00:18:54.400,00:18:58.204 went through a couple of different evolutions of lab setups. Uh, so this first slide 00:18:58.204,00:19:02.341 just goes over the hardware we're using, uh, and this just represents, uh, what is 00:19:02.341,00:19:07.179 currently in the lab. Uh, so right now uh we're using multiple different, uh, 00:19:07.179,00:19:12.451 telephone devices, or cellular devices. And the only reason we say "various unlocked cellular 00:19:12.451,00:19:16.188 devices" here is that we don't want to target a specific manufacturer because obviously 00:19:16.188,00:19:21.894 this is a problem with the GSM, uh standard as whole and not as an individual manufacturer of 00:19:21.894,00:19:26.899 devices. Uh, additionally for this to work, uh, since we were using open BTS, uh, we were, uh, 00:19:29.068,00:19:34.373 in need of 2G compliant, uh, programmable SIM cards. Uh, so we ended up picking up a couple 00:19:34.373,00:19:39.378 of those, uh, that support the comp 128 V1 and comp 21, uh comp 128 V2, uh, algorithms for 00:19:41.814,00:19:48.087 generating the uh, the KC stream, uh, which is required for encryption at A5-1 and A5-3. 00:19:48.087,00:19:53.092 Uh, additionally, uh, to program this, obviously we needed, uh, some hardware to do the, the 00:19:56.128,00:20:03.002 actual write. Uh, additionally, uh, there we, we ended up using a, an SDR - uh, multiple SDRs in 00:20:03.002,00:20:09.875 this case. Uh, so for our actual BTS base station, uh, we used Ettus Research N210, uh, so, 00:20:09.875,00:20:15.314 pretty hefty piece of machinery there. Uh, and that's running with a WBX daughter board on 00:20:15.314,00:20:20.786 that as well. Uh, to stabilize the actual clock frequency, uh, we actually ended up using an 00:20:20.786,00:20:27.226 external mini GPS reference clock. Uh, just to give us a nice 10 megahertz reference. Uh, 00:20:27.226,00:20:32.932 for our actual captures we ended up just using a, uh, standard AirSpy SDR mini. Uh, we did have 00:20:32.932,00:20:38.704 some other, uh, tools available to us, such as, uh, hack RF, you know blade RF, X 40, and some 00:20:38.704,00:20:42.508 additional things. But they were a bit overkill for what we actually needed, you could do 00:20:42.508,00:20:48.714 this with a 15 dollar, uh, RTL SDR dongle if you needed to. And then, just uh various tuned 00:20:48.714,00:20:53.719 antennas for the 900 megahertz frequency needed in GSM. Uh, moving on to our software side. 00:20:57.189,00:21:00.926 Uh, so, from the software, uh, we actually started out with, with the range that works 00:21:00.926,00:21:05.931 OpenBTS 5 dot 0, uh, which is open source. Uh, on, the uh RangeNetwork’s GitHub, uh but we 00:21:08.434,00:21:11.203 ended up upgrading to their actual commercial version because it was a bit more 00:21:11.203,00:21:15.174 stable, uh, so we ended up getting their software to find mobile networking suites - 7 dot 00:21:15.174,00:21:19.879 0 dot 4. Which is the, the current evolution that's available from them. Uh, for the 00:21:19.879,00:21:24.884 actual programming of the SIM cards, uh, we just use the standard, uh, PySIM tool, uh, to 00:21:24.884,00:21:31.090 do the, uh, setup of our, our MCUs and use an injection of our KI values, uh, into the actual 00:21:31.090,00:21:36.095 cards themselves. Uh, for the actual captures, uh, from our second device, uh, we had a Kali 00:21:38.197,00:21:44.003 machine setup using GNU radio, uh, and the GR-GSM, uh, tool suite that's available through 00:21:44.003,00:21:49.008 the, uh, osmo-com, uh, toolsets. And then, uh, from a 3rd laptop, that, uh, Eoin was running, uh, 00:21:52.144,00:21:57.783 we had, uh, Octave running. Uh, it's like a modified version of MATLAB that allows us to go 00:21:57.783,00:22:02.721 through and do the calculations of the indicator. And then for the actual lab configuration 00:22:05.124,00:22:09.728 itself, so, all our testing was actually done under RF-isolation. So, this is 00:22:09.728,00:22:13.832 actually a picture of one of our isolation chambers in our Waterloo office in Canada. Uh, 00:22:13.832,00:22:19.271 so what we ended up going into a nice RF-shield room and doing all, all of our stuff there. So, 00:22:19.271,00:22:24.109 that way we weren't actually affecting any actual cell phone devices in the, uh, local area. 00:22:24.109,00:22:30.749 Uh, another note here, uh, as Eoin mentioned earlier, uh, we ended up using the A5-3 cipher 00:22:30.749,00:22:35.754 itself as the, uh, the cipher that we were testing against. And we enabled the support for 00:22:38.457,00:22:43.929 the SACCH random neighbour, uh, protections as well as random padding. So, that way we can 00:22:43.929,00:22:48.968 prove out and, you know, show this really is not a plaintext attack. We're actually looking 00:22:48.968,00:22:53.038 at, uh, just the message itself and we don't care what the bits are that are actually being 00:22:53.038,00:22:58.043 transmitted. And, actually, before we talk about this one, I'll actually jump over to, uh, 00:23:01.480,00:23:06.485 a video demo of... Let me actually see if it'll let me jump over. [chuckle] We've got a 00:23:09.855,00:23:14.860 quick video here that goes through the actual capture process. [silence] So, the first 00:23:22.768,00:23:27.873 thing that you'll see come up on the screen is actually a, uh, visual dashboard that's 00:23:27.873,00:23:32.645 available within the software-defined mobile networking suite. Uh, so where 00:23:32.645,00:23:37.449 all this is showing, is just the, the signal levels available. RSSI values and 00:23:37.449,00:23:41.053 things of that, that nat- nature, uh, from the devices that are available on the 00:23:41.053,00:23:45.424 network. Uh, so what you're seeing here right now is the first, uh, device starting to 00:23:45.424,00:23:52.431 communicate in. And then, uh, we'll see another, uh, an actual MZ connect to the, uh, the 00:23:52.431,00:23:57.636 system here in a second. And this will actually be the start of our, our first phone call 00:23:57.636,00:24:03.542 that we'll, we'll be capturing. Uh, and as, as we continue to capture here you'll see a second 00:24:03.542,00:24:08.547 MZ pop-up that second telephone, uh, that's on that same network. Uh, and in a moment here you'll 00:24:12.818,00:24:19.625 see a, an overlay, uh, pop up, and in this overlay this is, uh, our second machine actually 00:24:19.625,00:24:24.963 going through on Kali using GR-GSM, uh, with the capture tool - just to capture, uh, the, 00:24:24.963,00:24:29.968 uh, the packets, uh, and record them out to a offline file for, uh, additional processing. Uh, 00:24:34.773,00:24:38.844 and this is just in verbose mode so you can see all the bits running through the screen. Uh, 00:24:38.844,00:24:45.651 it- you don't necessarily need to do this in real, in real life. It, uh, just a lot of 00:24:45.651,00:24:51.156 garbage across the screen, right? [chuckle] And this will go on for about another 30 00:24:51.156,00:24:57.029 seconds here as the, uh, the call, uh, continues. And then we'll see the, the hang up 00:24:57.029,00:25:01.967 action occur as the, uh, the signal tails off there on the other side of the screen. Little 00:25:11.877,00:25:16.882 bit longer than I remember. [chuckle] Yea, so our call should be hanging up there, we 00:25:28.460,00:25:33.465 just saw that a signal drop and uh, should tail off and that's the end of our transmission on 00:25:37.202,00:25:42.207 those, uh, traffic jammers. [deep breath] So, now what's happening here is we've actually 00:25:45.677,00:25:50.616 taken that file and sent it over to, uh, Bartek, uh, so Bartek's actually gonna do and run 00:25:50.616,00:25:56.455 through the signal processing. So, this is using a custom flow graph, uh, with the GRG-SM, uh, 00:25:56.455,00:26:02.961 blocks within, uh, GNU-radio. So he added his own FFT in here and also a burst printer so what 00:26:02.961,00:26:07.666 we're doing is we're looking only for SACCH messages, uh, explicitly and then printing 00:26:07.666,00:26:14.540 those SACCH messages out, uh, to both uh, WireShark for output over the local host. And then to 00:26:14.540,00:26:19.545 a, uh, text file which we can then parse and pull out the extracted verse that we need. 00:26:19.545,00:26:24.550 So, here, uh, he's highlighting the time slots that are actually used for the call so you can see 00:26:26.618,00:26:31.623 the two separate calls here, uh, running on timeslot 6 and timeslot 7. And then we're just 00:26:34.560,00:26:38.697 gonna open up that file here, so this is the actual burst messages in that text file 00:26:38.697,00:26:42.935 that's generated through the, uh, the custom flow graph you generated. And we're gonna 00:26:42.935,00:26:47.940 select a, uh, full set of four bursts for timeslot 7 and then copy that into a separate file 00:26:50.409,00:26:56.748 here. And then we're gonna do the same thing for the, uh, timeslot 6. So, we're gonna 00:26:56.748,00:27:01.687 scroll down through the, this section here and grab that last four, uh, complete messages for, 00:27:04.256,00:27:09.261 uh, the timeslot 6. [indistinct talking] And again, we're just dropping that into the, uh, a 00:27:22.875,00:27:27.613 seperate text file. And now this text file has been sent over to, uh, Eoin that he's gonna run 00:27:27.613,00:27:33.418 through his, uh, tool with this command SACCH, uh, SACCH crack. And, right here what's happening 00:27:33.418,00:27:40.259 is it's, it's now analyzing that indicator. Uh, so we see the, the, uh, full indicator that's 00:27:40.259,00:27:47.199 generated and we determine our key, uh, from that indicator and then go back and validate that 00:27:47.199,00:27:53.505 the key that we, we actually get here is what we expect but then calculating another message 00:27:53.505,00:27:58.510 using that key and validating that the signatures are both identical. [coughing] [chuckle] 00:28:00.846,00:28:05.851 [applause] Thank you. [applause] Yea, so that's the real magic part, right there. [chuckle] Uh, 00:28:13.759,00:28:17.162 then we jump into actually extracting audio - so, this is probably stuff that you've seen 00:28:17.162,00:28:22.000 before, uh, using the same tools with GR-GSM. Uh, but what we're really doing here is now just 00:28:22.000,00:28:27.005 going back, uh, through GR-GSM looking a the packets, uh, finding the, uh, point where the 00:28:29.274,00:28:35.480 calls are initiated. [sneeze] Uh, and then identifying what, uh, cipher was actually being 00:28:35.480,00:28:40.485 used. So, in this case we'll see, uh, in that first message here, that we're using the A5-3 00:28:43.689,00:28:48.694 cipher. So this is where it's set the cipher uh mode connection command here. Uhm, so 00:28:52.231,00:28:57.402 in this second command now what we're doing is we're telling it, uh, we know that, uh, we're 00:28:57.402,00:29:02.341 using the, uh, cipher, uh, mode A, uh, A5-3. Uh, we're gonna select our uh calculated key, 00:29:08.146,00:29:12.718 uh, pass that to the tool and this is going to allow us to decrypt the SACCH messages, uh, 00:29:12.718,00:29:17.723 that we, uh were unable to see previously. And so now we're looking back through that same 00:29:21.660,00:29:26.665 set of commands, and verifying that we can actually see the decrypted SACCH messages. Uh, so 00:29:29.368,00:29:34.373 we're seeing that, you know, we're using, uh, TC, uh, TCH full, full rate for the audio. 00:29:36.541,00:29:41.647 Uh, and what the time slot was for that specific call. Uh, in the last command here that we 00:29:41.647,00:29:46.652 run is now, uh, changing the mode for the, uh, decoder to TCH full-rate and then decoding that 00:29:50.422,00:29:55.427 actual speech out to a output file. And then we watch this through, uh, wireshark, cause 00:29:59.665,00:30:06.505 there is, uhm, uh, problems with the GR-GSM tool now where it does tend to hang when doing a 00:30:06.505,00:30:12.044 decryption of the, uh, audio and outputting it to a speech file. Uh so, what we end up doing is 00:30:12.044,00:30:17.115 just, uh, following the traffic until we see the actual hangup, uh, in release command. And then 00:30:17.115,00:30:22.120 killing our, uh, our session in Kali. And then, uh, shortly after this what you'll hear, uh, 00:30:27.926,00:30:33.799 is the audio clip that was, uh, decoded from this, uh, this capture. Uh, and that's just 00:30:33.799,00:30:38.804 cleaned up with audacity and uh, thrown into an MP3 file. Fr... >>Hello, hello.. >>Hey, hey this 00:30:46.478,00:30:52.884 is Micheal, how you doing? >>I am doing awesome, except for these zombies! You see all these 00:30:52.884,00:30:57.889 zombies around? >>Yea, good gosh, they're everywhere! >>Yea, so many even have blonde hair! 00:31:00.392,00:31:04.096 [laughter] >>Wait. Zombies have blonde hair? >>At least the, the, the scary ones. [laughter] 00:31:04.096,00:31:09.434 >>Those are the real scary ones. They even go laughing, laughing. Blonde haired zombies, who could 00:31:09.434,00:31:14.973 imagine? >>So, so what are we gonna do about them though? That's the question. >>I, I 00:31:14.973,00:31:19.778 dunno, Maybe we'll have to, to change their hair colour. I hear some of them might be coming up 00:31:19.778,00:31:25.217 to DefCon, so hopefully we can change, change their hair to blue, by then. >>Yea, that's a 00:31:25.217,00:31:31.356 good idea. >>How it works - whoever sees a blue uh- haired zombie up on stage at DefCon 00:31:31.356,00:31:36.361 gets a, gets a prize after the talk. >>Sounds lovely. >>Alright, see you later! 00:31:38.597,00:31:44.770 >>Alright, see you! >>Yea, so obviously that was them talking about me. [laughter] [applause] 00:31:44.770,00:31:49.775 Thanks! [applause] Yea, so that, that call was actually two weeks ago in our Illinois office, uh, 00:31:55.046,00:31:59.985 with a gentleman of the name Tom Martin, and Eoin uh that we captured just for this demo. And 00:32:02.788,00:32:08.293 then we'll jump back over to our slide right here. Uh so this is that, that flow graph I 00:32:08.293,00:32:13.598 mentioned earlier that we saw uh in the demo. So, this is just the, the modified flow, uh, that 00:32:13.598,00:32:19.805 we ended up using, uh, which is just uh a combination of the GR-GSM blocks and, uh, and 00:32:19.805,00:32:26.044 output verse printer that allows us to take all, uh, 7 timeslots, sorry, 8 timeslots and then 00:32:26.044,00:32:31.416 output them into our text file in, uh, raw format. And from here, i'm gonna pass it back to, 00:32:31.416,00:32:36.421 uh, Eoin. Thank you. [applause] >>Uh, so I just want to actually speak a little bit more about 00:32:41.426,00:32:46.998 the demo we just did. Uhm so, uhm, we did produce two indicators there - the first one 00:32:46.998,00:32:52.037 was of the encrypted SACCH message and then the second one, the way uh, the way we generated 00:32:52.037,00:32:58.743 the sec- or we got the second indicator we took a, a, the encryption stream itself without 00:32:58.743,00:33:03.315 any message and then we performed the same deconvolutional operations and 00:33:03.315,00:33:09.120 of course we got the same indicator showing that the message does not matter - we 00:33:09.120,00:33:14.125 still end up with the same indicator, just to clarify that. So, uhm, regarding this attack 00:33:17.229,00:33:22.968 itself, the only reason why, why it, it's, or one of the issues why it's possible is due to the 00:33:22.968,00:33:29.474 small key size, uhm, it's- it’s actually a bit unfair on, on GSM. I understand they were, you 00:33:29.474,00:33:34.479 know, during their standardisation process, uhm, they were acquired due to export 00:33:34.479,00:33:39.484 control regulations to have key sizes of maximum 64 bits but it ended up in the standard. Uh, 00:33:41.953,00:33:47.058 the organisation was caught between a rock and a hard place. Uh, regarding the rainbow table 00:33:47.058,00:33:52.063 compu, computation, uhm,. uh, we’ve, we've actually implemented, uhm, the bones- or 00:33:55.200,00:34:02.073 a proof of concept for computing the rainbow table. Uhm, and it would require a sig, a 00:34:02.073,00:34:06.678 significant amount of effort, so this isn't something that 1 person could do. Uh, it would 00:34:06.678,00:34:12.217 require at least a mid-level organisation, if not a large level of organisation. So, we do 00:34:12.217,00:34:18.290 want to emphasize that, uhm, what we did in the demo it was a, a real, enough, produced a 00:34:18.290,00:34:23.662 rainbow table enough to, uh, at least uhm show the concept. Uhm, regarding cellular security 00:34:23.662,00:34:28.667 itself, uhm, yea one of the reasons why this is all possible again, is the small key size, 00:34:31.636,00:34:36.641 uhm, in GSM, uhm, today full on support A5-1, A5-3 and A5-4, uhm, I understand, we 00:34:39.477,00:34:46.484 understand, uh, A5-4 is, uhm, deployed in some areas of the world. Uhm, but many other areas 00:34:46.484,00:34:51.489 continue to use 64-bit key size. Uhm, which, which can, is much less than what mis- misguidance 00:34:53.758,00:34:58.763 on what would be uh, used, what should be used 112-bit security for today. Uhm, and then the 00:35:01.499,00:35:07.138 second issue which we've shown here is ciphering is performed after control coding. Without 00:35:07.138,00:35:11.810 that, again, don't get our redundancy where we can go and, and crunch those bits together 00:35:11.810,00:35:16.815 uhm, which will provide us the indicator to choose the key. Uhm, and for it, just like for 00:35:20.051,00:35:25.256 the demo, any tests that we've done has, has been in a lab environment. We haven't, uhm, 00:35:25.256,00:35:30.629 gone out there and tested on a real network, for one thing. Uhm, I like my freedom. 00:35:30.629,00:35:36.735 [laughter] Uhm, I want to have a few beers after this and not spend the time in jail, so. 00:35:36.735,00:35:43.308 There you go. Uhm, what we're showing today is actually just one of the several, uh, attacks 00:35:43.308,00:35:45.310 that have been shown on GSM. Uhm, almost 10 years ago, uh, Carson Knowell, uhm, showed, uh, 00:35:45.310,00:35:50.949 how to attack phone privacy using plaintext. Uhmm there's a paper that Campbell referred to 00:35:50.949,00:35:55.954 earlier, uh, by Barken et al in 2006 which also used, uh, error controlled code redundancy. Uhm, 00:36:05.163,00:36:11.369 uh, to figure, to figure out what the key was and then mo- uh-, what received a lot of 00:36:11.369,00:36:16.207 press is the false space station attacks. So, we've all heard about stingrays and stuff like 00:36:16.207,00:36:21.212 that. Uhm, so, this is just like a, another issue that- that's there, there against uhm GSM, 00:36:24.616,00:36:30.922 uh, and I don't want to knock GSM. GSM is a great standard, right? It really brought mobile 00:36:30.922,00:36:35.927 telephoning, uh, digital telephoning uh to the world, but you live and learn. It's a 30 00:36:38.596,00:36:45.470 year old standard, I mean, uh, uh, it's, it's easy to uh complain in hindsight, right? 00:36:45.470,00:36:50.809 But the fact is they're choosing a small key size and the ciphering is performed after 00:36:50.809,00:36:55.814 error-control coding is added. Uhm, so, beyond GSM into 3G and 4G and 5G, uhm, in- in those 00:36:59.417,00:37:04.556 later standards, error-control coding was applied after encryption - like it should be, 00:37:04.556,00:37:09.561 right? So, the message should be, I mean, ideally, be totally random. So there shouldn't, 00:37:11.563,00:37:16.101 there shouldn't be any redundancy in there which, which you can use. Uhm, and also the- 00:37:16.101,00:37:21.106 the key sizes that they support, uhm, when performing encryption, uhm, or at least a 128 bits 00:37:23.808,00:37:29.881 long, so those two factors together, uhm, prevent any, any concern that we're showing 00:37:29.881,00:37:35.987 today. Additionally the industry is, is very proactive. They are, uhm, constantly trying to 00:37:35.987,00:37:42.026 secure, uh, the cellular industry. Uhm, they have a study item ongoing in SA-3, uhm one of 00:37:42.026,00:37:48.366 the three GPP working groups, uhm, are looking at security enhancements of, uh, false base 00:37:48.366,00:37:53.705 stations. So they are actively working in trying to protect us all. Uhm, so I, I don't want to 00:37:53.705,00:37:58.710 knock their efforts, and, uh, we've, we're talking about the, the GSMA organisation and, hum, 00:38:00.912,00:38:05.717 they've been very proactive on mitigations against what we're showing here as, as well today 00:38:05.717,00:38:10.722 so. Uhm, you know, we, we do think there's uh good work going on there. And I think that is 00:38:15.860,00:38:20.865 it. So, thank you all for your attention. [applause] We'll be outside. [applause]