Let's start because this is a lot of information. Thank you so much for coming here. We're going to be talking about Salinas rat. Whoever is Mexican, they know what I'm talking about, the rat, you know, my friends? The biggest one, actually. Anyway, this is Salinas rat. It's an SMS-commanded rat. This is an effort done by three guys of us, not only me. It's an effort of three guys. We're going to be talking about the whole process that we took in order to infect an infotainment. The one that you guys have in the right side, the infotainment is up and running, standalone. We're going to give a demo at the end of how we can steal SMS messages here. I'm going to give you a copy of one of the books that I wrote. I'm going to ask you guys one specific question in Spanish. Hopefully, you can understand it. No, just kidding. Everything started with Cardloop. Cardloop is an OBD2 port. It's connected into the automobile. When you go to the service, you plug in this guy there in order to do debugging information. We started thinking about, okay, let's plug this device into the car. It's pretty convenient. It has a microcontroller from particle. Basically, you can code your stuff and push firmware updates through the cloud. This is an example of an implementation of socket can, so that you can basically monitor OBD2 information. This is just a one-on-one example of just sniffing into the car. We were playing with that one-on-one stuff. This is a quick video. What we did here is we were just connecting this guy, sniffing the OBD2 port. I'm flashing the car. This is okay. Is that okay? Okay. This was just a one-on-one flashing thing. We said, okay, if we can flash the car, you see. Why don't we try to get into the car and see what else we can do? It turns out that only the lights can be controlled through the OBD2 exposed to the car. We said, okay. Let's go inside the car and see what it is. Then we started playing with this. I wanted to ask you guys, who of you pair your phone with your car while you're driving? Can you raise your hand? Yeah. Yeah, right? We all do that, right? That's the reason that we decided to target the driver in this talk. When you guys are plugged with your car, it's pretty convenient, but at the same time, what if the car is infected with malware? What if we can use your phone to talk to our rat remotely? Right? That was the thing that we wanted to prove in this specific talk. Why the driver? As you guys know, there has been a lot of effort on car hacking, on those guys. Really good research on breaking stuff into the brakes, into the echos, those things, controlling the steering wheel. That's great. We wanted to focus on something different, especially, as I said, because it's very convenient to plug your phone into the car while you're driving. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. That's why we decided that based on many people that it's plugged in their phone in the car, if we can do something inside the car, that can be huge. We can actually trade the data through SMS. That means that as you know, when you're driving the car, those cars doesn't have internet connection. Then how can you create the data? Some of the people were trying to search for open networks while you're driving, but that's going to take you probably three to five seconds to know how you're interacting with people who are there. seconds to get the open network and then it's gone, right? So it's not stable. So we said if we connect through the phone, we can do back and forth information with attacker through the attacker, through the driver's phone, and it's totally stable. So different scenarios that we can come up with is spionage. You can monitor messages from a person, like congressman, your wife, if you want to know if she's cheating on you. You can imagine if we can rent a car, right? We infect the car, we rent a car, we infect it, send it back to the dealer, to the rental office. Then every time someone else drives that car, you can be stealing information from that. And that's huge because that's not targeting one person, it's targeting whoever is driving that car, right? So splitting out CD-ROM, turning off the display, we're going to see that in the demo. So many scenarios that we can think about. Obviously, ransomware. Like wiping the operating system, denying calls. We can, for example, if someone calls this guy while driving, we can deny calls because we control it. So the first thing we need to do is we need to set up this guy. The guy that you see right there on the right, we need to set it up, right? So the first thing is we need to buy, by the way, this whole thing car, I drive that car. So I said I cannot test it in the car, so I want to get a test bench, right? So the first thing you need to do is you need to find a test bench. So eBay is a very good option for you guys. So lucky me, I found that the specific infotainment that is in eBay is exactly the same that I have that I'm driving. This has the information in the site. These are the pigtails. Those are very important for you guys. So anytime you want to buy something like that, make sure that you have the pigtails. If you don't have the pigtails, you don't have a way to connect it because it's just manufacturer-based. So you make sure to have that and ask for that. Otherwise, don't buy it. And this is how it looks in the car, right? This is the whole thing. So the first thing was to understand the internals. This guy runs Linux ARM, FreeScale, IMX6, Linux ARM, 32 bits, kernel memory, display, Bluetooth, JTAG, Renesas, M1616C. This is more into the CAN-related messages. And it has GPS, of course, and the backup camera. And very important, guys, USB Ethernet. So the USB that we see in the car that you think is just to plug in and charge your phone or just to plug in for MP3 music, turns out that has Ethernet. That means you have an IP address and you can talk to the car. OK. So the next thing you need to do, guys, you need to find the wiring diagram. If you don't have the wiring diagram, you don't know how to connect the dots. And the wiring diagrams are only held by the manufacturers. So we were able to find this thing in leak in internet. And that helped us to connect all the dots. So the whole thing here is the audio system. We're going to use this to connect the gear in such a way that it's is talk to the connectivity master unit. The connectivity master unit is all we need to connect this guy and boot up. We don't care about other components. Just the component to boot up this guy, which is the radio, the Bluetooth, the SMS messages. So we connect this guy. This is how it looks in the back. It has specific can messages and accessory. The accessory, guys, I didn't even know what is accessory, but you guys, do you know what is accessory? Ignition part of it? When you plug your key in the car, you do one switch that releases the steering wheel. The second one releases the display with the lights. That's the accessory part. Then you turn on the car. That's the ignition starting. For us, we don't have the car, but we need to have that cable that mimics the accessory so that we can turn on the display. That's the accessory part that we find out here. We have everything up and running. Then we have the this guy ready. Then we need to start trying to get access to this guy. There are many ways to do that. One would be a serial access that we find out later. I'm going to explain you how. The second one is, as I said, it has a USB which gives you IP address. You can do brute force into the infotainment. It has really weak passwords. It's nothing difficult. But still, if you have serial access or USB connection, that doesn't work because you need to have something remotely. You need to have a way that the driver gets infected, not that you go to the car, open the car, and infect it. That doesn't work. Then we found a vulnerability, guys, like one year ago, that it works through the USB. Basically, what it does is it exploits the auto-run. I'm going to explain you that in a second. We started testing that one. This is how it works. When you plug in the USB into the car, it goes and checks if it exists any specific event. It calls what is called main instruction file. It's an INI file. It's going to plug the USB and if it finds the INI file, it's going to check it. Inside the INI file, it's going to check for an execute.ini file. Inside that one, it's going to check, okay, do you have a date retrieval information command? If it has that, it's going to call it. Basically, guys, this is just going to receive whatever is in that command line. As you can see here in the button, whatever you put in that command line is going to take it and execute it. So simple, nothing advanced. That is going to do a system on whatever you pass, and then you can start executing in the car, in the infotainment car. This was the vulnerability that these guys found. Then we tested, and it turns out that it was working fine. We got access to the infotainment. At this point, guys, we said, should we keep finding vulnerabilities to break into the car, or should we focus on what we can do once we are inside the car? Since it was too easy, as you can see, to break into the car, we decided let's work on what we can do once we are inside the car. This is just a quick demo, guys, so that you can see how it works. Basically, what you need to do is, as I said, we have the USB at the top. That USB is the one that you see in the car, right? Then you will go, as social engineering, you go to the guy and say, hey, free music, or free porn, or whatever it is, you know? I don't know. But, anyways, you convince this guy, right? Or you leave the USBs in the desk, whatever. This guy plug in the USB into the car, and then the other one that I just described is going to start executing. So we take around 30 seconds to pop up, just because of this whole process of deciding what it's going to do. And eventually, what we are doing here is just popping up a screen, obviously, to show that it is infected. But, obviously, in a real scenario, you don't need to pop up anything. Yes? It's in the machine, in the operating system. There is a library, a dynamic library that triggers when you plug the USB, and it starts handling all the events. From the USB. So the USB has an ID file that this guy is going to read, pretending to update something, but it's a bash script that we can control. Yeah. So this is basically infecting this guy, right? So what is the motivation that, at this point, we said, should we move into attacking the car, the driver, or what should we do? So something very important that we realized, guys, is that this vulnerability was patched by the manufacturer. And then this, but this specific infotainment doesn't have that, it was vulnerable. But then when we, I went back and checked, checked my car, turns out that my car was also vulnerable. And even though I have been driving that car for more than one year and a half, so my firmware was also vulnerable. So that makes me think about that why the, it was not updated by the manufacturer. Keep in mind that this firmware is not like Windows updates. You cannot just get the update through internet. So you need to go to the manufacturer, they need to plug an SD card and update your firmware. So, but still, I don't know if you guys are familiar with what is called warning calls. In US, the warning call is when you get a letter that says, hey, we find something in your car, come to the dealership and we are going to fix it for you. Recalls, exactly. That's it in US. So for this specific thing, I would have expected these guys to send us a recall for this, right? I never get that, and for sure I didn't get that because I have the same car. So I was saying, hey, how many cars might be vulnerable with this specific thing? But these guys just doesn't even care. Even though they patched the firmware. So we said, let's do something inside the car so that that can help us to push into fixing these things and treat it seriously. Okay? And this is when, this is like an example of the safety recall notice that you might get into your house if your car has some problems. So, and as I said, potential targets, you know, rental cars, if we can infect the car with malware, it's going to be thousands or millions because this firmware is probably millions driving outside. You know, they are not updating. And when I went to the dealership, I tell him, hey, could you please upgrade my firmware? And the first answer was, what is firmware? So that was what the service guy told me. Then I talked to the manager, and he said, if you want me to update your firmware, first of all you need to have a problem in your car. Something is wrong with your car, we cannot do anything if you don't have any problems. So I went to another dealership and I said, you know what? You know what? So my car, the Bluetooth is not working. He said, why not? I said, I don't give a shit, man, it's not working. Just update my firmware, man. And then finally, you know, so you need to do a lot of stuff. So, back to the game, right? So we were playing with this guy. So let's focus on infecting the car and see some consequences so that we can prove that you need to take this seriously. So we were playing with the car, and then we lost access to the infotainment because we were playing with the services and then, unfortunately, we lost Ethernet connection, we lost Wi-Fi connection, so we found in a specific blog that there was a UART connectivity to this guy through two specific pins. So then we were trying to find those guys inside the infotainment, plug it in, and thanks God and Josh Gomez, we got that back. So we were able to get access to the infotainment. What we learned here, guys, is that when you're testing a device, make sure that you have a backdoor or some way to get in. So you cannot just, you know, start trying your stuff and suddenly get access, and you lose access, you get screwed. So you make sure you always have a way back to your device. Okay? So the next thing is persistence. As you know, we want to make sure that this guy runs every time the infotainment boots. Pretty easy. There is an SMS service running, and it has a specific XML file. We just add our RAT into the XML file. Pretty simple. Every time this guy runs, it's going to run our RAT. Obviously, it is read-only, but you can remount it as read-write. No issues, nothing that's stops you. Pretty easy. Okay? This is our lab setup. We are ready to go. We're ready to start playing with this guy. We have a U-Bus parade for the serial access. We have a BeagleBone where we compile our RAT. Every change we do, instead of doing toolchain cross-compiling, we just use our BeagleBone, which turns out to be exactly the same Linux ARM version that the infotainment is running. So we compile our changes there. And the USB hub, the USB hub, since we were three guys, we plug this hub. We have excellent access, all of us, especially for remote debugging, which is very slow through Wi-Fi. Okay. Once we were inside, guys, we found this test application. This test application is basically a debugging application that the manufacturer left inside this guy. So that helped us a lot because it's full of symbols and we only need to reverse that guy to understand how to interact with multiple components. It's a test app client that talks to a test app server, which has some XML commands, and then you can control the audio, you can control the Bluetooth, you can control configuration of the car, Wi-Fi settings, canvas. So we were analyzing this guy and we found the prefix, which is AT plus TMC. So if you talk to this guy through the client, do this prefix and put your own commands, you start interacting with the car without, I mean, it's going to save us too much time. And actually we use this for a specific reason, to reset the phone in the Bluetooth, as you're going to see in a demo in a second. It was pretty convenient. This is an example. So for example, you can see there, you have AT plus TMC. After that, you have commands to execute. Like you can see the firmware version, you can see the VIN number, you can see the build date, and of course, you can also control Bluetooth and those things that I'm going to show you later. But this was pretty good for us, very bad for the guys that are leaving debugging tools in the infotainment. Okay, next thing guys. So when you're analyzing these kind of things, you need to debug it. You cannot just go, I mean, might be some ninjas here, reverses, right? But I'm not a ninja reverser. So, but just looking statically, I need to, you know, do debugging information so that I can see exactly, it's an SMS message, we put a breakpoint, I need to see how it's going on, to understand every single step. So you need to have debugging thing. But this is Linux ARM in an infotainment, embedded. It's totally different than Windows. So the first thing that we got was watchdogs. The watchdogs means that if you stop a breakpoint after three seconds, it's going to reboot the infotainment. So we need to find a way to kill the watchdog. The second thing is that we were putting breakpoints in IDA, and it was not triggering at all. So we decided to look at it a little bit, and then we found that the service manager controlled all the other processes, and then as soon, it will trigger the watchdog. But funny thing is that we can kill that SMS service manager, no restrictions at all, and there is no watcher. Really simple. Second thing is via GPIO, we can put a flag there, and the watchdog is gone. That's the second approach. Now, talking about the GDB breakpoints. So we find out that there is an instruction. We didn't know about it. It's called undefined instruction. So the way it works is that this is the P-trace code, if you want to look at it. It's basically pretty simple. So what you're going to do is that in the instruction that you want to set your breakpoint, you just replace that with the on instruction, as you can see on the right side. Once you do that, it's going to trigger a trap. That trap is going to be caught by the application, but since we're debugging it, it's going to stop on us. After that, you just need to revert back the bytes on memory and keep going debugging. But it turns out, for us at least, this was the way for us to start debugging services, because this is services. If you are familiar with Windows services debugging, it's a pain, and Linux is the same. It's not as an standalone application. So this was the way for us to start debugging. So we are ready, and let's start looking into the main component. The way it works, this guy, it has a JavaScript based front end, it runs with Opera browser. It connects through web sockets to what is called a multimedia unit interface. That unit interface talks to all the components through D-Bus, through the phone updates, backup navigation, Bluetooth, everything. Then that guy connects to the service manager, which has all the inside the car. This is a total world. It has ignition camera, it has video related messaging and can DVD. So that you guys have an idea, we focus on this part only. But it�s huge. We just focus on the part of how we can control the messages coming in, going out of the infotainment, which is just the JavaScript side, MMU side and the MSG library which controls this whole thing. So let�s focus on SMS messaging. Let�s see how it works. So when you receive a message from this guy, right now it�s like one slide but it took us probably three weeks to understand this whole thing. So you send a message, from I am sending a message to the guy that is driving that car, right? The guy is driving that car, receives the message, Bluetooth takes it, it calls a blue message, and it goes to the service handler. That triggers through the bus, connects to the MSG which is the Linux library that is handled via specific communication. It triggers the SMS notification callback. Then it stores that message into a SQLite table. Then from there it talks to the multimedia interface which is going to talk through WebSocket to the GUI. Then the GUI is finally going to display through a JavaScript event. So JavaScript is going to appear in this list of two minutes. Then the SSC and the MMUI are talking through WebSocket, as you can see here. They are just waiting for the information coming in and out. Once they receive it, they pop up a message into the screen. That�s simple, but those are the main components that need to be understood if you want to control it. Then, sending a message. If you want to send a message out from this guy to the world, like you are driving, you got a message, you can put reply, send message, this guy is going to send a message out. The way it works is, this guy is going to put a reply. that this guy, again it's just a reverse order. It goes to the MMUI, JavaScript to MMUI through WebSockets, then this is like a portion of example of JavaScript, how it works. Basically you put the message that you want to send, it sets the state of MMUI, it's like a state machine so that it controls multiple events. You need to put it in a state, in this case to send an SMS message, you put an ID of the event, in this case SMS, and just trigger the event and it's going to connect to MSG component, which is the Linux library, which called the safe message. Keep in mind this one, safe message is the one that's going to allow us to use the bus to talk to the Bluetooth and send the message out finally to the guy, whoever is outside. This is the whole process receiving and sending. Now let's see a little bit very important for us, because we said okay, we understand now how it works. Now I want to send an SMS message to the infotainment. I want it to respond to me. I want my malware to know when a message is being received so that it can trigger whatever I want. The first thing is that I need to wake up my rat. We realized that the messages are being stored in a SMS database, SQLite, unencrypted, so you can just open it up. It has some tables. The interesting ones are the attachment and the message table. The attachment table is the one that every time you receive a message it stores the message in that table. The message table is the one that when you click read inside the infotainment, it's going to store that message into that table. That means that if we can monitor the attachment table we know exactly when a new message is coming to the infotainment, and as soon as we see a new message into that table we can wake up our rat and start executing what we want. There are some limitations when we are trying to do it with JavaScript. know JavaScript you need to start touching the screen, it's popping up so it's not something that is easy to see and it's so discouraging and also the driver or whoever is the target is going to realize that so it's not convenient. This is just a quick example guys that I want to show you. So here what we are doing is we have a message being sent through JavaScript. So the message is being triggered in a specific event. So as you can see here I'm going to be touching different parts of the infotainment but as long as I don't touch the part inside the infotainment that triggers the message nothing is going to happen. So I'm touching here, I'm going to different tabs in the infotainment, nothing happens because there is not a trigger right there but then suddenly I'm going to, you see I'm moving to the sound or to different places but then I'm going to move to a place where a message is going to be sent out by JavaScript without touching the send button. So we put the message inside a message and a specific event. The event is read message. So we go there, we click read message. Here you see the send button? We are not going to touch that button. When we click here any of those messages, checking the left side, the message is going to be sent automatically through JavaScript. Check that. The message is sent automatically and it is receiving the phone. So this was a way for us to send messages through JavaScript but as I said we are not going to touch that. It was there but it was not enough for us because it was too limited, it was not easy for us to wake up the driver. So we said okay let's focus on other options. WebSocket is one and then the MSG or the DBoss is the other option. So we are trying to find a way to send messages out but we saw that JavaScript it doesn't work for us. Okay, so in the WebSocket approach basically you can put a sniffer into the WebSocket see all the communication going back and forth between the JavaScript and the MMUI component. That way we can get that information and replay it. It's possible, but you need to convert this guy from this information in JSON into C, use the libraries to talk to the WebSockets. It's good, but still it's a lot of work. The second approach is using the Linux library APIs. In the left side you can see all the structure. When you're sending an SMS message we dump it from memory, and in the right side we'll start constructing the structures in order to understand how to send a message via C code. Still it's possible, but again this is just one simple event. If you want to do many other events, you're not going to be keep going adding and adding more events just to support a specific action. The final approach is to use the libraries to communicate with the WebSockets. If you're Another one was D-Bus. D-Bus is pretty cool because D-Bus has all these different implementations which means you have interfaces to talk to the Bluetooth, interfaces to talk to the radio, to talk to the GPS, everything. You don't need to do anything. You just need to call the D-Bus interface and method and that's it. We started exploring that information and then we decided that let's go through the D-Bus approach. At this point we said, okay, we have the guide that we need so let's focus on that. This is something to give an idea, guys, what it is. The D-Bus interface is exposed. You can see that we can do Bluetooth pairing operations, GPS, navigation, maps, network devices connection, system updates and the button SMS operations. That means if we are able to understand the SMS operations, we might be able to send and receive messages. A little bit fundamental about D-Bus, just quickly, it's a Linux IPC mechanism. It's just a channel to communicate information between processes. It is used by Lib D-Bus in Linux. It has specific policies. By the way, in this specific infotainment, there is no security policies. We're free to do everything. Actually, infotainment has a firewall that we can disable and we can talk to D-Bus also remotely. It is simple as take some parameters and you talk to it. It's pretty simple. We thought it was great, our feature, but probably not. Then we start understanding the D-Bus. The first thing is receive messages. This get message guy is going to allow us to receive messages, but turns out that this long line is very complicated, which means that it's a nested structure that the D-Bus send command inside the infotainment doesn't support. We were very happy. We said, let's send messages and receive. Turns out that it doesn't support these complex nested structures. Same for the other one. The second thing is to send messages. Same message as I said is to send messages out and also complex structures. We said, okay, we need to find a way to implement a D-Bus inside the infotainment. The D-Bus monitor, so that you guys know, is like a sniffer, but for D-Bus, D-Bus is to send the messages, but as I said, it is really limited. We start playing with different libraries. I'm going to go really fast in these three slides, guys. It's just a lot of effort by Gerardo. He's a genius. He's a genius. He's a genius. He's Gerardo, by the way, he spent probably three weeks trying to compile statically different D-Bus binaries because we want a binary that supports nested complex structures for us to use it in a scriptable way. Then turns out that it was not possible very hard. We tried like lib D-Bus. It was limited. It didn't work. We tried G-D-Bus. You need to compile everything statically. It didn't work. Then we found ROS bindings with D-Bus. Also didn't work. Godbus didn't work. DFIT didn't work. We tried G-D-Bus. We tried G-D-Bus. We tried D-Bus. We tried all these things. I think this is the one that we used. I'm going to give you a demo in a second. This works pretty well. We use it. It supports the nested structures that I said, but this is a GUI. DFIT is GUI. Still it works perfect, but it's not scriptable. Then PyID bus, turns out these guys also run some sort of Python, but it didn't work anyways. Finally, lib D-Bus. lib D-Bus, these guys, this is a solution for us. Turns out that it supports nested complex structures. I love the distance. I just want to make sure as I said, or container types. It has a toolchain created by some guys, I'm going to leave you guys the links. It's basically these guys created a toolchain specifically to this kind of card. For us, we don't need to deal with dependencies problems, with all those information problems. We just need to use this toolchain and works pretty well. You just define your XML D-Bus introspection information that you want to call through D-Bus and it's going to work. Here's an example. This example is one of our modules that I want to show you. It's just called Flickr. Flickr was compiled with this tool in a scriptable way in the infotainment. It's pretty simple. You connect to the D-Bus port and you establish a connection to the D-Bus, then set up the interface that you want to deal with D-Bus. It's called LBDS-2. LBDS-2 is a video related interface that we use to set the brightness, which basically means you can turn off the display, turn it on. That's simple, but this is the way that finally you run. If you have done some toolchain compilation, it's just a way to compile it and ready to go. We have the Flickr ready to use in the infotainment. We have everything ready, guys. Finally, before the demo, see here is how everything is going to work. We have all the components. Basically it's this lady driving the car, listening to music. She's already infected with the Salinas rat through social engineering. Sorry, not yet, guys. She was not infected. Now, she's infected. Then she plugs the USB and then this guy gets infected. Then we do the persistence. As you As you remember we put this guy into the services that I can boot up all the time, Salina Rath is running, then we start monitoring the SMS database so that new messages are coming, we start executing, then we launch the sniffer, which is the Dboss sniffer, which is like a Wireshark for TCP, it's the same for Dboss. We put the Dboss to start listening in specific events that we know are related to the SMS messages. And then the test app tool, do you guys remember the test app tool that these guys left into the infotainment? So we used that one to reset the connection to the infotainment. So what that means is that we understood that when you connect your phone to the infotainment, there is a session between your phone and the infotainment. So when we infect the car, that session already happened because this guy is already connected. So we need to find a way to reset that connection so that the session is established again and then we steal it. Once we steal that session, we can control the whole SMS messaging. That's why we use this test app tool in order to steal the session between the phone and the Bluetooth. By the way, this is not needed per se, I mean, we did it because you can do that on demand. Let's say that you have a 30 minutes shot to do this, you cannot wait for this guy to get a message, or a call, so that you can intercept the session, because that's when you're going to receive the session. But we reset it on demand. command so that it gets disconnected and we get the session. But the other option is we just wait and eventually when it receives a message we will still get the session. So we intercept the parent session. This is a JavaScript SMS that we saw. Even though it didn't work a lot it helped us as the first beacon because it just wants to send a message out to the attacker and the attacker will receive the phone where the rat is connected. So at this point we know what is the phone infected in a car and then from there we can start sending messages to the infotainment and it's going to start stealing SMS or whatever you want. This is the whole process guys. Let's do a demo. Here are other commands supported in the rat. We are implementing some of them. Ransomware is just put this guy on usable mode and you need to take it to the dealership. It's pretty simple. You just remove specific services and you lost connectivity as we did. Actually we implemented what we learned so that if you want to fix it you need to go to the dealership to get it fixed. This is a test server that we are running. This is the debugging tool. Wi-Fi, Ethernet and the Flickr. It's just an example. So let's do a demo guys. I'm going to move there and let me see. Let's do it here because I don't think I can move the laptop. Let's see. Here I am connected to the car. The first thing I'm going to do, I'm going to turn on the Bluetooth in the infotainment so that I can pair my phone. So I'm turning on the Bluetooth so that now my phone is, I'm the driver right now. So I'm playing the role of the driver. So my phone is going to be, it's right now connected to the car. Okay. Okay. So I'm the driver. I am driving this thing. I like born. Actually I don't like, but I'm just telling you guys. So I plug the USB, right? And then this guy is infected. So we are here inside the car in this screen. In the right side, I'm going to run the famous D-Bus monitor. Sorry, D-Bus monitor. Let me just open this. So here I have a specific guy, which is this. This is just D-Bus monitor. What you're doing here is you're saying, hey, monitor D-Bus on a specific event. The event is called get folder list. Why? Because we want to monitor that event only because we know that when the phone is connected or disconnected, this event is going to be called. So we don't want to sniff everything, right? We just want to put a filter. It's basically that. So I'm going to just run this guy. So it is ready. It is waiting, right? So now in the left side of the screen, I'm going to start running what is called the test observer. Do you remember the test observer that I told you guys? You don't remember it? Okay. My friend, good. Thanks. Okay, so see, we have treated test observer. Okay. This guy will learn. Obviously after doing the reverse in that, we need to call it with... Ms. . disable command because otherwise it's going to time out. We run this guy, it starts running there and it's ready. Right now we have this debugging service. What we're going to do is now we're going to query this guy. This is something that I'm doing here guys in front of you but obviously this is what's going on behind the scenes so that you guys can see exactly what the rat is doing. The rat is doing the monitor, the rat is running test observer, talking to this guy and querying the phone. The first thing we're going to do is we're going to say let's run this guy. We said you remember the prefix which was AT plus TMC equal. We're going to say hey, tell me what are the phones connected in this car. You are in Mexico City, you are not in US, you are just the drug cartel boss so you are waiting for this thing. I'm just okay. Give me what are the phones connected. It says okay so we have three phones that has been paired into the car. That's just pair phones. Now tell me what is the phone that is active right now. The phone that is being driven by the car, by the driver. It's right now there. We said 518 and it says okay so the one that is active right now which is my phone it this MAC address. Then we said reset that connection so that we can, as I said if you reset the connection, when the conection is established again we still decession of the Bluetooth and the phone and then we can control everything. We said okay so for this guy we do these commands and then we said reset the conection. What I want you guys to look at is the right side and then I execute this because in the In the right side, when we issue the connection reset, in the right side the device monitor is going to attach that new connection, let's see. We run it, let's see here. Let me check, no, we didn't get it here, let me check, 432, yeah, 80 plus, I think it was this, oh, sorry, no, this is, let me check the command quickly here, 432, yeah, that's the one, just let me quickly check, just a little bit. Well, it was getting everything here, but let me just give you, give you the connection. Yeah, yeah, it's working now. Checking the right side. Yeah. So, by the way. So, this is because I reset it manually, let's do it automatically, okay? So, what you see here is here is the connection ID and this is the context ID. So, all the other things we don't care about, we just need the connection ID and the context ID to start communicating with this guy. So, let's do it in our way, I do it manually there, but let's do it automatically here. So, I'm going to try to execute exactly the same command, which is, let me check, okay, I think it's this one. Let's see. Yeah. So, it's executing. Check. Check here, guys. Check here. Okay. So, this is in our way. So, we reset the connection and, unfortunately, you cannot see there, but you guys are very close there. So, it says disconnected, connected, disconnected, connected, but, you know, you are driving and you see it's disconnected. Well, that's all right. That's nothing, right? I mean, you don't have to worry about that. No, I don't even care. Okay. So, now, we got the session. So, what is the next step? With that session, let's take it and let's steal SMS messages. So, we take these two guys, as you can see, by the way, the sessions, sometimes, in this case, you just can see it's the same, but sometimes it change, actually, but this is the latest one, okay? So, let's go to my Ubuntu box. In this Ubuntu box, what I have is, I have the tool, you remember, the fit tool? This is the GUI, but, obviously, behind the scenes, we don't need the GUI. We just need the other option to compile it and execute it through tool chains, but this is for you guys to see. So, what I'm going to do is I'm going to connect to the infotainment through Wi-Fi to the port 3000. I don't know if it is still connected. Probably not. No, I don't think so. Let me just quickly reset the connection. I think it's this. Okay. Okay, so, let me check. You can see there. Okay, yeah. Let me just. It's the same thing. I see the three. Yeah. So, okay, we have connection. And so, okay, so, we connect through, we are connected to Dbus. Dbus has multiple ports. It depends on the port. the ports has the exposed interfaces. So we connect to this interface, we are here and we are interested on the MSG one, if you remember guys, this is the one that we are interested, MSG client. MSG client as you can see has all these exposed different methods for us to control SMS messages. So the first thing that I want to do is I want to use the get message list. This get message list is going to say, hey, pull out all the messages from the phone that you just give me the session. So what I'm going to do now then is I'm going to go here and I'm going to prepare my message. So basically here I'm just copying, you remember those two values that we got. Let me get them again. These two guys. So what I'm going to do is just I'm going to copy this guy to the command line below. This command line guys is just to interact with Dbus. So these are all the parameters that I need to pass. The first parameter is the connection ID, the second parameter is the context ID and then we are set. We pass the second parameter. And that's pretty much it. This is the whole information that we need. We just paste it into the tool. You can see here in the top, connection, context ID, timeout, all are the parameters for Dbus. Obviously during this exercise we need to realize what are those different parameters but after that it's simple. Now here this is the gray value. This four is the number of messages you want to get. I put three for example but we can put more. So what I want to do right now so that you can see that this is live. So I'm going to just send three messages to my, I'm the driver right? But I'm going to send, pretending that I am another guy, I'm going to send a message to me so that you can see it's popping up in that guy. So that guy is receiving messages and then we will steal those messages. So let's say we put, what is the name of your wife my friend? It's just a joke my friends. I send this messages to my phone but I don't think it's working. Josh I told you don't send me anything with bad words man. But anyways so I don't think it went through. If you see something popping up, let me know okay. But I don't think so. Let's do this. We said execute here. Let me just ... This display ... We click execute here, and then when we click execute ... I just need to click in source, and here in source, guys, we get the messages. Latest messages is three messages. You can see here, damn. This is my friend, Josh Gomez, a friend of mine. Then here is another message, all those messages. We just retrieved three messages. If we could put here four, we might get, obviously, more, but that's basically the idea. We do execute, and then we go to source, and I think I get another one. Okay. These are the messages, but what we did is now we get the messages from the phone, right? Now we need to send it out. Right now we get it. Now we need to send it out. I mean, we get it, but this message is in D-Bus, so we need to send it out to the attacker so the attacker can steal the messages. What we did here is we just created a small tool that we are basically parsing these messages and sending it to a second device. A second D-Bus interface, which is the one that sends the messages out. Whoever tells me what is that interface name, I'm going to give you the book. What is the interface name that we use to send the message out? Who's save message, my friend? That's yours, my friend. Okay. Yeah. It's called save message. With save message, it's the one interface that we use to send it out. Okay? Here, I need a volunteer that wants to play a role as an attacker so that ... Don't worry. I just want you to receive the message. I want to send this message to someone outside. If there is no volunteers, I can do it myself, but I mean, is there any volunteer? Okay, my friend. Come over, please. Okay. Okay. Okay. Okay. Okay. So, what we're going to do is we're gonna just ... Can you type your phone number? Yeah. Yeah. So, what we're gonna do here is, we're just gonna type a phone, right? This is obviously behind . It's attacker's phone, but here we're gonna use his phone. So, this message that we just saw there are gonna be sent out. It's just basically what we're gonna do. It's like the final step on this whole thing. Okay. So ... Yikes. I just need to, this is escaping thing, I remember that it's JSON thing, so it's just, we need to escape it, but anyway, it doesn't matter. Okay, so can you type it here, my friend? Here, one second, yeah, right there, please. Nobody called me. Okay, so, I think we need to have one, I guess, but anyways, so we have this phone, what's your name? Jeremy. Jeremy. So, we have the phone of, Jeremy is going to be the packet right now, so we're just going to execute this so that you guys can see how it looks like the message is out. Just give me one second. This, okay. Okay. So, let's execute that command, let me see if that works. Okay, so this is just, first of all, we're just passing the messages, here you can see in a more easier way the phones, and so, anyways, so here is the phones that we got, information here, information here, information here, right? So, this, you don't believe these guys, this is just a friend that really loves me, and actually it's my phone, it was just me, okay? So, then, we're going to send this message out. Okay? To the phone that we just decided. So, in order to do that, as my friends tell us, we're going to use a different interface, right? As you remember, so we're going to go to the save message interface. That save message interface is going to allow us to send the message out, and it's going to be sending the message out to this phone, which is the phone of Jeremy. So, Jeremy, can you just stand here? This is like a magic item, my friend, you know? So, just do like this, like the phone, like, no, you don't need to turn it on. Just put it like this. Just see if it receives the message. You know, the demo doesn't work, so don't worry, guys. Okay. I sent the message. Let's see. Oh, there. Okay. I told you, guys. Well, it's in the outbox. Actually, the command works, but... Yeah, I don't know. Let me try another phone here, also, since we're here. It's right away. I think there is some messaging here going on. 63084906. Okay. That's my phone. And then, let's see. Execute. Do you need the country code? Would the country code be stirring it up? Well, I put the one. Do you need that? Plus one? No, I don't think so. Mexico? Oh, yeah. Mexico. What about Chile? No, but it's that way. But I think... Yeah, because I was not also receiving messages, so I don't know. Maybe it's something... What happens if you take the plus one out of the phone? Without one? Without the plus one. Okay. Yeah. Let's try that. Let me just grab, again, your... One second. Okay. Let's try that. Actually, I don't recall how I tested it, but yeah, let's try that. Copy. Okay. Okay. Okay. Okay. Okay. Okay. I got it. So you... Let's try to keep the... To remove the plus only, right? Oh, I said one, two... Okay. Let's try that. Like... Let's try that. Oh, it doesn't work. Because I tested... I think I tested it without that, and it works. So. Okay. Yeah. Let me quickly check here if I am connected properly, connected, yes, oh yeah, no, no, it's active, yeah, no, I don't think it's working, let's do something, man, if you receive it later during the day, tweet it, please, yes, so that these guys, yeah, sorry, guys, I don't know what's going on with the communication, but actually, I have a demo video here at the end, but we do, this is exactly the same, let me check here, no, no, but this is the same, yeah, it's exactly the same, so for some reason, it didn't send the message out, what is it, this, so, sorry, guys, for that last one, I don't know why it's not working, but well, anyways, that was the last step, so we'll steal the messages, and then we just call the same message, and then the messages are going out to whoever is the destination address, but I also tried with mine, and it didn't. I didn't receive anything, so there is something, oh, wait, no, I received it, actually, yeah, you didn't saw it pop up there, yeah, no, I received the message, yeah, why? If I receive the message, the message should be here in the infotainment, because I sent it to me also. Okay, guys, so, sorry for that communication there, but it was the last step, and just some takeaways here, hopefully, I'm going to connect it outside, we'll see if it works, if that sends the final message. I received the message here but for some reason it's not popping up there. Final recommendations, with this talk I hope that the recalls from the cars, they can take more seriously the fact that we can infect cars because I think that this kind of scenario is real and that can happen and I don't think that it's going to be a problem. Let's do the last demo. Can you send a message? We're going to send a message now outside. I'm going to send a message, let's say here is the attacker, he's going to send a message to my phone and then my phone is going to receive the message which is the rat inside and it's going to do some actions in the infotainment. Let's write that one as the final example. So he's going to send a message guys, it's file number 4, it's going to be receiving in the infotainment and it's going to execute. So if the message is received and it's working then we should receive the message there. If we don't even receive the message there, I mean there is something going on with the communication. So the infotainment is not receiving the message. So can you send a message? So if the message is received, we're going to get a pop-up window there. Yeah, there is something with the SMS messaging. It's not even, because you sent it, right? Yeah, it's sent out and let me just do something quickly. Yeah, we sent the Bluetooth. Yeah. Yeah, let's go reset it just to see if it receives the message. If it doesn't receive the message, I mean there is nothing we can do. No, right? Yeah. Okay, for some reason it's not receiving the message. Yeah, I know. Okay. So yeah guys, for some reason it's not working the SMS messages in this room for some reason. But anyways, so I apologize with that. That's pretty much it. Thank you so much to Alan Monk. Thank you guys. John McMaster and Josh Gomez for your work and obviously that's it. Thank you guys.