1 00:00:00,560 --> 00:00:07,500 So, hi, I'm Patrick Kiley, Senior Security Consultant at Rapid7, and I did some research on CAN bus and avionics. 2 00:00:09,540 --> 00:00:12,560 So, I'm going to skip over the avionics primer. 3 00:00:12,560 --> 00:00:14,140 I can go over that over there. 4 00:00:14,400 --> 00:00:16,320 Everyone knows kind of the components of an airplane. 5 00:00:16,320 --> 00:00:19,100 If you don't, I'd be happy to educate anyone that wants to. 6 00:00:19,100 --> 00:00:20,820 I'm just going to go into CAN bus. 7 00:00:20,820 --> 00:00:25,340 So, CAN bus is a shared medium. 8 00:00:25,340 --> 00:00:30,700 It was typically seen in transportation, so automotive. 9 00:00:31,540 --> 00:00:34,120 It's insecure by design. 10 00:00:34,120 --> 00:00:39,700 The idea is you want it to be fast, you want it to be lightweight, you want it to be resistant to interference. 11 00:00:39,820 --> 00:00:45,680 But once you have access to the CAN bus, you can do anything that any other device on the CAN bus can do. 12 00:00:45,680 --> 00:00:49,420 And I had the idea a couple years ago when I was at an aviation event. 13 00:00:49,460 --> 00:00:55,340 They were talking about some modern avionics they were putting in a system and how it used CAN bus. 14 00:00:55,340 --> 00:00:56,400 It was really easy to hook up. 15 00:00:56,400 --> 00:00:57,720 It only used two wires. 16 00:00:57,820 --> 00:00:59,980 I had already done some research in automotive. 17 00:00:59,980 --> 00:01:02,460 I knew the problems with automotive CAN bus. 18 00:01:02,620 --> 00:01:09,640 And I said, I have a pretty good idea that this is going to be subject to the same vulnerabilities that exist in CAN bus itself. 19 00:01:09,640 --> 00:01:12,420 It's the nature of how CAN bus is created. 20 00:01:13,220 --> 00:01:18,360 And basically what it means is once you have physical access to the CAN bus, you can do whatever you want. 21 00:01:20,000 --> 00:01:26,380 Incidentally, the other thing when I was doing the research, I was like, okay, has anyone done any research on CAN bus in avionics with regards to security? 22 00:01:26,380 --> 00:01:27,840 There's very little written about it. 23 00:01:27,840 --> 00:01:33,920 In fact, I couldn't find any really good security documents about any of the aviation protocols. 24 00:01:33,920 --> 00:01:44,040 So another thing that we wanted to come up with and show is that if this exists in this medium, what about the other protocols? 25 00:01:44,040 --> 00:01:45,880 Let's get some security researchers involved. 26 00:01:45,880 --> 00:01:48,900 Let's get the community to look at the other protocols that are out there. 27 00:01:48,900 --> 00:01:53,860 Airing 429, 629, there's Ethernet used all over the place in aircraft. 28 00:01:54,060 --> 00:01:59,140 Let's get the community involved, the people that are actually attacking stuff, instead of just the engineers designing it. 29 00:01:59,140 --> 00:02:07,380 So we can have the engineers design it, we can have our types, the hackers, do bad things, and then the engineers will be able to go back and make the systems more secure. 30 00:02:07,380 --> 00:02:11,600 And hopefully we won't have any bad things happen on the aircraft that are out there. 31 00:02:11,920 --> 00:02:14,940 Yeah, there's Rob. 32 00:02:15,060 --> 00:02:19,680 So, jumping right in, hacking avionics via CAN bus. 33 00:02:20,080 --> 00:02:28,400 So, yes, you have to have direct physical access to the CAN bus, or you have to compromise the device that's on the CAN bus. 34 00:02:28,400 --> 00:02:33,160 Now, the vectors that people have exploited to get into the cars, they've gone into the infotainment systems. 35 00:02:33,160 --> 00:02:36,220 They have Wi-Fi, Bluetooth, LTE. 36 00:02:36,720 --> 00:02:43,620 Well, the avionics kit that I've built actually has Bluetooth and Wi-Fi, so there's one particular access vector there. 37 00:02:43,660 --> 00:02:45,380 And then there's physical access. 38 00:02:45,740 --> 00:02:52,760 The whole point is physical access should not be our only control, because if that's your only control, that's a single line of defense, it's not defense in depth. 39 00:02:52,760 --> 00:03:01,420 And we want something that's flying in the sky to have more than just one physical control around the bus that's controlling everything in the aircraft. 40 00:03:01,840 --> 00:03:15,340 So the idea is you get something small like a Raspberry Pi or a car loop that has some telemetry interface, you attach it to the bus, and then you either transmit messages to it wirelessly, or you wait for a particular event to occur. 41 00:03:15,340 --> 00:03:25,380 So you're already on the bus, you can read data, you wait until you're at a particular altitude or a particular airspeed or over a particular location, and then you trigger an event and bad things happen. 42 00:03:25,840 --> 00:03:33,380 You know, if a bad guy were going to do something really horrible on an aircraft, I would think that this type of attack would be very difficult to detect. 43 00:03:33,580 --> 00:03:40,140 Whereas, you know, the more kinetic effects are much more obvious and are going to generate a different kind of investigation. 44 00:03:40,360 --> 00:03:43,420 But we want to get ahead of this, and that was kind of the purpose of all this. 45 00:03:43,620 --> 00:03:47,880 So, we have some example CAN bus messages right here. 46 00:03:47,880 --> 00:03:53,480 If you see on the right, we have the arbitration ID, that's like your network address for CAN bus. 47 00:03:53,620 --> 00:03:59,060 And we have a preamble in hex of D4714. 48 00:03:59,720 --> 00:04:03,740 That identifies on this particular system I have back here, the oil pressure. 49 00:04:04,180 --> 00:04:09,520 And it's in little Indian, so the most significant byte is on the right instead of on the left. 50 00:04:10,980 --> 00:04:14,920 And as the oil pressure decreases, the value goes up. 51 00:04:14,920 --> 00:04:16,160 It's backwards. 52 00:04:16,380 --> 00:04:17,820 I had to throw this in there. 53 00:04:17,820 --> 00:04:22,440 So, as our oil pressure is going down, the value of the oil pressure is actually going up. 54 00:04:22,440 --> 00:04:25,880 And the reason why is because it's inverted. 55 00:04:27,740 --> 00:04:29,400 Anyway, fuel level. 56 00:04:29,400 --> 00:04:33,060 This one is actually increments normally. 57 00:04:33,180 --> 00:04:37,700 So, same arbitration ID, 10342200. 58 00:04:38,820 --> 00:04:44,360 Same first two bytes, D47, but now it's 11 instead of 14. 59 00:04:44,360 --> 00:04:51,120 So, 14 controls oil pressure, same controller 11 in the preamble controls fuel level. 60 00:04:51,380 --> 00:04:53,320 And the same thing, we can actually hack both of those. 61 00:04:53,320 --> 00:04:55,300 I'll give you a demonstration of this right after. 62 00:04:56,280 --> 00:04:57,980 So, how do we spoof messages? 63 00:04:57,980 --> 00:04:59,980 Normally this is where I jump into a demo. 64 00:05:00,260 --> 00:05:04,000 This is a particular piece of software called Vehicle Spy. 65 00:05:04,460 --> 00:05:09,320 Once you've actually reverse engineered the message, all you have to do is inject those messages onto the wire. 66 00:05:09,320 --> 00:05:14,080 And now you'll either show a higher fuel level than what you actually have, or a lower fuel level. 67 00:05:14,080 --> 00:05:15,160 Same thing for oil pressure. 68 00:05:15,160 --> 00:05:19,820 You'll actually be giving incorrect results to the instruments. 69 00:05:19,820 --> 00:05:21,380 And there's no real way to detect that. 70 00:05:21,380 --> 00:05:24,620 It'll just show a false signal. 71 00:05:25,840 --> 00:05:26,800 Autopilot. 72 00:05:26,800 --> 00:05:29,960 Something a little bit more substantial and immediate. 73 00:05:30,760 --> 00:05:35,540 The autopilot servos on the system back there use a different arbitration ID. 74 00:05:35,620 --> 00:05:43,920 And there's just one single message with three bits that DC0103 turns them on, DC0100 turns them off. 75 00:05:43,920 --> 00:05:47,540 And then there's a steady state message of DC0C. 76 00:05:47,540 --> 00:05:49,600 That just basically means nothing's changed. 77 00:05:49,800 --> 00:05:50,700 And that's all you need. 78 00:05:50,700 --> 00:05:53,300 You do that and it'll actually engage the servos. 79 00:05:53,300 --> 00:05:59,480 Now, any aircraft that I've seen that has an autopilot, you press one button and it's autopilot disconnected. 80 00:05:59,980 --> 00:06:00,860 Flashes a warning. 81 00:06:00,860 --> 00:06:06,340 But with this, you can continuously send these messages on the wire and that disconnect will not do anything. 82 00:06:06,340 --> 00:06:13,960 You'd actually have to physically pull the breaker that's connected to the autopilot and sit there and try and manually fight the servos. 83 00:06:14,260 --> 00:06:18,500 And oh, and by the way, we can actually control the amount of torque that's going to the servos as well. 84 00:06:18,500 --> 00:06:28,400 That's also sent over the CAN bus and could potentially make it, depending on how the particular aircraft is designed, make it very, very difficult to try and overcome. 85 00:06:29,840 --> 00:06:36,060 Okay, so this particular system had a really unique way of handling complex messaging. 86 00:06:36,380 --> 00:06:38,440 We have the AHRS. 87 00:06:38,440 --> 00:06:42,880 That is the instrument that indicates the aircraft attitude in flight. 88 00:06:42,880 --> 00:06:45,520 It's called Attitude Heading Reference System. 89 00:06:45,520 --> 00:06:48,020 It's basically like the old gyros. 90 00:06:48,020 --> 00:06:52,860 So when you're straight and level, it'll show on the glass panel that you're straight and level. 91 00:06:52,860 --> 00:06:57,140 You pitch up, it'll show as in the artificial horizon, it'll pitch up. 92 00:06:57,140 --> 00:06:58,760 There's one instrument that controls that. 93 00:06:58,760 --> 00:07:05,860 It also has the inputs for the airspeed, the static, and angle of attack if you decide to configure an aircraft with that. 94 00:07:06,960 --> 00:07:07,980 This one is different. 95 00:07:07,980 --> 00:07:12,140 It uses a single arbitration ID as a header, and it's easier to show you over here. 96 00:07:12,140 --> 00:07:20,660 So we have arbitration ID 10242000 with the 5th byte over 3C being the message size. 97 00:07:20,660 --> 00:07:30,700 Then another arbitration ID 10242100, and then 60 bytes of payload as a bunch of separate CAN messages. 98 00:07:30,700 --> 00:07:38,740 This is very non-standard for CAN, but the point is, even though there's some obfuscation here, I was able to figure it out and reverse engineer it. 99 00:07:38,740 --> 00:07:45,140 All the messages for heading, for altitude, for airspeed, are hidden in this message that comes on every so often. 100 00:07:45,340 --> 00:07:47,160 So, how would you attack this? 101 00:07:48,140 --> 00:07:59,840 You read the header in, store the message size variable, read the subsequent data frames in as an array, modify the bytes that you're going to change, and dump it immediately back out onto the wire. 102 00:07:59,940 --> 00:08:06,540 The nature of CAN bus in any type of telemetry system is the last message in is the most relevant and is the one that will be displayed. 103 00:08:06,540 --> 00:08:12,500 So, if you're beating the actual instrument with messages on the wire, you're going to be, it's going to be your value. 104 00:08:12,500 --> 00:08:16,580 The one that you've injected is the one that's actually going to display on the instrumentation. 105 00:08:16,920 --> 00:08:21,700 So, I'm in the process of actually having, of reverse engineering this. 106 00:08:21,700 --> 00:08:23,780 I've figured out what all the parts of the message are. 107 00:08:23,780 --> 00:08:26,880 I just have to write some custom software to inject it back out there. 108 00:08:27,620 --> 00:08:31,160 Um, and this type of attack is the really dangerous one. 109 00:08:31,160 --> 00:08:40,240 If you're talking about someone who's an IMC and you don't have, you know, a backup instrument that you're immediately referencing and noticing, you could be flying at a different altitude than what you actually think you are. 110 00:08:40,240 --> 00:08:42,340 You could be pointing at a different attitude than you are. 111 00:08:42,400 --> 00:08:46,020 Um, and it really makes the attack scenarios pretty scary. 112 00:08:47,260 --> 00:08:49,940 Um, so, set of recommendations. 113 00:08:50,660 --> 00:08:53,320 Don't rely solely on physical controls. 114 00:08:53,480 --> 00:08:57,160 Um, this, just, you introduce a single point of failure here. 115 00:08:57,160 --> 00:09:02,760 Um, there's a secure CAN bus specification that's out there. 116 00:09:02,760 --> 00:09:04,720 It's, it's pretty new in the automotive industry. 117 00:09:04,780 --> 00:09:08,700 But, since autonomous vehicles are becoming a thing, it's, it's getting a little bit more traction. 118 00:09:08,960 --> 00:09:12,340 In avionics, this is what we should have, uh, defaulted from, from the standard. 119 00:09:12,340 --> 00:09:15,680 It's, uh, specification of secure onward communication. 120 00:09:15,680 --> 00:09:23,040 It's not a perfect protocol, but it makes the attacks that I presented here orders of magnitude more difficult for an attacker to pull off. 121 00:09:23,040 --> 00:09:25,600 Because now you have crypto involved. 122 00:09:25,820 --> 00:09:27,640 You have authentication of the payloads. 123 00:09:27,640 --> 00:09:34,760 If a device receives a message that doesn't have the proper, um, authentication token with it, it's not actually going to do anything. 124 00:09:35,040 --> 00:09:38,080 Um, and then, implement a security gateway. 125 00:09:38,080 --> 00:09:40,440 That's already present on cars today. 126 00:09:40,480 --> 00:09:45,940 Separate your attack surface area, your Wi-Fi, your Bluetooth, your LTE, from your CAN bus. 127 00:09:45,940 --> 00:09:48,760 And have a security, separate security device in between those two. 128 00:09:48,760 --> 00:09:51,140 On a vehicle, that's called a security gateway. 129 00:09:51,140 --> 00:09:57,480 It's already designed to operate real time, so the car is not affected by this being in the mix. 130 00:09:57,680 --> 00:10:00,740 And then, separate your, your functions of CAN bus. 131 00:10:00,820 --> 00:10:04,860 Um, put your autopilot on a separate bus from your engine controls. 132 00:10:04,880 --> 00:10:07,480 You know, your engine controls are in something that's more accessible. 133 00:10:07,520 --> 00:10:10,820 It's easy to, you know, open up an engine compartment and tamper it and get into that. 134 00:10:10,820 --> 00:10:14,940 Whereas your autopilot, it's, it's more difficult to get at those servos or anything else. 135 00:10:14,940 --> 00:10:18,260 And those are two separate functions that are entirely different. 136 00:10:18,260 --> 00:10:21,440 And so, if you separate those, you've got them on separate buses. 137 00:10:21,440 --> 00:10:27,020 And overall, you have more to attack to actually conduct a successful attack against a system like this. 138 00:10:27,500 --> 00:10:28,020 Okay. 139 00:10:28,020 --> 00:10:28,460 Thank you. 140 00:10:28,460 --> 00:10:29,580 I know that was really brief. 141 00:10:29,580 --> 00:10:31,080 We only had 15 minutes here. 142 00:10:31,080 --> 00:10:33,160 So, uh, at this point, I'm gonna go to questions. 143 00:10:33,160 --> 00:10:34,460 Anyone have any questions? 144 00:10:41,310 --> 00:10:43,510 Um, the stuff I talked about here. 145 00:10:43,510 --> 00:10:45,790 So, implement a system. 146 00:10:45,790 --> 00:10:52,370 So, kind of the whole point of this is CAN bus, it doesn't appear to be widely adopted yet. 147 00:10:52,370 --> 00:10:54,790 It's, it's in the system that I have built out there. 148 00:10:54,790 --> 00:10:57,830 There are some other systems, because we looked at two separate manufacturers. 149 00:10:57,830 --> 00:10:59,910 They both suffer from the same issues. 150 00:10:59,910 --> 00:11:01,890 Don't rely solely on those controls. 151 00:11:01,890 --> 00:11:04,870 Put some additional security controls on your CAN bus. 152 00:11:05,670 --> 00:11:06,610 Migrate to this. 153 00:11:06,610 --> 00:11:09,970 The existing hardware is supposed to support SECOC. 154 00:11:10,390 --> 00:11:13,530 Um, and implement a security gateway. 155 00:11:13,530 --> 00:11:16,370 That's something that can be retrofitted into existing systems. 156 00:11:16,430 --> 00:11:19,090 You have your devices that actually have Wi-Fi and cellular. 157 00:11:19,090 --> 00:11:23,750 And you can migrate those from the flight critical components of the system. 158 00:11:25,190 --> 00:11:25,950 Okay? 159 00:11:26,190 --> 00:11:27,370 Any other questions? 160 00:11:28,490 --> 00:11:29,250 Alright, thank you. 161 00:11:29,250 --> 00:11:32,050 For those who want to join me, I'll be right behind you with the avionics. 162 00:11:32,050 --> 00:11:33,890 And I'll actually demonstrate some of these techniques. 163 00:11:34,930 --> 00:11:35,690 Okay. 164 00:11:36,130 --> 00:11:36,890 Applause.