00:00:00.534-->00:00:05.539 >> So it’s Erwin and Matt Day, let’s give them a big DEF CON welcome. [applause] >> Hey, good 00:00:10.377-->00:00:15.382 mo- good morning all, uh thanks for being here early for some of you who don’t have kids yet. Um, 00:00:18.585-->00:00:24.925 so just a quick introduction. So, I’m Erwin, uh that’s Mattijs or Matt if you may want to call 00:00:24.925-->00:00:31.098 him. Uh we both work at uh Nixu. Uh which is a Finnish company but we actually work for the 00:00:31.098-->00:00:36.336 Dutch uh branch in fo this so we’re based in Amsterdam. As you can see it took us quite some, 00:00:36.336-->00:00:41.341 some time to get here. Um, so. What is it that we’re gonna talk about. Well we’re gonna talk 00:00:43.777-->00:00:48.982 about what is industrial SensorNet works. Um but let’s get to look back at like what 00:00:48.982-->00:00:53.987 has been done before. Um, as you can see, um, the earliest research was ready don’t in 00:00:56.757-->00:01:01.695 2009. More academic research about potential attacks and um, the attacks were, were, were 00:01:04.631-->00:01:11.038 described but not demonstrated. There was no information how you could actually uh recreate the 00:01:11.038-->00:01:17.044 attacks yourself. And um there, there’s and that’s, th- that’s, sort of continues because then 00:01:17.044-->00:01:23.784 in, in 2015 was actually a PHD student in the Netherlands who did also similar research and 00:01:23.784-->00:01:28.789 actually tried to build i- uh, a tool to, to interact with these networks and um, h- he didn’t 00:01:31.658-->00:01:36.463 really succeed. So w- he was using XDR based systems initially, in the end he, he 00:01:36.463-->00:01:41.435 didn’t really succeed in, in actually uh capturing, trap- trapping or modifying the 00:01:41.435-->00:01:47.441 traffic. So, then we came along and we did a presentation at S4. Um, and then we already opted 00:01:47.441-->00:01:53.880 the ID to actually create a toolkit to be able to um actually uh capture traffic, 00:01:53.880-->00:01:58.352 inject traffic, etcetera. Um, that, that’s a couple of years ago but unfortunately, we never 00:01:58.352-->00:02:02.923 got around to actually doing it because we, we soon l- left the company we- we were working at, 00:02:02.923-->00:02:07.928 at the time. Um and in, in the meantime we had, we had Blake Johnson again, um th- using SDR 00:02:10.163-->00:02:14.501 based approach uh to, to interact with this network. But again, no codes were released, 00:02:14.501-->00:02:19.740 no tools nothing, so. I mean these networks are around for quite a while but still there 00:02:19.740-->00:02:24.077 are no tools and, and we strongly believe in, uh, in Wright’s principle which is 00:02:24.077-->00:02:31.084 written down there. Uh, the guy Joshua Write uh who actually, uh said that well if there are no 00:02:31.084-->00:02:35.856 tools uh security will not improve. So, we, we were actually attending DEF CON uh 00:02:35.856-->00:02:41.261 last year as, as just um, not a speaker but as a regular visitor. And we’re like, well 00:02:41.261-->00:02:48.001 let’s build those tools because it’s still missing. Um, and just to give you and idea. Um, w- 00:02:48.001-->00:02:53.907 what’s in, what industrial revolution is for this type of systems. So first, uh we’re 00:02:53.907-->00:02:59.012 talking about industrial control systems here. So first we had, uh the Air Pressure systems, in, 00:02:59.012-->00:03:03.950 in 1940’s. Uh, 1950’s they start using analog current loops. Um in the meantime I’m really 00:03:06.153-->00:03:10.357 familiar with that part because it actually allowed me to destroy some of th, uh the 00:03:10.357-->00:03:14.728 component we were testing. Um, but later on they actually started creating digital 00:03:14.728-->00:03:19.599 protocols. So on top of the current loop, they, they implemented the HART protocol 00:03:19.599-->00:03:25.672 which you may be familiar with, or not. An, and, and in late 2000,’s they thought well let’s 00:03:25.672-->00:03:30.677 do it wireless and they created 2 uh standards, WirelessHART and ISA100, 11a. Formerly named SI 00:03:33.380-->00:03:38.385 7100. So is anybody familiar with this protocols. Have you ever heard about it? No. Uh, not 00:03:41.388-->00:03:47.327 that many okay well it’s, for most people it’s very niches but uh still, it’s its interesting 00:03:47.327-->00:03:52.365 and if you’re wondering where, where this systems being used. Uh for instance oil and, and gas 00:03:52.365-->00:03:57.237 fields, uh, you you can see those transmitters. So you see the blue ones, they’re actually 00:03:57.237-->00:04:01.875 field devices. So these are transmitters and, and they’re actually measuring things like 00:04:01.875-->00:04:07.581 uh pressure or temperature and then transmit wirelessly to uh the central system but we get to 00:04:07.581-->00:04:12.586 that. Um, also an industrial uh control loop process control lop I think it’s good to, to sort of 00:04:16.356-->00:04:22.095 explain how that works. So basically, you have a flow transmitter all the way on the 00:04:22.095-->00:04:27.100 right and uh there’s an a- a signal being sent to the central controller and that for instance 00:04:29.102-->00:04:34.407 indicates the flow rate. Uh that’s called the process value, and that process values is 00:04:34.407-->00:04:39.412 actually uh checked against um set points. And, and if it’s within r- ranged nothing happens 00:04:41.781-->00:04:46.286 but if, if something needs to happen there’s actually control outputs. So that’s the bottom 00:04:46.286-->00:04:52.159 line and then a valve is actually changed i- in uh from, from open to closed to, to 00:04:52.159-->00:04:58.832 adjust the flow and so this is the typical uh process loop. And what you see is that typically 00:04:58.832-->00:05:05.739 up until now um, m- mainly the mastering part is done wireless. Either with WirelessHART or ISA 00:05:05.739-->00:05:10.744 100. Um so if you at that a bit more at, at WirelessHART it’s actually um the same HART 00:05:13.480-->00:05:18.985 protocol the application layer but they, they uh created a wireless uh, wireless deck for 00:05:18.985-->00:05:24.424 it. So, it’s, it’s compatible with, with the HART devices out there. Um, it does use 00:05:24.424-->00:05:31.031 encryption so it’s not the most uh insecure, uh control uh protocol. Um, but it’s, it’s 00:05:31.031-->00:05:37.304 metric encryption and, and we get to that in, in the uh later slides a bit more. Um, it’s 00:05:37.304-->00:05:42.075 based on, on, on wireless technology from uh, from Dust Networks because they are also 00:05:42.075-->00:05:48.381 the ones creating the, the radios. So, radio system on the chip. Um, and, and you see 00:05:48.381-->00:05:53.053 there, there’s, there’s a couple of vendors who actually build equipment uh for, for 00:05:53.053-->00:05:58.058 WirelessHART. So, ISA 100, th- there’s fewer companies actually uh supporting it, uh the main 00:06:01.394-->00:06:07.367 driver is YOKOGAWA and also Honeywell. Um and there’s actually uh, like a whole bunch 00:06:07.367-->00:06:11.705 of standards, it’s, it’s its’ based on. So, there’s the 6LoWPAN there’s IBv6, 00:06:11.705-->00:06:16.710 surprisingly. And UDP on, on top of that. And um, it’s it allows you to tunnel under uh other 00:06:21.314-->00:06:25.819 protocols. So, it’s not like, uh they, they took an existing protocol with w- has with 00:06:25.819-->00:06:30.891 WirelessHART and, and built wireless tech for it. But you’re able to, to tunnel and so it’s 00:06:30.891-->00:06:37.764 it’s it’s more uh, vendor neutral. And th-, th- the mainly developed by a company it’s 00:06:37.764-->00:06:44.404 called Nivis. Um, who, who created the system on uh, on uh, on the chip. Un initially. But 00:06:44.404-->00:06:49.409 now they’re more up chips out there from, from different vendors. So, what does typical 00:06:51.511-->00:06:58.518 topology look like? Um, well these are mesh networks so there is not well there is a central 00:06:58.518-->00:07:03.423 system that orchestrates the mesh. Um that’s the gateway, network manager, security 00:07:03.423-->00:07:09.095 manager. Typically, that’s just 1 box, 1 device as you can see on the right. Um, but there is, 00:07:09.095-->00:07:15.368 there, there’s still devices out there and there’s, there’s each a couple of um, different ones. 00:07:15.368-->00:07:19.272 You can see in the picture. So, you have the field devices, devices that actually measures 00:07:19.272-->00:07:24.844 stuff. Um that, that have, have wireless transmitters themselves or you have the situation where 00:07:24.844-->00:07:29.916 for instance where you have a HART. Uh, a HART enabled transmitter and then you can add 00:07:29.916-->00:07:35.322 an adapter, and, and they can communicate. But since it’s a, a w- a w- wireless and mesh 00:07:35.322-->00:07:40.126 network. Also, the field devices can route traffic for all the devices. So it’s not point to 00:07:40.126-->00:07:46.700 point, uh, only. Um, and you have on the, the right-hand side you have the wireless hard 00:07:46.700-->00:07:51.671 handheld and that’s being used to actually configure uh the devices. So, before they can 00:07:51.671-->00:07:56.843 join the network you have to configure them and then uh, they, they will join and the 00:07:56.843-->00:08:01.781 network. So, if you look at the protocol stacks um, y- you can see that, that on, on um the 00:08:07.620-->00:08:12.592 HART side there, there’s actually on, on, on the left-hand side you can actually 00:08:12.592-->00:08:17.597 um, see the, the, th- the traditional HART and, and um, on the right hand side you see th- 00:08:20.133-->00:08:25.138 the WirelessHART. So, it’s space related to 15 dot 4. Um, but they uh they use only very thin 00:08:28.708-->00:08:34.647 layer of, of that protocol. But everything that build on top is specifically wire- WirelessHART 00:08:34.647-->00:08:39.319 and, and one of the things uh to l- to play attention to, is, is the channel hopping because, we 00:08:39.319-->00:08:44.324 get back to that later, that’s something that was challenging to, to show. Um, and, also on, 00:08:46.626-->00:08:51.131 on the ISA, on the other side we see a similar thing so, it's again a, a thin, uh 802 dot 15 00:08:51.131-->00:08:57.804 dot 4 layer and then you see the whole protocol stack uh, on top with a UDP etcetera, etcetera. 00:08:57.804-->00:09:04.377 And although it’s not listed in, in this um, in this overview they also do channel hopping uh 00:09:04.377-->00:09:09.382 as well. So, to, to summarize to the similarities because we have 2 wireless protocols out there 00:09:12.352-->00:09:17.223 which sh- somewhat similar and, and we thought, well can we build 2 kilt to actually uh 00:09:17.223-->00:09:23.797 assess both of those, uh of those systems? So they both have the, the shared 802 15 dot 4 00:09:23.797-->00:09:30.036 layer although they uh both have a different version subversion. Uh and they both work with 2 00:09:30.036-->00:09:35.041 dot, 2 dot 4 uh gigahertz. Um, and they’re both do time slotted channel hopping and, and the 00:09:37.444-->00:09:41.714 reason they do that is so the hop from channel all the time. And the reason they do that is 00:09:41.714-->00:09:47.587 actually uh to minimize interference because you, I mean these systems are being used in, 00:09:47.587-->00:09:53.159 in, in uh in plans in industrial sites. There’s a lot of interference from other systems 00:09:53.159-->00:09:59.566 that are, that are out there. And also, to uh, to mitigate multipath fadings. That means 00:09:59.566-->00:10:06.439 that if um, a signal gets reflected back you might cancel out the signal, and because you 00:10:06.439-->00:10:10.944 hop the channels you actually prevent that. Uh because there is a lot of metal around a 00:10:10.944-->00:10:17.784 large, uh large, uh storage um containers etcetera. So there’s a lot of reflections. So, they 00:10:17.784-->00:10:22.889 both have a central network security manager. Uh to orchestrate the communication 00:10:22.889-->00:10:26.793 between the nodes. It doesn’t’ meant that the nodes can’t also route the traffic for other 00:10:26.793-->00:10:32.132 nodes but there’s a central point that controls the network. Um, so we though well we can 00:10:32.132-->00:10:37.137 probably build a sniffer for, for both protocols. Um, so we, we um, um if we look a bit more, 00:10:43.409-->00:10:50.049 at, at, at the, the things that share is that they actually use th- th- this exact same E, uh 00:10:50.049-->00:10:55.054 AES CCM star uh encryption. Um, so at the network layer they use it for integrity only so IDA 215 00:10:57.090-->00:11:03.196 dot 4 is only integrity. But at the transfer layer th- th- they apply encryption and uh, on both 00:11:03.196-->00:11:08.401 systems have both actually a join process where, y- they actually uh shared an, 00:11:08.401-->00:11:12.872 encryption key. Uh and that’s a handshake with the network manager so that’s a central 00:11:12.872-->00:11:19.712 component. And um, for WirelessHART it’s, it’s, it’s meant only uh shared secrets so 00:11:19.712-->00:11:24.250 th- that’s really an interesting thing. Yeah, symmetric encryption. So how do you get 00:11:24.250-->00:11:30.190 the key across and, and, and where do you store it? Uh and, and ISA100 supports certificates 00:11:30.190-->00:11:35.195 though we haven’t seen it being used. Um, so, so they th- ISA100 supports both. Uh shared secrets 00:11:37.830-->00:11:42.835 and certificates. There’s a lot of different keys. Um, so if we started at the left uh, ISA100 00:11:48.241-->00:11:53.613 um, th- the top 3 keys are actually new, they’re during provisioning phase. Uh so you 00:11:53.613-->00:11:59.652 have the global key, the K_open, K_global. Um, and, and during the provisioning phase the 00:11:59.652-->00:12:04.591 master key is being um, is being shared and, and from that master key they device 2 keys the D-key 00:12:06.960-->00:12:13.266 and the T-key. Um, it’s also not important that you remember all the different keys it’s just to 00:12:13.266-->00:12:17.370 show there’s a lot of different keys out there. Uh and the same is true for WirelessHART the 00:12:17.370-->00:12:22.408 well-known key was used at the network layer that’s actually not an encryption key but an 00:12:22.408-->00:12:28.114 authentication key. Because they don’t do encryption in network layer. Uh, and, and there’s a 00:12:28.114-->00:12:33.620 network key then the join key uh for the join, which is being shared during the join process 00:12:33.620-->00:12:38.625 and, and derived from there is 2 session keys. So both Broadcast and Unicast. So, first question 00:12:41.561-->00:12:45.698 of course is how do you get the key material? Um, well one of the things you can do is 00:12:45.698-->00:12:50.970 actually read documentation because there’s a lot of default keys out there and uh I must 00:12:50.970-->00:12:55.575 admit that since we’ve done the research 2 years ago, a lot of the documentation is not 00:12:55.575-->00:12:59.979 publicly available anymore before we, back then already published some of the keys that 00:12:59.979-->00:13:03.883 are, are uh default keys and, and seems that a lot to the documents have, have vanished. 00:13:03.883-->00:13:10.390 So not all the keys we list here you can still publicly find, but uh we’re pretty sure uh that we 00:13:10.390-->00:13:15.395 initially uh, found them somewhere. Um, and uh ISA100 specifically also has uh, OTA 00:13:19.098-->00:13:24.470 provisioning of the devices so that’s also a weak part we could sniff, uh could sniff the 00:13:24.470-->00:13:30.476 transaction uh, o- or the handshake. Uh but they need to be able to sniff of course. And 00:13:30.476-->00:13:36.215 previous research we’ve done, we actually took apart transmitters and looked at if we could u- um, 00:13:36.215-->00:13:40.386 interface directly with th-, with the radio spark because actually there’s, there’s 00:13:40.386-->00:13:45.558 multiple components and, and there’s a radio spark on, on there and uh it turned out that 00:13:45.558-->00:13:49.662 they actually JTAG SPI enabled. At least for, for, for WirelessHART. Because back then 00:13:49.662-->00:13:55.001 we only looked at WirelessHART. And, uh we showed that you could actually sort of location where 00:13:55.001-->00:13:59.305 th- where the encryption key is, and, and worse case you can always dump the complete 00:13:59.305-->00:14:03.443 firmware and load it onto another similar device and then you can also join the network. 00:14:03.443-->00:14:09.148 So, there’s a couple of ways to actually obtain those keys. Um, so if you, if you are a plant 00:14:09.148-->00:14:14.287 manager and you’re getting rid of old equipment also pay attention to the last one. 00:14:14.287-->00:14:19.292 Because you might not erase those keys and ends up on eBay somebody might buy it. So, um 00:14:22.295-->00:14:26.733 there’s a couple of default keys for WirelessHART. We haven’t located any default keys for 00:14:26.733-->00:14:31.838 ISA100 yet. So that’s why I’m only listening WirelessHART keys. Uh, the first one you see 00:14:31.838-->00:14:37.577 a lot. And that actually has to do with, with Dust Network who created the SOCs, and that’s why 00:14:37.577-->00:14:44.117 they used us. Dust Network work at uh in a lot of locations. Um, so it’s, it’s uh you can see 00:14:44.117-->00:14:50.923 it’s a 16 bytes hex decimal, hexadecimal key so it’s quite long. Um, but you can see that 00:14:50.923-->00:14:56.629 it, they use a couple of values uh out there. And, and the third one, the Emerson one is also 00:14:56.629-->00:15:01.934 interesting because it’s taking from a Emerson WirelessHART gateway and if you do a factory 00:15:01.934-->00:15:07.073 reset it actually sets the key like this. So you see a lot of zeros. So the key space is 00:15:07.073-->00:15:12.478 really, really small. So, if you ever have uh, reset those devices and use the default key 00:15:12.478-->00:15:17.483 you might be able to easily reverse it. Um, and, and sometimes you can see it’s a lot 00:15:17.483-->00:15:24.323 the name of the vendor. So the last one is actually exactly Endress and Hauser. Uh but and 00:15:24.323-->00:15:29.328 X. So if we um, look at the sniffer hardware uh we first looked what’s out there. Um, 00:15:32.665-->00:15:37.370 because we, we want to build something new. Uh and, and during previous research we used 00:15:37.370-->00:15:42.275 the BeamLogic. We basically is, is just the sniffer but it, it, it uh sniffs now 16 channels 00:15:42.275-->00:15:48.948 simultaneously. Um, so it has no injection support and very basic Wireshark dissector, and it’s 00:15:48.948-->00:15:54.420 quite expensive. It’s the, the box on the, on the right. Um, so yeah, it’s expensive and also 00:15:54.420-->00:16:00.726 quite limited what you can do with it. Uh initially we thought about using the a- Atmel RZ, RZ 00:16:00.726-->00:16:07.466 Raven uh, stick. Because also the regular transmitter she used, uh, used an APR uh based 00:16:07.466-->00:16:14.340 system uh but already reached end of life and it’s very hard now with to find admins to those 00:16:14.340-->00:16:20.546 somewhere. Um, so then we looked for other options and we went onto the BeeKit from NXP um, and 00:16:20.546-->00:16:25.518 by default that already allows you to sniff on 1 channel. Um, but it’s standard firmware 00:16:25.518-->00:16:28.988 although the standard firmware’s not open source but that also reached end of life. So we 00:16:28.988-->00:16:35.361 continued our search for another 1. Another stick from NXP. So, this one is still supported as a 00:16:35.361-->00:16:40.366 free IDE and uh, it allows you to sniff on single channel. It’s quite powerful. Um and, and we 00:16:42.435-->00:16:47.773 need that for the channel opening. Um, Mattijs will explain later. And um, you can 00:16:47.773-->00:16:52.111 actually modify the this USB a bit to, to put an external antenna on it. It’s extremely 00:16:52.111-->00:16:58.017 small so I already ruined the device trying to do it. But it is possible and you could cause 00:16:58.017-->00:17:04.924 wardriving. Yeah there’s, there’s documentation out there, and examples. But only with a 00:17:04.924-->00:17:11.530 few important omissions here and there. So this one show you the default, uh application. That, 00:17:11.530-->00:17:16.536 that’s already provided by them. Uh I hope you can see it. Uh so basically this is the 00:17:20.907-->00:17:26.078 application just select a channel so it’s sniffing IDA 215 dot 4. Uh you can start 00:17:26.078-->00:17:31.083 Wireshark and you can at least see packets. See y- you can see the packets but if you click on 00:17:34.487-->00:17:39.492 actually uh, eh, on, on, on, o-on the bottom side you can see that it’s just data so it 00:17:41.928-->00:17:45.631 doesn’t have a dissector for this protocol. But the basis there, we can already sniff 00:17:45.631-->00:17:50.636 packets on one channel so that’s a start. So then we figured out, okay how does this actually 00:17:55.174-->00:18:01.247 work? Uh because there is, there is a whole SDK around it. Um, but actually it’s, it’s, it’s 00:18:01.247-->00:18:05.952 relatively simple because the hardware is detected as virtual COM port. Uh both on Windows and 00:18:05.952-->00:18:10.723 Linux so that’s a really plus. Um but they implemented their own protocol which is called 00:18:10.723-->00:18:15.728 FSCI and is developed by NXP and is a communication protocol over, over serial. Uh and 00:18:18.965-->00:18:25.204 there’s a post SDK available with Python bindings. Uh but we thought, well we don’t want to 00:18:25.204-->00:18:30.343 ship a tool with h- host DSK around it. We might run into legal issues so can we dir- 00:18:30.343-->00:18:35.348 communicate directly? And um, as it turns out we, we can actually uh do that. Um so we, we created 00:18:37.850-->00:18:43.122 th- the driver for, for KillerBee. And Killer Bee indirectly drives this and 00:18:43.122-->00:18:48.127 drives the stick now so we don’t need a full SDK anymore. Um, so this is what it looks like uh, 00:18:52.565-->00:18:57.570 schematically so the, K, KW4, 4, 1 zed is actually uh the import text. Uh there’s a second one on 00:19:00.806-->00:19:05.277 there, uh, where you can actually load, uh, uh a different bootloaders and that 00:19:05.277-->00:19:10.282 way you can also uh, provision, n- new um, new firmware on the divide through USB’s so you 00:19:12.885-->00:19:18.057 actually have the MCU Express Hub, it’s called? >>[inaudible comment] >> MCU Express or IDE 00:19:18.057-->00:19:23.062 and actually allows you to develop sort of firmware for this device. So, up to you. 00:19:25.965-->00:19:30.970 >>Thank you Erwin. So, we wanted to about, to build uh something more powerful than was uh, out 00:19:34.774-->00:19:39.779 there. So, we thought we, we found our hardware platform that we could s- develop on. Uh so we 00:19:42.615-->00:19:47.620 start building the toolset. And the first thing we uh, wanted to e- accomplish is uh, snip the 00:19:51.957-->00:19:56.962 packets ourselves. And uh, n- um, not rely on, on uh the SDK that came along with the, the 00:20:00.766-->00:20:05.771 hardware. Um, so actually we build a driver for the KillerBee framework. Um, KillerBee because 00:20:08.007-->00:20:13.012 um, it’s just th- the same uh RF layer 8 oh, 8 oh 250 dot 4 uh protocol. So that seems uh quite 00:20:19.752-->00:20:24.757 a good match. And uh we also developed u-um, uh extensions Scapy so uh we were also being 00:20:30.362-->00:20:35.367 able to uh, to inject uh packets rather than just listening in on the traffic. Um, and to bring uh 00:20:40.639-->00:20:45.644 a packetsnip to the masses, ya know we also decided to, to build uh Wireshark dissectors 00:20:47.746-->00:20:52.751 for protocols, WirelessHART and ISI100. So, we will show you, a short demo. This in action. So, 00:21:13.906-->00:21:18.911 you can see we use, uh the CB Wireshark uh utility that comes with uh, b- with KillerBee. And 00:21:22.248-->00:21:27.253 here you see we are picking up traffic. In this case ISA100s, you see also the Wireshark 00:21:31.257-->00:21:36.262 dissector in action. On the left, the screen you see we uh decode the packets. So, the next 00:21:48.507-->00:21:53.512 challenge was uh, um, the channel hopping problem. So like here when, so um, the protocol 00:21:56.482-->00:22:01.420 uses a fast based channel hopping uh algorithm. And when s-, e- started developing uh and 00:22:03.722-->00:22:08.727 studying this toolkit we thought well okay. Uh there’s a new exchanging way 250 dot 4 if we 00:22:11.597-->00:22:16.602 rem- remember cor- uh, correctly that’s uh the, de-amendments which also uses uh, uh, time 00:22:19.438-->00:22:24.910 slotted hopping mechanism. So we thought, well maybe we could use that because that parameter was 00:22:24.910-->00:22:29.915 already supported by, uh by the uh SDK. Uh but it turned out uh, that, uh that wasn’t useable a- 00:22:34.386-->00:22:39.391 at all. So, ha, uh we r- really got to get our hands dirty and uh, w- write ya kn- the pretty 00:22:45.898-->00:22:52.204 uh extensions to the firmware itself. So, none of us have any, had development background, it’s 00:22:52.204-->00:22:57.209 a, it turns out to be quite a challenge. So, if I mean um, fast paced channel hopping. Uh 00:23:00.045-->00:23:05.050 that means that uh, the intervals you see here on th-, on, on this slide are at alt 10 00:23:07.453-->00:23:12.458 milliseconds. So, every 10 milliseconds uh you c- uh the frequency change. So, in order 00:23:14.760-->00:23:19.765 to keep up y- you have to um, think through how you’re going to accomplish that. Um, also 00:23:24.904-->00:23:30.809 that here we need to rely on the firmware itself from the hardware. Because uh, yes you 00:23:30.809-->00:23:35.814 can c- change channels from the host system but as soon as you send an FSCI command to the USB 00:23:38.384-->00:23:43.389 device uh-, the timing, uh the time slot already has lapsed so that doesn’t work in practice. 00:23:46.058-->00:23:51.063 So, you really need to implement this in firmware. So, uh, ha. That uh, w- we needed to deep 00:23:57.970-->00:24:02.908 dive into uh, embedded developments. Which was uh, new for us. Um yeah there are a 00:24:04.943-->00:24:09.948 couple of approaches you can take so um, for this type of uh, devices you can rely on a 00:24:13.185-->00:24:18.190 real-time operating system. Um, there are a, uh, quite a few around. Uh one of them is 00:24:21.160-->00:24:26.165 FreeRTOS for instance. Uh but there, this co- it is pretty um, th- this uh, i- i- it’s pretty 00:24:32.971-->00:24:37.976 um, um, complex. In the sense that um, eh- i-i-it’s not a full-fledged operating system 00:24:42.614-->00:24:47.619 but it had, has task scheduler that will uh, preempt so that means that it will enter up your 00:24:50.522-->00:24:55.527 code right in the middle of y- of your function and you can get all kinds of uh, of challenges. 00:24:57.996-->00:25:03.369 Like raise conditions, you have to deal with so you need to mess around with uh semi-force and 00:25:03.369-->00:25:08.374 other synchronization mechanisms. Um, the other approach is um, th- use a bare 00:25:11.343-->00:25:16.348 method task scheduler. Uh, they’re, uh, th-that, that will not uh interrupt right in-into 00:25:19.518-->00:25:24.523 your code section. Uh but as soon as uh, as y- d- the task scheduler is running through 00:25:28.026-->00:25:33.031 code, you’re responsible for releasing resources. So, part that means that in practice you 00:25:35.901-->00:25:42.841 have to uh, to make sure that your code doesn’t uh, run longer for longer than 2 milliseconds 00:25:42.841-->00:25:47.846 otherwise you’ll start uh, you will stop other tasks and that means that for instance there’s 00:25:50.349-->00:25:56.855 separate tasks for collecting the packets, uh, yeah you can m-make sure that uh you change 00:25:56.855-->00:26:01.794 channels but uh if you don’t pick up th-the packets you don’t’ have anything at all. So 00:26:08.367-->00:26:14.173 a-as I said, yeah th-th it requires uh, uh quite some discipline and uh, in 00:26:14.173-->00:26:19.178 programming. Um, well th- that side is that you c- can achieve fast execution because you don’t 00:26:23.682-->00:26:28.687 have the overhead of real time operating system. So, this is uh, what uh, what it looks like. 00:26:32.491-->00:26:38.530 These are the modules in the firmware. A part is uh offered by the framework itself so you 00:26:38.530-->00:26:45.437 have the memory management uh, uh task that is taking care of uh allocating the heap stuff. 00:26:45.437-->00:26:50.442 You have the MAC/PHY layer uh that’s uh taking care of picking up the packets from the radio. 00:26:54.246-->00:27:00.719 And um, uh the Serial Manager obviously because these packets need to go to their hosts. Uh 00:27:00.719-->00:27:07.593 you have a bunch of timers which can program and uh will wait your task so you can do actually 00:27:07.593-->00:27:12.598 something useful with these packets. And of course, uh, everybody needs blinking lights. 00:27:16.001-->00:27:22.841 So, uh on the right side you see actually what we uh needed to do. Um, the MAC 5 layer was only 00:27:22.841-->00:27:27.846 uh partially useful. Um we needed s- to implement the channel hopper and yeah that th- 00:27:29.948-->00:27:35.487 that was called the MAC extension layer, cause we need to e- obviously extend these 00:27:35.487-->00:27:40.492 capabilities. Uh, on top of that uh we actually get to the industry protocols. ISU 100 and 00:27:43.495-->00:27:48.500 WirelessHART and we also needed to parse information out of these packets. Uh, on that l- uh 00:27:51.336-->00:27:56.341 layer because we uh needed the information in order to calculate when uh, their uh 00:27:58.377-->00:28:03.315 their particular time slot occurs what you're interested in. So, how to do this. Um, 10 00:28:15.060-->00:28:17.062 milliseconds um, if you program a timer uh, to, to, to wake up your task e- every 10 00:28:17.062-->00:28:22.067 milliseconds you find out that you’re always too late because you’re never guaranteed to get 00:28:22.067-->00:28:27.072 the wakeup call within every 10 milliseconds. It’s either 10, 10 milliseconds or 11 or 12. And 00:28:29.808-->00:28:34.813 when you start uh, tuning into the channel you’re too late. So, what we did is um, we parsed uh, 00:28:38.183-->00:28:44.122 the packets that came along too, in the advertisements of both uh w-wireless protocols. Y- you get 00:28:44.122-->00:28:49.127 information uh, where the slots of interest are. For example, the join slots, uh these are uh, 00:28:51.830-->00:28:58.503 timed slots where um, a few devices actually can tune in, to, to start a handshake of, 00:28:58.503-->00:29:03.442 for, um uh g-getting onto the network. Those are of particular interest. Also from a, attack 00:29:07.145-->00:29:14.019 perspective. So, yeah what we started to do is uh, well tune in advance. So, if our um, uh, 00:29:14.019-->00:29:19.024 tuning code gets called uh, we measure okay the, th- the next uh slot of interest is uh, 3 00:29:25.063-->00:29:30.068 time slots away. Okay we’ll tune in right now and uh well the, the other task will take care of 00:29:32.871-->00:29:38.577 picking up the packets there. So that’s gives us some more room. Like for instance to uh, e- 00:29:38.577-->00:29:43.582 around 40 milliseconds uh, r- rather than 10 milliseconds. So that uh turned out to w- uh work 00:29:48.854-->00:29:53.859 pretty well. And we’ll show you how we actually achieved channel hopping. You can see Z, uh ZB 00:30:06.972-->00:30:11.977 Wireshark. W- we had to hack in a non-existent channel. See, channel zero means that uh we 00:30:15.347-->00:30:20.352 ex-fade uh channel hopping in the firmware. And as you can see we get quite some more traffic 00:30:22.854-->00:30:28.960 here than in the first case. Why we were only tuned in to 1 particular channel. And I don’t 00:30:28.960-->00:30:35.100 know it’s readable but here you can see that on the left part that we actually hopped to 00:30:35.100-->00:30:40.105 different channels. So, what can you do if you can’t tune on uh th-this uh intervals of 00:30:54.986-->00:30:59.991 interest, these time slots. Well these are a few um attacks that have been theorized and now we 00:31:03.395-->00:31:08.400 can execute uh, in practice. Um, w- one is to just jam the signal on um, uh b-by sending garbage 00:31:15.107-->00:31:20.112 uh to uh on a p- particular channel. And uh you can block for example advertisements and 00:31:24.916-->00:31:29.921 if you do this successfully no new devices can join the network. Uh because they don’t, 00:31:52.744-->00:31:54.746 uh they, they are not able to synchronize with the network. Or even existing uh field devices 00:31:54.746-->00:31:56.748 will uh lose at some point the synchronization with the network. So in practice that 00:31:56.748-->00:31:58.750 means that uh the few devices uh are enabled to send a process failures and you h- depending on 00:31:58.750-->00:32:01.119 uh, on what control system you have uh, you can narrate havoc. Um, of course being able to 00:32:01.119-->00:32:06.124 inject traffic you can also transmit fake advertisements so you can entice field devices to 00:32:11.496-->00:32:16.501 join your network rather than the existing uh network. And, h- yeah, we’ll give a short 00:32:20.405-->00:32:25.410 demonstration of how you can jam. No, yeah. Okay. So, here is, here you see the victim. Was 00:32:42.661-->00:32:47.666 happily receiving advertisements. Now we transmit the attacker which we start our 00:32:51.236-->00:32:56.241 tool to jam the signal. We found the network and on the sides you see a few packets coming in and 00:33:14.226-->00:33:19.231 next, it comes to a house. Silence. So, there’s all, nice that we can do things without 00:33:41.820-->00:33:46.825 uh, uh actually being on the network. But suppose you have some uh, gather some keys or you 00:33:49.828-->00:33:54.833 found these in a manual, so you do it force these. Well you can do all other nasty stuff. Um, 00:33:57.869-->00:34:02.807 they way this works is that, the uh, the encryption actually is derived from a nonce that has 00:34:08.980-->00:34:13.985 for last part uh, a predictable values. So, there is uh, a, in the advertisement data there is 00:34:19.024-->00:34:25.897 a counter that you need. And that can be snipped from the network w-without it being 00:34:25.897-->00:34:30.902 authenticated. Um, but even if you don’t know uh how to, excuse me, um you can mess with uh this 00:34:40.545-->00:34:45.550 nonce value because there is uh replay. Thank you. There is a replay protection uh in place, 00:34:49.788-->00:34:54.793 uh that’s supposed to uh, to protect against obviously replaying a fake values. Uh but 00:35:00.966-->00:35:05.971 the thing is, um, if you mess with uh, th- the th-the, the nonce and you guess a val- a 00:35:12.277-->00:35:17.282 valid uh nonce and it will be picked up uh b-by uh the device, it is larger. Eh, say it’s much 00:35:22.721-->00:35:27.726 larg- larger than, uh the time stamp that is uh g- currently in the network. It will, you reject 00:35:33.331-->00:35:38.336 all packets from valid devices. So you can really bring down ent- entire sensor networks this 00:35:47.078-->00:35:52.083 way. Of course if you also have access to other key material. For example when capturing a 00:35:55.120-->00:36:00.058 join process and you have access to the session keys you are free to uh to mimic a real field 00:36:04.562-->00:36:09.567 device and you can really mess with process failures. And that’s just a w-where it’s 00:36:12.137-->00:36:17.142 getting really scary. So, um to summarize. What did we learn along uh the road. This uh, 00:36:22.247-->00:36:27.252 these net- these sensor protocols are highly unexplored area. And uh as we uh said in 00:36:30.688-->00:36:35.694 the introduction uh we suspect that this mainly due to the fact that no uh, r-real good, real 00:36:38.363-->00:36:43.368 good tools exist. So, yeah we picked up uh the task and hope that we’ll uh w-we can promote 00:36:46.805-->00:36:51.810 other researches to uh, t-to to explore this in- very interesting area. So, uh yeah we 00:36:56.281-->00:37:01.219 intend to, to uh to release uh th-the toolset we, we created. And uh, yeah another thing we 00:37:07.258-->00:37:12.263 want to uh, uh to give uh to the [indiscernible] us, who w-we who deploy these systems. Um, we see 00:37:16.668-->00:37:23.108 a change that um that people are getting very confident with this technology because it’s around 00:37:23.108-->00:37:28.113 for 10 years. And, it has never been hacked. So, must be secure right? So you see a trend that 00:37:32.450-->00:37:37.455 uh these protocols are not only being used for monitoring systems but also for 00:37:39.491-->00:37:44.496 con-control. Uh, yeah I would like to, to, eh, uh probably that’s not a really good idea. 00:37:50.935-->00:37:55.940 So, they might want to reconsider that. Alright, we have uh some time for questions, 00:37:59.911-->00:38:04.849 5 minutes I see. So uh, um, this is e- these are the future research area of these other 00:38:08.219-->00:38:13.224 future uh topics we want to uh, expand upon. So we’ll um support more attacks that have been 00:38:18.763-->00:38:23.768 theorized so far but now tooling exists. Uh, we want to create uh support for wardriving initial 00:38:27.572-->00:38:32.577 networks. Uh when we do it the hard way we were happy to see that it had the, an uh 00:38:36.347-->00:38:41.519 ex-external antenna connector but once it arrived to do us not on the boards so we were kind of 00:38:41.519-->00:38:46.524 disappointed. And of course with the capability of uh actually interacting with this network 00:38:49.661-->00:38:54.666 and the capability of injecting packets. Um, yeah there, we are free to actually fuzz these 00:38:58.303-->00:39:03.241 protocols from the radio side of uh, of these systems. Okay, thank you for your attention and 00:39:10.381-->00:39:15.386 we can take some questions now. [applause]