1 00:00:00,000 --> 00:00:04,040 Today's presentation, Exploration of Cellular Based IoT Technology. 2 00:00:04,040 --> 00:00:12,660 In this particular presentation, in this research that me and Carlotta did, we did not focus on the cellular comms. 3 00:00:12,660 --> 00:00:30,600 We focused on figuring out how and what data is going out of cellular comms by doing interchip communication analysis via USB and UART and also how to control the cellular environment and cellular module to do cool things via direct interaction in the circuit board level. 4 00:00:34,730 --> 00:00:35,650 There we go. 5 00:00:35,890 --> 00:00:37,270 So my name is Daryl Hyland. 6 00:00:37,270 --> 00:00:41,510 I'm a research lead at Rapid7 working on IoT technology. 7 00:00:43,010 --> 00:00:48,430 And my name is Carlotta Bindner and I'm a lead security researcher at Thermo Fisher Scientific. 8 00:00:52,690 --> 00:00:58,510 So I just want to do a quick shout out to a friend of mine, Damian out of France. 9 00:00:58,790 --> 00:01:12,050 Some of the stuff that he did at this conference in Paris a number of years ago dealing with circuit board overlay to track out circuit runs at interesting points to tap into the circuit board was kind of cool and I've used it ever since. 10 00:01:12,270 --> 00:01:17,750 So let's go ahead and start off with the presentation and turn this over to Carlotta. 11 00:01:18,610 --> 00:01:32,550 So while Daryl mentioned that we are focused on the interchip communications, just to give you an idea about the type of technology that's being in use by the cellular devices that we picked, we focused on NB-IoT and LTE-M devices. 12 00:01:32,750 --> 00:01:41,910 These two protocols in particular have been developed specifically towards IoT there and we're going to step quickly through these two. 13 00:01:42,990 --> 00:01:44,530 Oh, there we go. 14 00:01:44,530 --> 00:01:48,530 So NB-IoT is also known as narrow band IoT. 15 00:01:48,570 --> 00:01:53,890 As you can see on the download and upload speeds, it's relatively low. 16 00:01:53,890 --> 00:01:56,770 It also only supports half duplex communication. 17 00:01:56,770 --> 00:02:11,130 This is intended because instead of using the high bandwidth that would cost a lot of money and also power, it's geared towards the IoT devices that are going to be deployed remotely or battery powered. 18 00:02:13,250 --> 00:02:15,190 I got to point it in the right direction. 19 00:02:15,950 --> 00:02:19,390 And then we have LTE-M which is machine type communication. 20 00:02:19,390 --> 00:02:26,990 Again, it has slightly higher speeds available than NB-IoT and supports full duplex communication. 21 00:02:26,990 --> 00:02:39,910 So this is best used in cases where like we're going to be transferring large amounts of data like video, audio, as opposed to NB-IoT which is popular for like sensors where the small amounts of data are being transferred. 22 00:02:40,990 --> 00:02:48,550 Now, the original NB-IoT and LTE-M were released in release 14 from the three GPP. 23 00:02:48,710 --> 00:02:55,990 And in consecutive releases, they've done things to improve the efficiency to help extend battery life. 24 00:02:56,170 --> 00:03:00,730 The original release only supported 4G so they've added 5G support. 25 00:03:01,150 --> 00:03:14,350 And then they've added small cell support which is these are small cellular nodes that would be deployed in a sort of mesh type network that allows for high bandwidth via like volume deployment. 26 00:03:17,560 --> 00:03:21,100 And now I'll hand it over to Daryl for interaction with hardware. 27 00:03:22,360 --> 00:03:24,200 Okay, I'll take a clicker. 28 00:03:25,320 --> 00:03:38,100 So when we're getting ready to engage cellular based technology, the actual hardware, Damian had demonstrated this at Hack in Paris. 29 00:03:38,200 --> 00:03:43,540 And what we want to do is we want to figure out how to interact in circuit. 30 00:03:43,540 --> 00:03:57,460 And often tracing out the key components, key locations, whether it's runs, circuit runs, various ways we can tap into the communications on the device, we think about it actually doing overlay. 31 00:03:57,460 --> 00:04:01,960 So we take images of both sides, reverse one of them and overlay it on the device. 32 00:04:03,880 --> 00:04:07,840 So that we can actually see all the components at the same time. 33 00:04:07,840 --> 00:04:13,820 It's really helpful for understanding at least the external layers of an actual circuit board. 34 00:04:13,820 --> 00:04:25,500 And then when we get into the cellular modules, the ability to overlay the cellular module in the orientation of the land grid arrays and we can see the land grid array structure. 35 00:04:25,940 --> 00:04:33,940 In this land grid array structure we can see the areas that are yellow and kind of coral color are kind of the key areas we want to see. 36 00:04:33,940 --> 00:04:36,480 The serial comms, the USB comms. 37 00:04:36,480 --> 00:04:45,160 And by doing that it gives us the ability to start thinking of where are the most likely points of access for these devices. 38 00:04:45,160 --> 00:04:50,100 Versus just randomly checking everything around the board, trying to figure out where it's at. 39 00:04:50,100 --> 00:04:58,260 By figuring the orientation on the circuit board, we can be more logical in our efforts to identify where to hook to everything. 40 00:04:58,850 --> 00:05:10,700 And also notice that as I mentioned the yellow and the actual coral color, the items of the most interest are always out around the outer edge. 41 00:05:10,700 --> 00:05:12,720 And how does that play out? 42 00:05:13,180 --> 00:05:18,040 So here is a circuit , a cellular module that's been pulled off. 43 00:05:18,040 --> 00:05:21,520 In this particular case we can see everything running around the outer edge. 44 00:05:21,520 --> 00:05:28,320 All the stuff that's inside is typically ground planes are not connected in almost every case. 45 00:05:28,540 --> 00:05:43,040 So what happens when we engage a device where there's nothing on the surface of the board and they've managed to route all the most critical communication underneath a sub layer in the circuit board? 46 00:05:43,040 --> 00:05:45,060 So I started playing around with that idea. 47 00:05:45,060 --> 00:05:47,020 How would we look at this? 48 00:05:47,060 --> 00:05:57,400 So what we did is we noticed on a lot of these cellular modules, if we turn it on the edge and magnify it, we kind of quickly see, we can see up underneath the edge of it. 49 00:05:57,400 --> 00:05:59,760 We can see some of the land grid arrays. 50 00:06:00,480 --> 00:06:04,440 So what we did was we went out and bought acupuncture needles. 51 00:06:05,020 --> 00:06:16,980 And using acupuncture needles, we literally inserted them underneath the edge of the chip to engage the communications that we're after. 52 00:06:17,380 --> 00:06:26,080 Making it possible for us to not need to actually chip off or cut through the layers of the board or other things in that particular case. 53 00:06:26,080 --> 00:06:27,820 And it came to be very effective. 54 00:06:27,820 --> 00:06:30,820 Now it doesn't necessarily work on all modules. 55 00:06:30,860 --> 00:06:41,260 This particular module, the critical connection points are only about a quarter millimeter or half a millimeter from the edge of the actual cellular module device. 56 00:06:41,720 --> 00:06:49,440 Some of the larger modules we found out it was three or four millimeters up underneath the edge, which is really not that far. 57 00:06:49,440 --> 00:06:54,080 But the problem is the larger the module, it has a tendency to have more of a cupping effect. 58 00:06:54,120 --> 00:06:57,840 So it closes down that edge so you can't always get to it. 59 00:06:57,840 --> 00:07:03,940 So if you're going to look at a cellular module on a board and you're thinking about needing to do this, just roll it up on edge. 60 00:07:03,940 --> 00:07:05,320 Is there a gap there? 61 00:07:05,320 --> 00:07:14,080 If there's any gap between that cellular module's board and the circuit board you're looking at, use acupuncture needles. 62 00:07:14,680 --> 00:07:18,200 Now also note acupuncture needles, you can't solder to them. 63 00:07:18,200 --> 00:07:19,220 They're stainless. 64 00:07:19,660 --> 00:07:30,080 So, uh, I found out that you can get some good crimp, crimping units and, and, and butt connectors and connect them up pretty good so they will be electrically sound. 65 00:07:30,420 --> 00:07:35,800 So we're going to go ahead and move on to AT commands Carlotta's going to talk about. 66 00:07:36,680 --> 00:07:42,740 So now that you have, if you have hardware access to the cellular module, how do you communicate it with, with it? 67 00:07:43,060 --> 00:07:48,480 Uh, cellular modules you, much like many other modems use AT commands. 68 00:07:48,480 --> 00:07:53,080 So AT commands were originally created for the HACE 300 modem back in the 1980s. 69 00:07:53,080 --> 00:07:59,280 And as technology, you know, continued to advance dial up and cellular, they continue to use AT commands. 70 00:07:59,280 --> 00:08:08,160 AT stands for attention and these commands are used for the debugging configuration of the modem, you know, making it connect up to the cellular network. 71 00:08:09,140 --> 00:08:14,400 When looking at AT commands, there are sort of four categories of how you can use AT commands. 72 00:08:14,480 --> 00:08:15,780 First there's the test command. 73 00:08:15,780 --> 00:08:18,820 The test command is sort of like a help menu for an AT command. 74 00:08:18,820 --> 00:08:23,000 You issue an AT test command to, with a equals and a question mark. 75 00:08:23,000 --> 00:08:31,340 And the cellular modem will respond with the parameters and the values that you can then submit to the cellular module to run the command. 76 00:08:31,760 --> 00:08:33,340 Then you have the read command. 77 00:08:33,340 --> 00:08:41,620 Uh, the read command will actually return the current values and the configurations if you, for that particular command, if you were to issue it to the cellular module. 78 00:08:41,900 --> 00:08:43,860 Uh, then you have write commands. 79 00:08:43,860 --> 00:08:50,760 These are how you actually perform configurations after learning how to, you know, use the te- using the test command on that AT command. 80 00:08:50,820 --> 00:08:58,160 And finally you have execute which would be to actually cause the, uh, cellular module to perform some sort of action. 81 00:09:00,680 --> 00:09:17,860 Now, during our research, we reviewed various different modules from different manufacturers and most manufacturers actually release AT command manuals specific to the act- the version of cellular module that you're using, uh, for development purposes and configuration. 82 00:09:17,960 --> 00:09:33,420 Um, in the ma- manuals, we, uh, notice that a lot of the different manufacturers, they have the sort of standard AT commands that are out there, but then they also have their custom syntax that usually used for configuration of specific features that are available with the module that the manufacturer has, 83 00:09:33,420 --> 00:09:34,520 you know, configured. 84 00:09:37,600 --> 00:09:39,960 So, what can we do with AT commands? 85 00:09:40,080 --> 00:09:47,800 Well, one of the big things at the beginning was just being able to perform information gathering and enumeration against the cellular modules that we had access to. 86 00:09:48,020 --> 00:09:57,360 Um, one of the most interesting commands that we did find, and it's a generic one and available on all of the cellular modules that we interacted with, was the AT clock command. 87 00:09:57,360 --> 00:10:02,480 And what this does is literally ask the cellular module, what AT commands do you- I have access to? 88 00:10:02,480 --> 00:10:03,600 What do you support? 89 00:10:04,100 --> 00:10:08,600 Um, although I- we will- I will, uh, circle back to that one in particular. 90 00:10:08,700 --> 00:10:16,040 Then, I mean, the AT commands you can get the manufacturer information, the model, the firmware version that the cellular module's running. 91 00:10:16,340 --> 00:10:21,920 And just to give you an idea, we have a quick demo on AT commands. 92 00:10:23,600 --> 00:10:24,680 There we go. 93 00:10:25,800 --> 00:10:31,620 So, we booted up the device, it responded with a ready. 94 00:10:33,160 --> 00:10:35,220 And here's that AT clock command. 95 00:10:35,220 --> 00:10:40,340 As you can see, it spit out a ton of AT commands that are available with this particular module. 96 00:10:40,340 --> 00:10:45,660 So, then you could go start doing- running test versions of those commands to get more information. 97 00:10:49,570 --> 00:10:57,850 Then we issued- this particular command returns the IMEI, so just like in your cell phone, there's an IMEI associated with every cellular device. 98 00:10:57,850 --> 00:11:04,930 And then the next one was the IMSI, which is used for like authentication up to the APN, billing, location. 99 00:11:06,610 --> 00:11:13,750 Um, this command returns the information about what band and channel the device is currently running on. 100 00:11:13,750 --> 00:11:15,750 So, it's running on LTE4. 101 00:11:16,570 --> 00:11:19,650 And then here's a custom command from QuackTel. 102 00:11:19,650 --> 00:11:24,550 And it's used for actually configuring this- the more advanced features available on the device. 103 00:11:26,370 --> 00:11:39,410 And one of the things about, like, these more advanced commands, or even just basic commands, especially the custom ones from the manufacturers, the manuals provide so much information about what each of them does and what the responses will be. 104 00:11:39,430 --> 00:11:48,830 So, in this case, we're checking if the web services are on when the device boots up and they are not indicated by the 0 at the end of the web services. 105 00:11:49,150 --> 00:11:51,370 And then we checked the WLAN services. 106 00:11:51,530 --> 00:11:55,590 So, and the 1 indicates that it is on when the device boots up. 107 00:11:58,030 --> 00:12:02,250 So, in addition to information gathering, we can also open sockets. 108 00:12:02,250 --> 00:12:05,010 Uh, cellular modules support HTTP. 109 00:12:05,010 --> 00:12:09,170 They support FTP and various other TCP IP protocols. 110 00:12:12,290 --> 00:12:19,390 So, as part of our research, we actually created some scripts to make it easier to get through all the AT commands available. 111 00:12:19,390 --> 00:12:24,270 Um, one in particular is the ATquery.py script, which is available on Daryl's GitHub. 112 00:12:24,730 --> 00:12:32,210 Um, this particular script allows us to either run a test or a read on a file containing all, a whole list of AT commands. 113 00:12:32,210 --> 00:12:44,050 So, we scraped AT command manuals, AT clock output, and combined that and then we're able to actually just iterate quickly through all the various commands to determine, okay, what does the cellular module actually support? 114 00:12:44,050 --> 00:12:57,750 Um, because we did find that in some cases, while the AT clock output was there and even the cellular, uh, the manual associated with that module has, you know, AT list, AT commands listed, some of them were not included in either of those resources. 115 00:13:00,580 --> 00:13:06,100 So, here's a quick demo of the AT command query script. 116 00:13:12,900 --> 00:13:21,620 So, we're going to check and make sure that the device, that we have a FTDID USB device connected, which is then connected to that, uh, it's a field camera. 117 00:13:23,020 --> 00:13:33,780 And then in the AT query script, you can actually configure the, you know, the FTDI USB device that's there and the baud rate associated with the, uh, the cellular modem. 118 00:13:34,840 --> 00:13:38,700 And our script does, we did add a quick help menu. 119 00:13:38,700 --> 00:13:44,820 Uh, you can configure the version, the manufacturer of the cellular module, whether you want to run a read or a test on it. 120 00:13:47,860 --> 00:13:53,340 And here we're just confirming that the device is on and ready to go before running the script. 121 00:13:53,340 --> 00:13:54,700 Otherwise, you're not going to get anything. 122 00:13:57,680 --> 00:14:01,560 And as you can see, it starts outputting the, uh, you know, results to the screen. 123 00:14:01,560 --> 00:14:04,460 It also saves it to a file that you could then parse through. 124 00:14:04,460 --> 00:14:13,940 In this case, we ran a test, so it's going through the whole list of AT, uh, commands that are in the text file and checking to see which ones are valid. 125 00:14:15,180 --> 00:14:22,300 And if you get, you know, an error that it's an invalid command, the, the module doesn't support it and doesn't know what to do with it. 126 00:14:25,130 --> 00:14:29,690 So, what types of communications are actually supported by cellular modules? 127 00:14:29,690 --> 00:14:44,250 During our research, uh, we found that with the, especially the field camera that we've been using for the demos, uh, it actually primarily used US high, high speed interchip USB to actually perform the AT commands issued. 128 00:14:44,250 --> 00:14:46,530 But it still had an active UART. 129 00:14:46,530 --> 00:14:53,590 So, these are the two main communication methods that cellular modules are going to use to try and, to be able to take in commands. 130 00:14:54,030 --> 00:14:58,310 Um, and in the case of UART, there's usually an external UART used for debugging. 131 00:14:58,310 --> 00:15:06,710 Uh, during research we found that the output of that would just indicate sort of the cellular modem booting up, but wouldn't actually take type, any type of input. 132 00:15:06,730 --> 00:15:19,770 And then the interchip UART, which would be between the cellular module and a CPU, would actually be the place that you would possibly see, uh, you know, it would be a primary use case for receiving AT commands. 133 00:15:19,970 --> 00:15:28,910 But during our research we found that all we saw was on boot up, we'd see a ready, and then during power down there would be a message that it was being powered down. 134 00:15:28,910 --> 00:15:32,450 The AT commands were not actually being sent via the UART. 135 00:15:33,930 --> 00:15:37,030 And now I'll hand it back to Daryl for USB capture and decoding. 136 00:15:39,990 --> 00:15:41,010 Thank you. 137 00:15:41,590 --> 00:15:43,470 So, we're still on time, which is good. 138 00:15:44,310 --> 00:15:48,730 So, um, the field camera she was talking about is kind of like one of these. 139 00:15:49,050 --> 00:15:54,630 Uh, one that you put out in a field to capture, uh, wildlife photos and stuff like that that we were using. 140 00:15:55,130 --> 00:15:56,890 Uh, in this particular case. 141 00:15:56,970 --> 00:16:01,870 So, one of the things I always wanted to do is, uh, capture, uh, USB. 142 00:16:02,010 --> 00:16:06,650 And there's a number of tools out there for capturing USB, but most of those are in line. 143 00:16:06,890 --> 00:16:13,310 So I had to start hunting around and try to find one, because what we want to do is sniff USB in circuit. 144 00:16:13,910 --> 00:16:16,150 And there's very few devices that do that. 145 00:16:17,210 --> 00:16:24,890 So, um, on this particular device, this interchip device, we kind of map out the USB from the actual cell module. 146 00:16:24,890 --> 00:16:26,710 We need to figure out where it's at. 147 00:16:26,870 --> 00:16:38,990 I've opened up a number of devices that utilize USB and found that, uh, not all of them, but many of them, they actually were bringing the USB to the surface and putting terminator resistors in there. 148 00:16:38,990 --> 00:16:44,610 And we got a, got a picture here showing those terminating resistors, impedance matching resistors. 149 00:16:44,630 --> 00:16:46,130 Uh, at least that's what they appeared by. 150 00:16:46,130 --> 00:16:51,630 I eventually ended up measuring them, found out they were really zero ohm resistors. 151 00:16:51,630 --> 00:16:54,870 So they were actually purely as a pass through. 152 00:16:55,570 --> 00:17:04,290 So, uh, what we needed to do is to be able to attach into a USB bus, you can rarely connect straight into it. 153 00:17:04,290 --> 00:17:08,010 You will actually load the circuit down and communications will fail. 154 00:17:08,070 --> 00:17:16,610 With a particular manufacturer of device that we used to sniff this data, they recommended using a 20 to 40 ohm resistor. 155 00:17:16,730 --> 00:17:24,690 So in this case, we actually soldered straight to the, to the circuit board a 32, 33 ohm resistors so that we can tap into. 156 00:17:24,850 --> 00:17:27,890 And we were able to tap into those devices. 157 00:17:28,190 --> 00:17:32,650 And, uh, the device we happened to use was a Beagle, a Beagle 480. 158 00:17:32,650 --> 00:17:34,690 It's not a cheap device. 159 00:17:35,030 --> 00:17:36,810 It's about $1,200, $1,300. 160 00:17:37,270 --> 00:17:41,530 But if you're doing this work professionally, this works really well. 161 00:17:41,530 --> 00:17:46,910 It's kind of amazing how well it works for capture and interchip communications for USB. 162 00:17:47,810 --> 00:17:51,470 And we can show it here where we actually hook the device up. 163 00:17:51,470 --> 00:18:06,030 In this particular case, um, and many, if you're tapping into the USB communication lines, often the power lines associated with that, the 5 volts that tells the, it's fed with the USB also, doesn't show up. 164 00:18:06,030 --> 00:18:08,170 It's not on the surface you can connect into. 165 00:18:08,170 --> 00:18:14,890 So the black and, and red wires you see there are me just feeding a 5 volt power supply, external power supply. 166 00:18:14,890 --> 00:18:18,490 So my Beagle thinks the entire USB is functioning. 167 00:18:18,910 --> 00:18:24,590 Uh, there's some software changes you can make that the vendor has to actually turn that off. 168 00:18:24,590 --> 00:18:25,890 I have not done that yet. 169 00:18:25,890 --> 00:18:28,290 I probably won't in case I ever need it. 170 00:18:28,410 --> 00:18:35,550 But let's go ahead and, uh, look at actually capturing USB traffic in this particular case. 171 00:18:37,170 --> 00:18:40,590 So, uh, they have their application that comes with it. 172 00:18:40,590 --> 00:18:46,250 I know this is small but we're going to kind of blow in or, or, or sink into some of the more critical stuff. 173 00:18:46,310 --> 00:18:47,950 Jump over here real quick. 174 00:18:48,770 --> 00:18:55,970 So we can see we, we've hooked up, we power up the device, we quickly see a lot of USB handshake data taking place. 175 00:18:56,130 --> 00:19:01,930 Uh, and now it's connected out and what we want to do is we configure the device to only show data. 176 00:19:01,930 --> 00:19:03,170 Because that's all we care about. 177 00:19:03,170 --> 00:19:05,270 I don't care about the USB stuff. 178 00:19:05,350 --> 00:19:10,730 So you quickly, you can see in there that you're seeing a lot of those AT commands being transferred. 179 00:19:11,530 --> 00:19:19,950 Some of the stuff that Carlotta run, you actually see there as it's setting up the communication channel, uh, with the cellular's APN and all that type of stuff. 180 00:19:24,350 --> 00:19:30,830 So again, a lot of interesting serial number data, configuration data, firmware version data that are running on the device. 181 00:19:30,830 --> 00:19:34,310 All this kind of data is kind of set out there requested on the device. 182 00:19:34,550 --> 00:19:36,870 But we get into, we can see it collected out. 183 00:19:36,870 --> 00:19:40,110 That was it's uh, APN that it connected to. 184 00:19:40,110 --> 00:19:41,130 It was a special one. 185 00:19:41,130 --> 00:19:43,230 It's not a private but it's a special one. 186 00:19:43,290 --> 00:19:48,830 So then what we want to do is this device is connecting out and actually communicating real data out. 187 00:19:48,830 --> 00:19:50,710 It's taking photos and sending them out. 188 00:19:50,710 --> 00:19:52,310 And that's what I wanted to see. 189 00:19:52,570 --> 00:20:02,610 So we quickly, uh, search for this whole bucket thing and we start finding things like uh, certificates, keys, passwords. 190 00:20:02,610 --> 00:20:13,330 We see this device clear, basically clear text, passwords, keys, everything connecting out to an actual S3 bucket to communicate all this data. 191 00:20:13,330 --> 00:20:22,370 With all, everything we ever would need to know as a, uh, a tester, how this thing's connecting out to it's back end systems. 192 00:20:22,370 --> 00:20:32,110 Again, as you can see, versus trying to do stuff over cellular, which is encrypted, interchip comms often contains no encrypted data. 193 00:20:32,110 --> 00:20:38,390 And you can intercept that data and gain access, uh, a large amount of interesting stuff. 194 00:20:38,390 --> 00:20:51,610 I think this screen showed it actually sending out, uh, uh, data actually associated with, uh, the actual, um, configuration on the, on the device. 195 00:20:51,610 --> 00:21:00,650 So again, in this particular device, and Carlotte had mentioned this, both of the circuits were in, in use. 196 00:21:00,650 --> 00:21:01,610 Both of them were hooked up. 197 00:21:01,610 --> 00:21:07,250 Both the USB and the main UART were actually functioning on this or connected up. 198 00:21:07,250 --> 00:21:09,110 That's not always the case. 199 00:21:09,110 --> 00:21:19,190 Often a device that'll support both USB and all main UART communications often won't have both of them connected up. 200 00:21:19,190 --> 00:21:23,310 One of them will be dummied off and the other one's the only one connected in circuit. 201 00:21:23,410 --> 00:21:30,270 In those particular cases, in this case, which we'll show a little later, we're able to connect into the UART and control it. 202 00:21:30,270 --> 00:21:32,830 I think some of the examples already showed that. 203 00:21:32,850 --> 00:21:37,130 Because they still connected it to the main CPU on the device. 204 00:21:37,130 --> 00:21:38,330 Which is kind of cool. 205 00:21:38,330 --> 00:21:39,590 It made it easier for us. 206 00:21:39,590 --> 00:21:45,370 I didn't have to get into weird stuff with, uh, uh, sticking pins up underneath the body of the thing. 207 00:21:45,370 --> 00:21:49,490 We're able to just cut the actual circuits that do that type of stuff. 208 00:21:50,550 --> 00:22:00,970 So I'm going to turn this over to Carlotta and she's going to talk to us about connecting up and understanding serial communications through interchip and how we interact with that. 209 00:22:03,780 --> 00:22:04,660 Okay. 210 00:22:05,220 --> 00:22:13,620 So in the case of interchip communications for our cellular module, as I previously mentioned, it's going to be connecting over to a, to the CPU of the device. 211 00:22:13,620 --> 00:22:17,960 And in the case of this trail camera, it was using an EG91, which we have here. 212 00:22:18,840 --> 00:22:23,100 The thing is, for the actual UART communications, there's two separate lines going. 213 00:22:23,320 --> 00:22:29,780 So the, the, there's one line where the CPU is transmitting and then the, uh, cellular module is receiving. 214 00:22:29,780 --> 00:22:35,340 And then the cellular module is receiving on a separate line from the, the responses from that cellular module. 215 00:22:36,200 --> 00:22:43,940 So in order to actually get a full picture of the communications that are going between these two devices, we need two FTDI to USB devices. 216 00:22:44,000 --> 00:22:49,520 One receiving on one line and one on the other to get a full picture of the communications. 217 00:22:49,780 --> 00:22:59,860 Now this is only to be able to listen in on those communications and that's how we saw the, you know, when on power up that the cellular module was sending a ready and then on power down it was sending a power down. 218 00:23:01,900 --> 00:23:17,980 Now in order to actually be able to inject those AT commands like you saw in the AT query script, uh, demo that was run and everything, uh, we actually have to sever those connections between the CPU and the, that cellular module and put ourself pretty much in the place of the CPU. 219 00:23:18,080 --> 00:23:31,320 So we'd not, we'd only need one FTDI to USB device in this case and just like regular UR, you'd hook up the transmit to the receive on the cellular module and then the FTDI is received to the transmit on the cellular module. 220 00:23:33,380 --> 00:23:36,540 So here is, you know, three images here. 221 00:23:36,540 --> 00:23:44,960 On the far left we've identified that transmit and receive for the cellular module and the line that's going between it and the CPU. 222 00:23:45,120 --> 00:23:54,700 In the center there we've actually soldered wires to two different sides because on that far right image we've actually cut the traces between the two. 223 00:23:55,800 --> 00:24:01,720 Now in order to be able to continue to be able to listen in possibly on the communications we built a breakout board. 224 00:24:01,720 --> 00:24:08,120 So the side that's connected to the CPU is connected to the breakout board as is the side that we have the cellular module. 225 00:24:08,340 --> 00:24:10,860 So they can continue to function as normal. 226 00:24:11,020 --> 00:24:14,860 As long as, in the center there you can see that there are toggle switches. 227 00:24:15,380 --> 00:24:20,560 If they're in the on position the communications can continue between those two parts fine. 228 00:24:20,560 --> 00:24:29,520 But we can then turn them off and then connect to just one of the FTDI devices as you can see in the image and then issue those AT commands to the cellular module. 229 00:24:31,960 --> 00:24:36,240 And I will hand it back over to Daryl to talk about injected targeted attacks. 230 00:24:38,640 --> 00:24:39,680 Okay. 231 00:24:40,260 --> 00:24:46,520 To kind of mention a little bit on something else to add to the serial communication. 232 00:24:47,020 --> 00:24:58,000 We also, I also a couple years ago released a paper on interchip communication analysis and we released a proof of concept code called a Karen proxy. 233 00:24:58,480 --> 00:25:21,060 Now it wouldn't work in this case because we haven't set it up to handle ASCII but when we're dealing with devices where there's no ASCII data but just hex data going over, a Karen proxy would give us the ability to cut the circuit, throw the switches and route both sides back into a Python code script that would actually capture data going in both directions , 234 00:25:21,060 --> 00:25:33,500 allow you to replay data, capture and replay data and also capture and replay data and actually set filters to say when you see this hex string, replace it this one. 235 00:25:33,500 --> 00:25:56,560 Still a proof of concept, we can probably use some more development but it, it takes this to a new level and I was just talking to the guy this last week about let's add the ability to throw ASCII in there , use standard carriage return structures which is often what we see when we're talking about communication over the main AT or the main UART communication to cellular modules. 236 00:25:57,180 --> 00:26:04,340 So, in this part here, AT commands, so we wanted to start thinking about what can we do here? 237 00:26:04,340 --> 00:26:19,500 So we've, we've, we've looked at these devices, we can capture all the USB communications, which is a wealth of information if you're doing any kind of assessment or testing on a device and then we can actually send AT commands but what can we do? 238 00:26:19,820 --> 00:26:34,480 Again, we're still in the early stage of this but I have an example in here of something I thought was kind of cool as proving the potential capability but I want to start talking about this is how we've tapped into this device. 239 00:26:34,600 --> 00:26:36,700 So we have the device here. 240 00:26:36,800 --> 00:26:38,700 It's a trail camera. 241 00:26:39,040 --> 00:26:43,320 USB is what it uses primarily for all of its communication. 242 00:26:43,720 --> 00:26:50,120 The serial communication between the primary processor is in use so who cares if it's connected to the CPU? 243 00:26:50,120 --> 00:26:57,320 So we cut it and we hook up to it that way so we can pretty much send commands at will while the device is powered up. 244 00:26:57,680 --> 00:27:04,120 Again, I don't think if you remember one of the videos earlier, you've seen power down. 245 00:27:04,400 --> 00:27:07,360 Like any of these devices, they're not going to stay powered up. 246 00:27:07,360 --> 00:27:11,360 So they'll stay powered up for a certain period of time and then they'll do a time cycle. 247 00:27:11,500 --> 00:27:14,180 And they'll actually shut down the conserved batteries. 248 00:27:14,220 --> 00:27:17,880 So when you're testing them, you kind of have to deal with the fact that it's doing this. 249 00:27:17,880 --> 00:27:25,720 But with AT commands, potentially you can shut all that functionality off, especially if you're feeding an external power supply versus batteries into it. 250 00:27:25,720 --> 00:27:27,900 So that's how we tapped into it. 251 00:27:28,300 --> 00:27:43,900 So one of the things we wanted to do is, this particular module, as Carlotta had mentioned, when we pulled down all the AT commands that are available, looked AT command manuals, it didn't really show anything about socket capability. 252 00:27:44,040 --> 00:27:50,040 But when we run our test script against it, we found out socket capability was available. 253 00:27:50,080 --> 00:27:56,540 In this particular case, it's QI open and QI closed, where we can actually set up real sockets. 254 00:27:56,740 --> 00:28:09,500 In the first one there, we show that we connected out to a port over an IP and it actually failed and it came back with, what is that number, I think it's 566, and basically says the socket's not open. 255 00:28:09,980 --> 00:28:15,480 I think this actually shows that at the bottom it came back with a zero on that particular port. 256 00:28:15,600 --> 00:28:19,800 So we start thinking about this, hey, what can we do with that? 257 00:28:20,000 --> 00:28:25,540 One, with these sockets you can do a lot of things, but what if we wanted to do like a port scan? 258 00:28:26,540 --> 00:28:30,860 You know, can we use the device to port scan some of the back end stuff? 259 00:28:30,860 --> 00:28:34,960 And here's all of the ATQI open error messages that come back. 260 00:28:34,960 --> 00:28:45,940 So we get a wealth of information based on this information, whether the socket's available, it's open, it's closed, or some other error. 261 00:28:46,620 --> 00:28:52,100 When I was initially working for this, I got some of the command structure backwards, so I was throwing all kinds of weird errors. 262 00:28:52,100 --> 00:28:53,760 I'm like, why ain't this thing working? 263 00:28:53,820 --> 00:29:01,160 Finally figured it out after I sat down with a manual that talked about QI open, got the structure right, and we kind of moved on from there . 264 00:29:02,340 --> 00:29:05,560 So here's the actual code that we're going to show here in a minute. 265 00:29:05,560 --> 00:29:07,360 It's a simple Python script. 266 00:29:07,500 --> 00:29:11,400 This is actually on our GitHub also, so if you want to play around with it. 267 00:29:11,400 --> 00:29:14,640 The yellow stuff is kind of the important stuff. 268 00:29:14,640 --> 00:29:20,220 So basically we can set up the USB port that we want to connect through for the TLL. 269 00:29:20,520 --> 00:29:26,340 And then we can go into the IP addresses, port numbers, and the bottom is open, close the circuit. 270 00:29:26,480 --> 00:29:29,580 So let's open and close the socket and see what happens. 271 00:29:29,980 --> 00:29:32,380 So let's go ahead and run a quick demo. 272 00:29:33,060 --> 00:29:38,380 So again, this demo is not pointed to anyone's back end system. 273 00:29:38,380 --> 00:29:39,900 We're doing it as a proof of concept. 274 00:29:40,040 --> 00:29:45,200 So I pointed at InMaps, InMaps server, the one they allow you to run scans with, with InMap. 275 00:29:45,560 --> 00:29:47,780 So I wouldn't like to make anyone mad. 276 00:29:48,420 --> 00:29:50,320 And let's go ahead and run this. 277 00:29:52,840 --> 00:29:54,620 So we turn the device on. 278 00:29:54,620 --> 00:29:59,420 First thing we want to do, let's make sure that it's actually up and ready. 279 00:30:03,520 --> 00:30:06,000 Make sure I have all my connections right. 280 00:30:08,400 --> 00:30:10,100 Turn the unit on. 281 00:30:10,520 --> 00:30:12,540 See my grubby little fingers there? 282 00:30:16,020 --> 00:30:17,100 We got it ready. 283 00:30:17,100 --> 00:30:18,680 So now we can run the command. 284 00:30:19,820 --> 00:30:30,940 And initially this thing is going to go out and we can literally point it at any IP address, any number of ports, any number of IP addresses, and instantly it starts returning data. 285 00:30:30,940 --> 00:30:33,100 So we'll see a 00 come back. 286 00:30:33,100 --> 00:30:34,500 That port is open. 287 00:30:34,500 --> 00:30:36,560 We have 0 5 6 6 come back. 288 00:30:36,560 --> 00:30:38,160 That port is closed. 289 00:30:38,240 --> 00:30:42,160 So from here we're actually able to do port scans to this device. 290 00:30:42,720 --> 00:30:50,240 I think there's a wealth of more things we could do where we can actually control these cellular modules to do some of this stuff. 291 00:30:51,140 --> 00:30:53,320 And let's go ahead and let it finish running. 292 00:30:55,060 --> 00:30:57,340 I think that's pretty straight forward what we got there. 293 00:30:57,340 --> 00:30:59,100 Ramp G, do port scans. 294 00:31:01,540 --> 00:31:06,400 I think 1337 I think is open or something like that. 295 00:31:06,520 --> 00:31:10,680 So a couple of the, you know, the weird ports, a couple of common ports. 296 00:31:10,680 --> 00:31:12,160 But now we've done a port scan. 297 00:31:12,160 --> 00:31:14,600 We've basically taken a trail camera. 298 00:31:14,880 --> 00:31:19,340 And while this is taking place, we did not alter the trail camera's function. 299 00:31:19,540 --> 00:31:23,740 It contended communicating out to the S3 bucket functioning normal. 300 00:31:23,900 --> 00:31:28,140 We just asked it to do a port scan using its socket capability. 301 00:31:28,340 --> 00:31:30,700 And we were successful in doing that. 302 00:31:31,500 --> 00:31:33,480 So where's this come into play? 303 00:31:34,300 --> 00:31:46,980 So if I'm doing, if I'm going to be assessing a target for a company that uses cellular backhaul for its communications, and let's say they're using a private APN. 304 00:31:46,980 --> 00:31:48,960 That private APN goes out. 305 00:31:48,960 --> 00:31:50,300 It goes through a VPN. 306 00:31:50,300 --> 00:31:58,240 It hits either some closed cloud service or it hits their actual internal company network through this VPN. 307 00:31:58,540 --> 00:32:00,780 And no one on the Internet has access to it. 308 00:32:00,780 --> 00:32:08,940 So no matter what data you get, you can't attack those back-end systems or test the overall ecosystem of the technology. 309 00:32:09,360 --> 00:32:24,040 But if we engage the device itself with what we showed here, it gives us the ability to actually go through that tunnel that's already been set up by the device through the private APN to the back-end services. 310 00:32:24,060 --> 00:32:27,580 And initially we can do a port scan on devices back there. 311 00:32:27,660 --> 00:32:46,920 Next we can actually, once we have those ports, we can set up sockets and start communicating to those devices in the area that is supposed to be trusted or secured, because we're looking at companies that are looking at security purely from a machine -to-machine environment in a closed back-end, 312 00:32:46,920 --> 00:32:48,840 which they would think would be secure. 313 00:32:48,880 --> 00:32:52,360 In this case, we can actually prove that's not the case. 314 00:32:52,360 --> 00:32:57,860 We can use the device, control the device, and set up our own connections and own tunnels to the back-end. 315 00:32:57,860 --> 00:33:01,920 So the first image is what we conceive of a private APN. 316 00:33:01,920 --> 00:33:04,120 The second one is more of a public APN. 317 00:33:04,120 --> 00:33:06,080 And that's kind of where this device was. 318 00:33:06,080 --> 00:33:12,600 So it kind of allowed us to actually go out and port scan and map in this case. 319 00:33:12,620 --> 00:33:18,440 But I have run into a number of devices that were on private APNs where we could not get access. 320 00:33:18,520 --> 00:33:21,360 And it's kind of the driving force around this research. 321 00:33:21,400 --> 00:33:32,460 How do we build out a knowledge base so pen testers, IOT testers, can go to that next level and look at the overall ecosystem effectively? 322 00:33:32,620 --> 00:33:37,000 And interchip communication and control is the best way to get there in my opinion. 323 00:33:37,060 --> 00:33:41,820 And I'm hopeful we got that over to you guys and you were able to get something out of this. 324 00:33:42,000 --> 00:33:46,980 Here is the actual data. 325 00:33:46,980 --> 00:33:50,700 So that's the GitHub and stuff like that that you can actually get to. 326 00:33:50,700 --> 00:33:51,600 A couple papers. 327 00:33:51,600 --> 00:33:55,980 We actually published a paper last week on this subject. 328 00:33:55,980 --> 00:33:58,160 So bring it down and check it out. 329 00:33:58,160 --> 00:34:00,780 We talk about a lot more in that paper. 330 00:34:00,780 --> 00:34:09,120 At least from the subject of engaging interactively on the hardware and how to trace things out effectively. 331 00:34:09,260 --> 00:34:19,760 We get into dechipping, taking chips off and actually rerouting circuits on the board and then putting the cellular modules back on, things like that. 332 00:34:20,100 --> 00:34:22,580 So we cover a lot of other cool stuff. 333 00:34:22,580 --> 00:34:24,100 So check out that paper. 334 00:34:24,440 --> 00:34:26,180 So I don't know if we have time for questions. 335 00:34:26,180 --> 00:34:27,060 We're probably out. 336 00:34:27,060 --> 00:34:29,040 But we're going to be around. 337 00:34:29,040 --> 00:34:34,800 So grab us when we get packed up off stage and I'd be glad to talk about more things with you. 338 00:34:36,280 --> 00:34:37,300 Thank you.