Hello! Thank you all for joining us at another wonderful Car Hacking Village, courtesy of DEF CON 30 Recovery Mode. My name is Kamel, and today I'm going to be talking a little bit about Bluetooth, and the RFCom protocol in particular, and why you should consider it next time you go on a car hacking adventure. Before we just get started, I just want to give a quick basic disclaimer. All the views shared in this presentation are my own and do not represent the views of my employer or any other third parties. Of course, got to get that out of the way. So starting off with a very simple, who am I? So I'm an automotive cybersecurity technology architect at White Motion, which is a subsidiary of the international automotive tier one supplier, Morelli. White Motion is a special team within Morelli that specializes in automotive cybersecurity, carrying out penetration tests for our parent company, and external companies alike, and contributing to the automotive security industry overall by providing car hacking training and legislation or standards compliance. I'm an active member of the Automotive Security Research Group, or ASRG, and I love participating in car hacking communities, so on and so forth, even outside of my professional duties. So I volunteer a little bit here and there. Among my recent areas of interest when it comes to security work, we've got Bluetooth, which I'll be talking about in a bit, the USB protocol, general RF stuff, and reverse engineering the firmware update process for some really obscure Taiwanese microcontrollers. But thankfully, that's over. I don't have to do that anymore. But besides the technical stuff outside the office or garage, I suppose, I enjoy playing fighting games and cooking, and I also love exploring new places. So whenever I get the chance to go somewhere, I always make sure I get lost once or twice before I go home. So. Let's go over very briefly the table of contents for today's talk. So I'd like to say that the overall objective of the talk is isn't only to talk about the RF com protocol to say, but to familiarize you with the complexity of the Bluetooth specification as a technology and highlight how many different ways it can be viewed from a security perspective. To that effect, I'm going to start off with a short recap of what exactly Bluetooth is, including a look at how it's used in vehicles and talk a little bit about some scenarios, or cases, very, very short case studies where Bluetooth has been used to targets vehicles in the past from a security perspective. So we'll look over some some past research by other individuals, not myself, that have been more or less prominent parts of Bluetooth history in the automotive security landscape. After that, we're going to take a closer look at the star of the show, the RF com protocol. And then I'm going to introduce a very simple tool that I made called the RF Comrade. That you might be able to use yourself on your own RF com testing in the future. And then finally, I'm going to talk a little bit about the Bluetooth CTF that will be featuring at the car hacking village this year at DEF CON. Excuse me. Just a disclaimer. I haven't hidden any flags in the presentation itself. So don't feel like you'll be missing out on anything if you're not like paying super close attention and taking notes on everything. Screenshotting every every every slide that there won't be anything like that. So feel free to just relax and enjoy the talk. Right. So. Let's get started. So you probably already know what Bluetooth is entirely independently of any technical understanding of how it works. And that should be a testament to how widely used it is. And that's really great. You know, all end user technologies should be easy to use, even if you don't understand the technical details behind them. And Bluetooth is pretty widely used to that effect. It's in your phone. It's in your headphones. Maybe it's in your fridge or your microwave. Probably not your microwave. Maybe your coffee maker. And it's almost certainly in your car. But what exactly is Bluetooth? So the official definition is that Bluetooth is a common cable replacement technology. Right. Found in virtually all smartphones, computers and many wireless IoT accessory devices worldwide. It is designed to simplify short range wireless communications by providing a uniform framework for connecting devices to one another. It operates in the 2.4 gigahertz frequency range, which is the same as Wi-Fi. And as a result, you will get a lot of Wi-Fi chips that are actually bundled together with Bluetooth functionality just because they can use the same radio frequency band. But of course, like we mentioned, Bluetooth is used in a lot of devices, wireless headphones, medical equipment, sensors, interactive lighting, even used for basic data transfers between devices. You can do file transfer protocol over Bluetooth or so on and so forth. We'll see a little bit more about that later. And then since Bluetooth Low Energy came out, especially it's been very popular with things that you would set up in a outside environment. Something like a like an environmental temperature sensor or a humidity sensor that needs to stay on for long periods of time. Maybe it doesn't have access to direct power supply, but runs on a battery and you want to save power over long periods of time. That's when things like Bluetooth Low Energy come into play and are very helpful. And obviously, you know, as we mentioned, Bluetooth is pretty common. In cars today, if it wasn't, I wouldn't be giving this presentation here. I'd be trying to give it somewhere else. But in a vehicle, Bluetooth is usually used by the infotainment system or the head unit or whatever you want to call it. Right. The thing that has all the cool flashy buttons that you can play with and play your music through. Bluetooth is used primarily originally in cars for making hands free phone calls. So while you're driving the car, you can answer, answer a phone call and play it through your car speakers and microphone. And it's also used to import your phone book from a phone for quality of life. You can see, you know, have all your contacts listed so you can know who's calling you. And some cars will actually even let you import your entire text message history. So you can have all your text messages stored on your car so you can go back and look through them through your car's console. I've even seen some phones that or excuse me, some vehicles that do a Bluetooth connection can actually let your phone send out a text message. Right. So essentially, you know, if I'm driving, obviously I'm driving. I'm not trying to answer a phone call if I don't have the opportunity. You know, if it's especially if I'm going down the highway or something, I can push a button that will tell my phone to respond to the caller with a text message saying, sorry, I can't pick up. I'm driving right now. And so it's you can get very creative with how this seemingly simple application, you know, just an extension of your phone can actually be used. Right. More recently, though, Bluetooth and Bluetooth Low Energy or VLE have been used for more advanced phones. They've been used for functions in cars. So ranging from things like updating the firmware on key fobs. There's been some research on the Tesla key fobs in there from our updating process over Bluetooth to things like passive keyless entry systems. And excuse me, we'll look at a case where this was a big target for a security research group in just a second. But before we go into the full technical details, like I said, I do want to go over some of the more notable pieces of research that have come out regarding Bluetooth security. And Google's over the last few years. So got to I'm not going to talk too extensively about them. Just going to kind of run through them real quick. These are very well thought out research pieces. And I definitely recommend you go and find the original source material by whoever published them to get the full details on what exactly they were doing. But I'll just be quickly summarizing for for the sake of this talk. So the first example I want to touch on is some research disclosed by Tencent Keen Labs in 2020. So the researchers at Keen were able to fully compromise the head unit of a Lexus vehicle by using Bluetooth vulnerability as the initial compromise vector. So the first thing they were able to do is exploit the Bluetooth stack on the vehicle to get some remote code execution. And from there, they were then able to expand their reach of influence throughout the vehicle's infotainment system to establish a Wi-Fi based backdoor. The reason for this was Wi-Fi is generally. You know, a longer range technology than Bluetooth. So this gave them the ability to get their reverse shell, as you might say, on the car from a farther away range. And then they could continue their their exploration of the vehicle at that point. So they had set up a essentially, you know, some persistence in the vehicle where when it booted up, it would actually phone home. It would actually connect back to the researchers PC, and they could then open a shell and continue exploration. And exploitation. So due to the fact that there were no firmware checks in place to prevent anyone from, you know, flashing unauthorized firmware to other parts of this infotainment system. The researchers were actually able to flash other components inside that unit and essentially unlock canvas access. The canvas was obviously available on the device. However, it was intended to be kind of filtered or locked off so that you couldn't just send and receive arbitrary. Messages at your whim. But because of the ability to rewrite the firmware due to the lack of firmware checks, they're actually able to bypass this and they were able to kind of expand their reach a bit further. At this point, there are further possibilities to pivot within the vehicle system. For example, using diagnostics to potentially reprogram other parts of the car. But the researchers didn't quite go that far in the publication they released. Of course, this will be linked in the references section at the end. You're free to encourage to read up their full list. It is incredibly educational and I think anybody could benefit from giving it a look. The last attack I want to talk about is much more, a little bit more recent. This came out earlier this year in May of 2022. So this was some research that was disclosed by the NCC group after they found out that the passive keyless entry system used in Tesla models 3 and models Y, I believe, were susceptible to relay attacks. So a relay attack is not something new to vehicles. Right? It's not something new that you can pass the signal from a key fob on to a car and unlock it without having the key fob within the intended range. It's kind of a theoretical attack that's existed for a while. But these researchers were able to perform this over Bluetooth low energy. So the challenge to getting the attack to work on the Tesla's PKE system was that the key exchange had to be done within a given timeframe. There's like a timeout in place that's designed to kind of prevent against that. This kind of relay attack. Because the communications have to happen. There's cryptographic information exchanged. And the idea is that, all right, if there's someone sitting in between these two devices, the actual car and the intended user's key, right, their phone, the added latency of passing the information between several devices may, you know, exceed that minimum timeframe that you have to actually perform these operations and would make it much harder. But the researchers were actually able to do that. They were able to figure out a way to do that. They would use one cell phone to kind of go near the target human being, right, the person with the actual phone to unlock the car. They could then sniff this Bluetooth low energy signal over the air and then pass it through over the internet, like an IP network, just like anything else, to another phone that was close to the car. And they could actually perform these cryptographic checks over the internet. And this, you know, very close range communication between the two attacker cell phones. In a timeframe that allowed them to bypass the latency bounding in place. So this essentially gave them the ability to unlock the car. And then the car thinks, well, I've got the key inside me. I should unlock all functionality. And, well, the next step, obviously, is going to be a vroom vroom. Right. So you can break off with the car. And all of a sudden, you know, you come back from your shopping trip and your car is missing. And what happened? Right. So, again, the link to the actual publication for this research will be in the references below. And you can find the references section at the end. So I encourage you to go ahead and give it a full look. So the next part is going to be the Bluetooth breakdown. I'm going to give a brief explanation of how the different protocols that make up Bluetooth work. So this picture is pretty ugly. So bear with me for one moment. And it represents a visual representation of some of the different protocols that make up what we know is Bluetooth. And this is important. Because, you know, the way I see it, Bluetooth is not one protocol. It's a bunch of smaller protocols standing on one another's shoulders, all wearing a big coat, right, pretending to be just one protocol. But it's actually a technology standard for short-range wireless communication. And each of these subprotocols has its own specification. And all of these, you know, of which are managed by the Bluetooth special interest group or the Bluetooth SIG, as it's easier to call it. So this is a group of companies and representatives of these companies that manage the Bluetooth specification, make edits to it, manage security bulletins, et cetera, so on and so forth. And the specification itself is you can actually read it for free. It's available online. But while the specification itself is managed by the Bluetooth SIG, the actual implementations of these are not. So this is the source of one level of Bluetooth's complexity as a protocol. Each of these protocols can be implemented differently. And many of these protocols are implemented on the chip, the controller. They're entirely invisible to the end user. And so it sometimes makes them hard to analyze from a security perspective. Maybe this will give you a better idea of what I'm talking about. So hopefully things look a little bit nicer now. You can see here, let me pull up the laser pointer. We have the bottom part here, which is the red protocols. These are what we call the controllers. These are the lower layer protocols. And up here on top, you have the bluish ones. These are the host layer protocols. So the lower layer represents the protocols that are controlled by the actual controller. This means that these functions are controlled by the firmware on the Bluetooth chip itself. And the operating system that's using this Bluetooth chip has close to no visibility into what's going on down there. This is why low-level protocols such as the hardware-focused baseband and radio layers operate. And as well as the link management protocol have such a bit of a mystery around them. Because it's not easy to see what they're doing. Because the firmware will be implemented differently based on different vendors of these chips. Because there are so many manufacturers, each with their own unique compositions, sometimes different architectures they use, special commands. We'll talk about HCI in a second. It can be quite complicated if you wanted to reverse engineer these, for example. So some companies, for example, companies that make Bluetooth chips, you've got Broadcom, you've got Qualcomm, Cambridge, Intel. These are all different manufacturers you could find that have implemented their own version of the Bluetooth specification on this chip. And the middle layer here, this purple one, because it's a mix of the blue and the red, is the host controller interface layer. This is a protocol that's used to allow the host to communicate with the controller. There is some standardization around how HCI commands are implemented, but there can also be vendor-specific instructions based on the vendor of the Bluetooth chip. Again, a lot of this stuff is going to be different from vendor to vendor, which is another one of the reasons it's a little bit complicated. If you've ever used Bluetooth with Linux before, for example, you might Google, okay, how to use Bluetooth on Linux. And one of the first commands they'll tell you to run is HCI config. And that's a pretty standard Linux Bluetooth tool. And it stands for host controller interface configuration. This will give you information. About the Bluetooth controller that you're using, right? Any Bluetooth controllers that are registered on your system, you can see information about them with this command, right? Another one is HCI tool, a couple of really useful tools implemented with the HCI protocol, right? To read or write information on your Bluetooth controller, run scans, lots of things you can do with it. These tools work by sending standardized messages from the operating system to the controller, to which the controller will say, oh, you're asking for this piece of data? Okay, let me get that for you. And then it'll feed it back up to the operating system. And then finally, the protocols on the top half of the screen are what we call the host layer protocols. These are controlled by your operating system, right? So the host in this kind of equation is your computer, your operating system, and the controller is the chip running the firmware implemented by the vendor, right? Depending on the system you're using, they'll be implemented a little bit differently. So for example, there is the blue Z stack, right? Blue Z is the official Bluetooth stack for Linux, but it's not the only one. That being said, it's used so widely that you'd have to have a really specific use case to bother with coming up with your own Bluetooth stack for Linux environment. And it's not seen very commonly. So it's not an exaggeration to say blue Z is on 98% plus of Linux systems that run Bluetooth in the first place. So yeah, blue Z is great. And then I'll talk a little bit more about that in a bit. But in the host protocol pool, we find the logical link control and adaptation protocol. I'm not going to say this acronym again because L2CAP is just much easier to say. This is the base protocol in the host protocol pool side. And everything else is more or less built on top of it. This is because, you know, L2CAP is developed to be a generic multiplexing layer of the host protocol stack. It receives information from the higher up. And then passes them on through to the HCI, the host control interface, which then processes the information to be sent to the controller side of things. So a look at some of the different protocols we have here. Very briefly, we have on the right, we have the SDP, the service discovery protocol. SDP is used to allow Bluetooth devices to learn more about one another. So when two devices connect, they kind of ask each other, so what can you do? Oh, you're a phone book server. Well, I'm a browser. I'm a phone book client. I might ask you for some contacts, right? Oh, you can play audio. Well, let me see if I can, you know, stream some audio through you. This communication and establishment of what devices are capable of is done through SDP. So it's a very important part of Bluetooth communication because it'll also give you information about, oh, this service, I'm interested in this. Which RF com channel is it using? And we'll talk about RF com channels in a bit because that's kind of what this talk is about. But again, this all ties back to SDP. Interestingly enough, SDP is always unencrypted. It's just supposed to be freely available, and you can usually query any Bluetooth device or SDP information. So no matter like what the security settings on your Bluetooth device are, SDP will usually be, you know, unencrypted communication because it's not supposed to be secret. You're supposed to share it with anyone that asks. Interestingly enough. And then RF com, as you can see here on the left of this screen, has a lot of different applications or protocols built on top of it. You have things like point to point, which, you know, can go into things like IP and TCP. So you get like your basic traditional networking architecture built through Bluetooth. And then, you know, on top of RF com, you have serial port profile. This is the SPP one right here. You've got PBAP. This is the phone book access profile. You have object exchange or OBEX, vCard, FTP. We'll talk a little bit more about these in a little bit more detail. But there's a lot of stuff that can be built on RF com because RF com is built to be very flexible. So let's give it a quick look. RF com is designed to emulate an RS-232 serial port over the L2CAP protocol as literally as possible. It actually includes features to emulate all nine pins of an RS-232 serial port, which is really interesting. And this is true to the extent that the RF com protocol actually specifies this outright. So if you open up the RF com protocol, you'll see in like the introduction section, it'll actually say this document does not contain a complete specification. Instead, references are made to the relevant parts of the GSM 07.10 standard. So they're really just telling you, like, we just wanted to make, you know, GSM 7.10 serial ports available over wireless communications. So RF com is literally, you know, a radio frequency com port is kind of what they designed it to be. So it was designed to allow devices that already had RS-232 capability to be easily ported to wireless applications by simplifying the process of adding a wireless network interface. You didn't have to change all that much. You could just, you know, readjust which interface it's talking to. And the RF com channel would take all the information that would be sent to a regular serial port and move that over via the, you know, the unguided medium. That is the wireless communication. And that 2.4 gighertz frequency band, right? So in a practical sense, though, right? The practicality of RF com, right? Don't worry too much about the specification yet. If you want to read it, it'll be linked in the end, right? But RF com channels work pretty similarly to TCP ports. So like TCP, RF com provides some basic guarantees for reliability. And it's a point-to-point connection, you know, communication style, right? The contrast to this would be something like this. Something like L2 cap and UDP, where UDP is usually, you know, considered connectionless. But, you know, L2 cap can be connection-based or connectionless. It actually supports both types. RF com has way fewer ports available. You know, they work like ports, but we call them channels. I'm not the one who came up with this, right? It's just the way it is. Excuse me. But whereas TCP has, you know, like 65,000 different ports, RF com only supports 30 channels. The specification states that up to 60 simultaneous connections between two devices are possible. But with only 30 ports to work with, you need to kind of be careful when you allocate RF com channels to your applications. So when you're writing an application, you might say, all right, specify to use this RF com channel or random first available RF com channel. These are both options you can use. Just, you know, you might want to keep in mind how many you have left to when you're writing a Bluetooth applications. I've linked. Both here and later in my references, of course, you can see the link here. An old, it's pretty dated. It's like, I think from like 2000, like the early 2000s, like before 2010. It's a guide. It's a very helpful guide to programming with BlueZ. You may remember I mentioned BlueZ is the Linux stack for the Bluetooth stack for Linux. Excuse me. But it is a little bit dated, but it's a great introduction to programming with Bluetooth. And I would suggest anyone looking to make their own Bluetooth applications. Either for testing purposes or just to learn more about how the protocols work. So you can give it a look, right? But just take over the grain of salt. It is quite old. So you might have to change things to fit, you know, more modern, you know, Python packages or versions that are available. Right. But then one final, you know, useful parallel between RF com and TCP is that much how you might use NMAP or something to do a port scan, right? Kind of see what services are running on a device over the IP network. Excuse me. You can use the SDP, right? Service discovery protocol to do more or less the same thing over Bluetooth. And this is an RF com specific. This is more of a Bluetooth thing overall. But let's take a look here. So since the service discovery protocol is designed to let the Bluetooth devices understand the capabilities of the other remote devices, it makes sense that there would be, you know, a way to see, right? Ask a device, hey, what do you do? How can we communicate? Let's find something we can do together. So the SDP tool, for example, is a basic Linux tool that allows you to browse the SDP servers of remote Bluetooth devices. It can do a lot more, but browsing is kind of the easiest way to use it for starting off. It lets you add services to your own devices as well. For example, or you can, you know, search for a specific Bluetooth service on a target device if you have something in mind. Right. Shown here on the right is part of the output from SDP tool when browsing my Samsung Galaxy phone. I use my own personal device for this. I didn't want to get in trouble by posting some customers' SDP tool outputs, right? That would be bad. But you can see here that there are a couple of applications running on my phone that are tied to RF com channels with information on the type of application and which RF com channel is in use. So, for example, on phones, obviously, phone book access is something you would expect to see because my phone is used to sharing my contact book if I wanted to. I usually don't. But when you connect to a car, you can import your phone. You can import your contacts to the vehicle, right? So that you have access to your whole phone book. You can use calls or IDs, so on and so forth. OBEX, right? I talked about object exchange earlier. OBEX is a communication protocol used for sharing files between devices. And a lot of, like, the things like the FTP and the phone book access sometimes are built on top of OBEX, right? Interestingly, OBEX was originally developed for infrared communications, right? And it's actually managed by the Infrared Data Association. But it's just kind of been adopted by the Bluetooth SIG. And it's just, you know, very common to find OBEX in Bluetooth devices to the point where a lot of people assume OBEX is initially made for Bluetooth when it's actually, you know, it was originally made for the infrared stuff. And then, like I said, things like FTP and phone book access can be built on top of OBEX. But they don't necessarily have to be, right? This goes back to the idea that a bunch of pieces to Bluetooth. And you can kind of, with some degree of flexibility, you know, assemble them however you like, right? So just kind of, like, visualize this, you know, with a very simple example. Let's just say you have, you know, an IP network. Two devices connected to the same IP network. You can see we've got IP addresses associated on the left. We have a host user, you know, a computer. The right side, we've got a server or something. Maybe they're running some FTP service on port 21. Well, when you want to use this service. You would address the server you want to talk to by its IP address. And you'd specify the port on that server that you want to communicate with, right? In this case, you know, we know the standard socket notation is shown up here. You've got the IP address, colon, port number, right? Pretty simple. Similarly, when using Bluetooth, you would address the device you wish to use. You wish to talk to with the RF com channel that it's using for that particular service, right? I've got two dummy IP or Bluetooth addresses here. Please don't look these up. They're not going to give you any interesting results. Of course, it's 1, 2, 3, 4, 5, 6, 7, 8. A, B, C, D, E, F, G, right? But one thing I would like to note is the convention I'm using here, by the way. And you can see here you have the Bluetooth address. And then you have the RF com channel. This is by no means like a standard convention for kind of displaying a Bluetooth socket, per se. I just wrote it like this. So if this is not, this is not, there's no standard here for like you would have in the IP network. It can't work for like a common way to designate a socket if you don't have that. I just kind of came up with it. But it more or less works almost the same way. And so you could have a similar service running over Bluetooth. And likewise, you would communicate targeting that Bluetooth address and the RF com channel that is hosting that the target host is tied to that application, right? And lastly, you know, before we move on, I just wanted to share that. The RF com specification. Has not been updated since November of 2012. And maybe that's a testament to how well put together it is that it has received no updates in the last 10 years. But I always find it interesting to see something that's still so widely used everywhere, you know, in different industries, not just cars. Like I said, medical, you know, other IoT industries hasn't changed at all in the last 10 years. And granted, it is an underlying transport layer protocol. So it doesn't. Maybe doesn't get that much attention. But it's always worth, you know, poking through the specification, seeing if you can find anything you might be able to use or abuse. But anyway, on to the next part of the talk, I'm going to introduce RF comrad. So what exactly is RF comrad? So RF comrad is a tool to assist in the testing of RF com protocol on remote Bluetooth devices. I built it in Python. And it uses the PI Blue Z library, which makes it very easy to get set up on any Linux system. PI Blue Z is a Python implementation of the Blue Z software stack for Linux. Its main feature is the ability to connect to an RF com channel on a remote device and basically flood it with a user defined payload. You set up a payload. You say, hey, I want to target that RF com channel on that Bluetooth device. I just want to hammer it with as much data as possible. It's very, very simple. It's not it's it's nothing like like a guided fuzzer or anything. I'm hoping to improve it. In the future. But what I started with was just a basic flooding attack. Excuse me. But, you know, it can essentially work as a DOS attack or a denial of service on devices that don't have fail safes in place to deal with volumes of large data, large volumes of data. Then they're then they're prepared to expect. Right. If the RF com channels in use on the target are not known, there's also a basic service discovery feature I added to the tool that will actually you can say, OK, I know the Bluetooth address. I didn't run STP tool. I didn't feel like browsing it. If you just run it with a Bluetooth address and no RF com ports specified, it'll actually return to you which RF com ports are up on the machine that you're targeting and some information on what applications are tied to them. So why would I make this tool? So the motivation for putting this tool together is as often as it is, is because I couldn't find another way to do the same thing with someone else's tool. I'm not a very good programmer. I don't know. I'm not a developer. I don't particularly like the program. So I try to avoid it when I can. But sometimes, you know, you force your hand. Right. So during a penetration test of an automotive navigation unit, we wanted to test the device's Bluetooth implementation and its resilience against receiving large amounts of unexpected data. This isn't the only test we performed at targeting the Bluetooth technology on the device, but we wanted to test it from a bunch of different perspectives. So it made sense to do just some brute forcing of the data flooding. And after doing some research, we found that this kind of remote flooding test has been done in the past. But the only publicly available tools I could find weren't exactly what I was hoping to find. Some older tools like L2 ping, for example, which is usually installed with BlueZ by default, only works with the L2 cap layer. And it doesn't provide a lot of flexibility on the content of the data that you send. It's just it'll send pings and you can enable it to flood the opponent. The opponent. Excuse me. Remote target device with data. But you can't exactly control the contents of the payload. You really can't do much about that. And because it is only targeted at the L2 cap protocol, I felt there might be some benefit in targeting other protocols on the device. And then there are other tools such as a tool called Bluetooth stack smasher that allows you to fuzz a remote Bluetooth device with random data. But again, this one also only targets the L2 cap protocol and it doesn't have the features you would like. And it doesn't work in a modern protocol fuzzer. So it wasn't quite what I was hoping to find. You're welcome to give it a shot if you'd like, though. It's freely available on the Internet. There isn't much control over what data gets sent and when. And sometimes recreating crashes or other issues can be difficult, I found. So we wanted a tool that could interact more directly with the RF com channels themselves and the applications operating behind them. So I use the PI BlueZ library to cook up a simple script. Let us connect to remote targets, RF com channels and just toss a bunch of data at it. Just like I explained. The idea was we could identify any applications that were tied to RF com channels that weren't set up to handle large volumes of random data and might be able to invoke a crash of the Bluetooth stack. See how the target device responds. Excuse me, I'm gonna take a quick water break. Sorry about that. All right, let's go on. Almost done. And so did it work? All right. That's the next obvious question. And to my surprise, yeah, kind of did. I was able to reliably crash the Bluetooth stack on a target device by connecting to one of the services hosted on the RF com channel and flooding it with a very simple payload. Right. Just a I just I didn't want to do anything complicated. Just wanted to test it out for about five seconds. And I was able to confirm this because the target device would actually display an error message saying, oh, Bluetooth stack. Restarted like the Bluetooth function that essentially just entirely crashed and then had to boot up again from zero. So any devices that were already connected to the target over Bluetooth, say my cell phone or another target, you know, testing device would be disconnected and whatever Bluetooth operations they were carrying out at that time would be interrupted. An analysis of the application connected afterwards by by us revealed that the function wasn't properly handling. The large volume unexpected inputs. And it actually resulted in a buffer overflow that would cause the the the application running on that RF com channel to crash. And it ended up, you know, causing the Bluetooth stack to have to restart. There's potential here for a further exploitation of the application. Right. If you have a crafted payload, if you actually reverse engineer the firmware running on the device, find out how you can further compromise this target. There's a lot of potential for error. For more wrongdoing in the place here. So we didn't really feel you need to go that far, but maybe someday we'll take another look at it. But I felt that since the dual did something kind of useful, others might find some benefit from having access to it. And that's what motivated me to apply this this little tool of mine to the call for papers here at Defcon. And just keep in mind, at the end of the day, it is just a very simple Python script. Like I said, I'm not a very not a very good programmer. So forgive me if it looks really ugly. Like, why didn't you do this? Why don't you do that? I did my best. Right. So, you know, even even my my own little efforts might be helpful to somebody somewhere out there because. And, you know, even outside of the automotive industry, because Bluetooth is by no means an automotive specific technology. There's a lot of excuse me, a lot of other devices out there that maybe could use a good rattling. Right. So where is it? It's publicly available. You can find it here at this GitHub link. Go ahead and download it. Give it a shot. See if you like it. You don't like it. Criticisms, comments, etc. Always welcome. I do hope on making improvements to it in the future, actually. So as with any project, you know, I want to take it somewhere higher, maybe improve on it. So the first step to that is hopefully to add meaningful fuzzing. How should I say? Fuzzing capability. And I want to increase the scope. To other protocols, too. Obviously, we can't call other protocol fuzzers or flutters RF com, right? Because they're not RF com anymore. But we'll figure something out, right? So when it comes to the fuzzing, I've been looking at Scapey for a little while to kind of get ideas for how to fuzz the Bluetooth properly. But in my experience, there's not as much documentation on using the Bluetooth functions in Scapey as I would like. I just haven't had enough time to kind of dig through them little by little. So that's kind of the first step. The second step is to see if that's a viable next step. The next step is to find more next steps, right? That's kind of how this goes when you don't really know what you're doing. But I'm happy to hear any suggestions or criticisms of my little project. You know, I'm all yours. I'm always happy to listen. So if you have any feedback, by all means, please hit me up. And then finally, the last part of this talk, we're just going to talk very briefly about the CTF. So the CTF isn't meant to be incredibly challenging. You can use CTF, but it's mostly designed to force you to learn a little bit about the tools that are available to you as a Bluetooth security researcher. These are ones that are... Everything can be done with free tools. You don't need a special Bluetooth adapter. You don't need an Ubertooth one. You can put that away. It's not going to be any help. I promise. It's just basic Bluetooth stuff. But there is a bit of a challenge in some of the later challenges. So most of the challenges can be solved by simply downloading a tool that's available for free online and simply reading the documentation to learn how to use it. How to use them and how to read the output from the data you received from the target. It's all running on one Raspberry Pi. You just ask it for information and it'll give it to you and you find the right information and put that into your CTF portal. So the only flag I would really consider a challenge is the last one for which you're going to need to have a program that can send Bluetooth data to the target device. And then be ready to receive data. Because you will find the first piece of data. You have to send as one of the other challenges. Then your task is to send that data to my device successfully and prepare your device to receive data in response. Because the data you excuse me, the data you receive in response will be the last flag. And that's the one that I think is the only really challenging one. You will have to write some code to get this to work. But no, even if you haven't coded in Bluetooth before with Bluetooth before. If you've done any Python work. I think you'll be able to figure it out. I would recommend that anyone, you know, especially if you're having trouble with that last one, take a look at the examples that PI Blue Z provides. They're very useful. And there were a lot of help for me when I was first figuring out how to customize applications for sending and receiving Bluetooth data. So hopefully that's enough of a hint or a tip to have you staying here with us worth your time for the CTF. I know it gets very competitive sometimes. But yeah. That is the end of the presentation. Here's a quick look at some of the references. Everything here should be, you know, pretty easy to see. I will be uploading these slides to the GitHub as well. So if you want to remember and go back to that GitHub page, there's the link. Right. The slides should be available there soon. But yeah, I am all out of clever things to say. So thank you so much for your time. And I'll be on the floor at the Car Hacking Village throughout the entire event. So if you see me and you have any questions or you want to call me some. Call me names or something. By all means, come through. I'm always happy to answer questions over email as well. Or if you want to look me up on LinkedIn, that's fine too. Searching Kamel Ghali will usually lead you my way. But, you know, like I said, my email address is there. Feel free to reach out at any time. So thank you so much. And yeah. Y'all be easy. Keep on hacking. Hack the world. Yeah. See you. Bye, guys. See you guys later. Bye. Have a great weekend. Bye-bye. Bye. Bye. See you later. Bye. Bye. Hmm. Nope, don't have to be that. Wait, everland, can we really talk? you you you you you you you you you