My name is Yuanjian, and my topic is security flaws in automotive immobilizer. We also come from the Unicom team. It's a radio and hardware security research lab in Qihu 360 technology. He just introduced our team. We just want to say that we are one of the DEF CON 24 vendors. Next, we will introduce my colleague, Zheng Yingtao. He is also a security researcher of our team. He has rich experience in automobile security and IoT security. So, my name is Yuanjian, and my research is all about wireless sensor network and NFC and so on. So, today, what we want to share is key fobs. So, we will use the key fob to open the car door or close it. Then, we will find some flaws of it. And then, we will use these flaws to open the car. First, we want to find what is the frequency. It works just... First, we can find the... open the key fob, and we can find the crystal of laser. And we found it's printed on it. And we will find the share of the key fob. And we will find the FCC ID. And we can search it in the website. And then, we will get more information about it. So, if we could not get the information in this way, we could find another way. So, we have another tool to us. Just like USRP, HackerIF, and what I like, I like it's RTL. It's very common. And the price is very cheap. And we use it. And the frequency is from 24 MHz to 1.7 GHz. And we will find this. This is the red point. We will scan the frequency and find the red point. So, we can get the frequency. Then, we set the center frequency to it. And then, we will get the signal in detail. So, we capture the signal four times. And it has, when we align the wave, we find it's the modulation. It has the ASK. The modulation is ASK. And first, we will introduce the preamble. The preamble is used to tell the car that, uh, there is a signal coming. You have to be ready for the signal. Then, the sync header. The sync header is used to synchronize the time. Then, the data about the hopping code is 32-bit and serial number. And then, the 4-bit function code and 2-bit status code. Then, it has a guard time. The guard time should not be too short. Because, if it's too short, the car could not recognize the one signal. Actually, the hopping code is the result of the encryption that is employed by the, in the car emulmonizers. We will explain that later. And the serial number and the, uh, the 8, the 28-bit, uh, serial number is, uh, is, uh, unique to the, uh, key fob. And the 4-bit function code is, is used to, to tell the car what, uh, action to perform. Like the open, open the door, close the door, or open the trunk. So, we get this, uh, uh, we know the, uh, modulation is ASK. And, uh, so we, we, we should change, translate the, uh, uh, way to the bit. So, uh, first, uh, we know, uh, the, um, the long one is, uh, zero. And, uh, the short one is, uh, is, is one. And, uh, this sends the, uh, signal from left to right. And, uh, zero, one, and one, one, one, zero. So, uh, uh, we put, uh, uh, we get the MSB and the high SP. So, we get the number is, uh, uh, zero, one, one, one, and, uh, one, zero, one, zero. Then, uh, we get, uh, the value is seven, eight. So, we translate it, uh, away to the bits and, uh, and, we get the data. So, we have, uh, uh, uh, connected, uh, uh, several, uh, uh, of, uh, uh, keyfab cheaps, And, uh, as an example, we will introduce a SNS, uh, a 301 as an, as an example. Uh, Uh, uh, this is the format, this is the format, of, uh, of the cheaps. Uh ... actually there is, uh, many, many, many chips, wireless chips used in the key fob and in the key fob. These are the specific chips. And this table is actually telling us that the signals transmitted, the format of the signals, like the pre-mentioned, the function code, the rolling code, those formats are very similar. So we will take a specific chip as an example to analyze it. Okay. So next, we will introduce the data. First is the hopping code and the serial number. The serial number is unique to every key hub. Every key hub is unique to every key hub. Every key hub has its own key fob. Oh, key fob, sorry. Key fob has its own. And then is the function code. The function code is to tell the car if to open the door or close the door or other thing. Then is the two-bit status code. This is used, one bit of it is used to tell the key fob. Oh, key fob. a driver auto The key fob is the driver if the key fob is low power status and another bit is used to tell the car if this signal request repeat one and then we want to introduce the 32-bit hopping code. The The 4-bit data is 32-bit and it contains 4-bit function code and 2-bit SPR code and 10-bit discrimination value and 16-bit sync counter value. We have found it has two parts, the same function code, the outside one and the inside hopping code and which one is real. So we test many kinds of cards and we find the outside is useless, the card just uses the inside one. And then in the... 2-bit SPR code, we read the source code and finally we find out the 2-bit SPR code is never used. And then in the 10-bit discrimination value is a low 10-bit of 28-bit serial number. So it's used to recognize if the... signal is sent by the correct key fob. And then in the 16-bit sync counter value, it's used to judge if the signal is right. When the key fob sends a signal, it has its own sync counter value. The card will compare the sync counter value itself to the key fob. So it will judge it if the value is right. Then... Any question? Okay. Then they will do the key lock. They use the 16-bit 4-bit encryption key to... and do the key lock algorithm to produce the 32-bit hopping code. Okay, the key lock. How many of you have heard of this? Okay, one more. Key lock is just a cryptography algorithm that is commonly used in immobilizers. And you can just feel that it's like an AES this. Okay, this is like just a cryptography algorithm. And the function code, like the rolling code, is a result of encrypting using key lock to encrypt the function code. And the 10-bit discrimination value is just the lower part of the serial number. And so this... I hope that everybody understands what the key lock is. Oh, okay. Then let me introduce shortly about the key lock. Key lock... First, it has two parts. 16... The lower part is the 16-bit 4-bit encryption key. And then the data is 32-bit. First, we get... 5-bit of it from bit 1, bit 9, bit 20, bit 26, bit 31. And we do NLF operation. And now we get 1-bit. And now we do the XOR to the bit 0 and bit 16. And... Bit 0 from the encryption key. And now we get the encrypted bit. Now we will do this... Now the data will shift. And the bit 16 4-bit key will circular shift. And we will do this 528 runs. So finally we will get the encrypted 4-bit data. 4-bit data is the rolling code, right? That's the rolling code. This is the decryption of the key lock. Z is the inverse of the encryption. So it's not a big difference. So just use the difference bit. So next we will introduce the first flow of some cards. Some cards. Chip designer did the rising. But not all the automobile manufacturers. Some manufacturers did it, had some problem. And so if a car has the problem we find, so how we could open a car? Then next we will first record continuous signal twice. And then that means we will get two continuous sync counter number. And then we will replay it. So that's the result. We could open the car. So... Okay. I think we have told you that... I think this is when a car has a vulnerability we found, we could open the car in this way. Okay. And so next we will introduce why. How a car authenticate the key fob. And how... What's the vulnerability? Where the vulnerability exists? First we should read some... First this is the key fob on my right. Then he sends the data. And the data contains 32 bit hopping code and serial number function code and the status code. And then we use the key log to decrypt it. And then we get the data unencrypted. So we have 4 bit function code, 2 bit speed code and the decryption value and the sync counter value. The sync counter value is the most important. If the sync counter value is 7F1 and the e-hop. E-hop means the sync counter value saved in the car. He has a value. So the hop minus e-hop. We get the e-temp. That means the value is negative 15. So it's smaller than 0. So that's the return force. That's the chip decryption. So... If the value is unsigned. It's the same as just I said. But the difference is unsigned. If the value e-temp is unsigned. So it will get the value F1. Not just what I told is negative 15. So they will return 2 functions. Request re-signite. So we read this source code. The e-hop is the data is the sync counter value from the keyfob. And the e-hop is the sync counter value saved in the car. So hop minus e-hop. We get the e-temp. So e-temp is smaller than 0. Just see that this is negative 15. So it's smaller than 0. So they will go to force. That's the right. That's the right correct thing. So the next if they define this value as unsigned value. They will go to force. They will go to this. Request the rethink this function. Does anyone have questions right now? Because this is actually the vulnerability where it exists. Where the vulnerability exists. So if you have a question you can ask him right now. Okay. Do any of the car manufacturers solve the values before they encrypt them? So that you can replay the attacks? Okay. Actually I think there's a misunderstanding that your confusion comes from here. Here. Actually the value. I always explain from the top to the top. From top down. There's 32 bit. 32 bits hoping code is the result of using key lock encryption algorithm to encrypt the content. The content there. The four bit function code. Two bit code. The content. Understand? So actually there is a four bit function code in plain text. Sent in plain text. And there is an encrypted version four bit function code. Actually we have done some experience. We found out that the car will ignore the four bit function code that's not encrypted. It will only respond to the function code that is encrypted. But your question is how. Actually we were talking about how the car handled the decrypted result. Of the. Which is this part. Then unencrypted contents. So the car has the key. So it can decrypt the content. So we are talking about that. But we are talking about the decrypted version of this content. Does that make sense? So the vulnerability. Vulnerability. Okay. And let me tell you how they use this sync counter. Sync counter is. Actually when you press the key fob. The key fob will send out the 32 bits hoping code. Which is encrypted version of the content. And plus this part. When the sync counter. When the car receives the sync counter. They will check. They will compare the sync counter that's stored in the car. The car also stores a sync counter. Synchronization counter. Okay. When the synchronization counter stored in the car is larger than the synchronization counter received. Okay. When it's larger the car won't respond. When the sync counter is larger than the stored one in the car. There's a range. If it's larger by 1 to 16. 1 to 16. In this range. The car would instantly respond to the function code. Open the door or close the door. Okay. If it's larger. More than 16. The car would enter a state called resynchronize. Resynchronization. Okay. So the car would store the received. The current received sync counter. And the. Both the current received sync counter and the old counter that is stored. Okay. And it will enter the resynchronization state in which the car will wait until he receives the second signal. And if the second signal contains a continuous sync counter value which is larger than the formerly received sync counter by 1. The car would respond to the function code. And. Change the old one. The stored. The one stored in the car. To the. The last. Last received sync counter. Does that make sense? No, no, no, no. If the. If the user presses the button and the car don't respond. You should continue. It goes on to press again. So. That would resynchronize the sync counter. Because when you. Put the key fob in. In your. In your. In your. In your pocket. You may. Unintentionally press that. Multiple times. And it goes off the. 16. Range. Okay. Okay. We are. It's not the real replay. If. If he has this law. This is the floor. We are going to introduce the floor yet. We are. We are going to introduce the floor. Next. The. The. The. The procedure I just. Is not. Is a normal procedure. How. How. How. Authenticate. The key fob. Yeah. He is going to introduce the floor. Where. The floor. Is. You know. This is. This is a normal. Normal procedure. So. And. If. They defined. This. As. Unsigned. Value. So. This is. An. Normal. Is. Normal. So. When. We. So. When. We. Send. The. Smaller. Smaller. As in. Counter value. They. Should. Go to. The. No. Response. Then. If. If. They. Defined. If. The. Manufacturer. Defined. The. E. Temp. As. Unsigned. Value. So. They. Will. Go. To. The. Resignate. Resignate. So. If. They. Go. The. Resignate. They. Will. Set. The. F2. Chance. To. Two. And. Wait. For. They. Will. Wait. For. The. Next. Hop. And. The. Next. Hop. Plus. One. So. When. They. Get. The. Next. Next. Signal. The. The. Value. Is. One. Bit. Is. Bigger. Than. Not. That. Mega. Okay. If. I. Just. I. Think. I. Just. Explain. That. If. The. The. When. The. Car. Inters. The. Recurring. Resynchronization. Procedure. It. Will. Wait. On. Another. Signal. Right. So. If. The. Another. Signal. Is. Larger. Is. Greater. Than. The. Received. Synchronized. By. One. So. It. Will. Resynchronize. Yeah. Yeah. Then. The. Next. Signal. We. Will. The. Program. Will. Go. To. Hops. Hk. And. F2. Chance. Is. True. And. Next. Next. Hop. Equals. Hop. Then. And. The. Result. Is. They. Will. Return. To. So. The. Car. Will. Response. To. The. Signal. So. If. They. Say. The. Second. Hop. Is. Seven. F. F2. So. They. Will. Go. To. The. F2. F2. Chance. Is. True. And. The. Next. Hop. Is. The. Bigger. Or. Larger. One. So. We. Changed. We. Changed. The. Signal. Control. Value. The. Signal. Control. Value. Should. Be. Bigger. Than. The. Previous. But. If. He. Had. If. The. Has. This. Floor. We. So. This. Our. Guess. So. The. First. From. The. First. Picture. We. Know. Is. A. Code. Right. By. The. Chip. Designer. He. Designed. The. World. As. An. Sign. Int. Is. The. Is. Next. Picture. Is. I. We. Guess. The. We. Guess. The. Some. Mobile. Manufacturers. Define. The. World. As. Unsigned. So. We. We. Used. To. Continuous. Signal. To. Open. A. Car. Does. Anybody. Has. Questions. Until. Now. Regarding. Their. Previously. Contents. Actually. I. Think. There's. Actually. The. I. Have. Already. Explained. The. Normal. Procedure. Where. The. Car. When. Is. Syndicated. Is. A. Key. For. It. When. The. Problem. Is. Here. Okay. Okay. So. Not. Here. The. Problem. Is. Minus. Operation. In. The. Code. Okay. You. See. The. E. Temp. And. The. Hope. And. In. Hope. The. E. Temp. Is. Is. Value. That. You. Get. From. By. Using. The. Received. Think. Counter. To. Subtract. To. Minus. Minus. By. The. Stored. Value. If. The. E. Temp. Is. Defined. As. As. Assigned. Integer. You. Will. Get. Both. Value. Both. Larger. Or. It. Will. Get. The. Negative. The. Minus. Operation. Would. Always. Produce. A. Value. That. Larger. Or. Equal. Than. Zero. Equal. To. Zero. Okay. So. When. When. They. Continue. To. Go. When. They. Go. Onto. The. Section. Of. Code. So. So. So. If. The. So. So. We. Could. Use. Like. To. Continuous. Signal. Which. Contains. Up. Till. Now. We. Are. Not. Able. To. Decrease. The. Encrypted. The. Contents. You. Know. But. We. Record. Two. Continuous. Signal. So. That. This. The. Same. Counter. Value. Would. Be. Continuous. Like. Okay. So. We. We. Replay. To. The. Same. Uh. Resynchronizing. The. Counter. Value. Okay. So. That's. Why. We. Can. Okay. Use. The. Signal. To. Open. The. Door. Continuously. Okay. Next. If. We. Have. More. Time. This. Is. Video. Uh. We. Have. To. Use. This. In. Floor. To. Open. A. Door. Is. This. The. Audio. On. The. Mail. To. Do. Music. Music. Music. Music. Music. Music. Music. So. In. Another. Another. Way. To. Open. A. Car. So. You. Have. Three. Yeah. Okay. We. Going. To. About. To. start the second vulnerability to explain the second vulnerability. Has any, does anybody has question regarding the previous vulnerability? Let me just type define. Okay. Now, it's about the simple, the encryption, they have three ways to get the encryption key. Now, if we use the KeyLog, the encryption key is very important. So, how they get the encryption key. They have three ways, the simple encryption is the most simple. They use the manufacturer's code just as the encryption key. So, it's very interactive and if a car lost a manufacturers code, security is present, and the encryption key is the key. So, if So, they will have influenced a bunch of cars. Okay, on the previous vulnerability exists in the code that authenticate in the key fob, but this vulnerability exists in the key, it's more like a key management flaw in the car industry. So, the next standard encryption. So, they use the serial number to get the encryption key. First, they use six and serial number and key log algorithm and manufacturer's code to decrypt and they get the 32-bit MSP. And then, the same way, they get the load and the decryption key. Now, they get the encryption key. It's the same problem as the simple encryption key. If we lost the manufacturer code, what we did not know is the serial number. So, we could just listen to the, just capture the signal once. So, we will find the serial number. And now, we can get the encryption key. Or, we did not know, did not capture any signal. So, we could try the serial number one by one. And finally, we will open the car. So, the next, I think, is the most secure way. The secure encryption. The difference is how the seed. The seed is unique to every key fob. And it's random. So, if we get one key fob seed, we could not use it to open other cars. So, the MSP is the encryption in the same way. And the next, the seed is the encryption. So, we use the seed to decrypt the, to get the low ASP of the encryption key. So, if we find, we get the manufacturer's code. And if we capture the serial number, but we did not know the seed, so we could not open the car. So, we have lost your key fobs. And the manufacturer will give you the key fobs. So, they must know the key fobs. Okay. Okay, supposing you have lost your key fobs. And you have the manufacturer and you, as usual, all forgot the random seed, right? That's your question? Okay. The car, the car manufacturer has their equipment to connect to the car and update the new seed. Okay, I understand. Okay. Actually, we are talking about the initialization of the encryption key. How the car manufacturer initializes the encryption key for the key fob, for their key fobs. There are three type of, three method. One is the simple version and the standard and the secure encryption. Because the secure encryption got a seed, so even if you extract the seed from one vehicle, you cannot use that to open other vehicle. Okay. I think that is, the car manufacturer may have their specialized equipment. That's, I think, is a question. You mean how the car manufacturer updates the seed, right? Well, yeah, like what kind of, I don't know, official tools or some of the tools that we have here at . Okay. I understand. So, this is the unsigned one. Unsigned one. We just, it has no input region. They are all blue. So, we need to just try serial number one time. So, the serial, first, if we listen to the, capture the signal one time and now we get, we try this two times. First, we get the 00 or 01 and then, and they go to the, they go to resign, resign status and then, and we send the next, they will open the, open the door. So, the same way we used to, we use is to try the serial number. If we don't know the serial number, we will try, we will try it one by one and then know the age, know what kind of the car to reduce the time. Yeah. This is the video. We try the, the serial number. serial number. It's not very real. Just, you know, this light is well, be, be bright. It's shining. Well, it's not very obvious. Sorry, it's very, very obvious. So if we have time, we have to do a demo. But first, I would like to ask if anyone has questions. Okay. I think that the, actually, I would like to do an abstract of the talk. Okay. The first vulnerability exists in the implementation of the authentication protocol, the type defined, the assigned integer, the assigned integer. Okay, this is the first vulnerability. The second vulnerability is the key management. Actually, the manufacturer employed the weak key generation method in which you use serial number and the manufacturer code. That's the second vulnerability. And we actually tracked many, many manufacturer code and serial number from, like, the, you know, the Tor and . So, yeah. Like, the way we can, now, with the second vulnerability, we can actually decrypt the hoping code. So we could change what, the contents, the content in it. So, actually, he was talking about that. When you can decrypt that, you can change the synchronization counter to whatever you want. Well, and so, actually, I, I, we can also disable, disable the owner's key fob by doing, by changing the synchronization value so that the owner literally have to press, like, almost 30,000, because it's, like, 16 bits variable. So the user has to, like, press more than, like, 30,000 times in order to regain control. So we literally disable their key fob. So. Any questions? Okay. Oh, demo. Okay. This, we are going to demo after market immobilizer because we found the manufacturer code. So we, we could find the encryption case. So, yeah. Yeah. We are using this device to transmit the rolling point to the football. And here is the immobilizer. This is the original keyfab. This is the original keyfab. So, we have this serial number. Receive the rolling code, the serial number. And then it's a descriptive one. That means if the car is open for a long time, they will close itself. So, the next is the sync control value. So, we press to unlock it. Yeah. So, with the sync control value, add one. Yeah, we will show that this is the first floor. We will try the sync control value smaller than the sync control value saved in the car. This is the immobilizer. We are not explaining the first floor because this is the first floor. So, we are explaining the rolling code here. So, we already got the key. We are doing a demo. And then we will try the... Because the first one we cannot detect the rolling code. First, we will get the... Oops. First, we will get the... This part. Copy. Then is the serial number. I just write it. 19 RTA... 19 RTA... 19 RTA... We will try the statistic code. the signal counter value. It's no response. So the signal counter is different and it's much louder, louder than 16, louder than that. So the middle line won't respond. So after we send the second signal with continuous signal counter, it won't respond. So we will try the next signal counter value. This is not the same. Maybe something is not right. Just close it. Okay. We press it. Okay. As my colleague is preparing a demo, I click on the hardware we use, although it's foggy, but it's functional. We have this transmitter. Remember that the signal is like AST amplitude 15. So this one is just accepting the digital signal from this microcontroller, and there is also the carrier, and when there is a digital signal from the microcontroller, it comes to the amplitude 15. Otherwise, the right timing, and we produce the wrong signal. The radio signal doesn't contact people. This one is for transmitting. This one, let's say there is an antenna here, this is to receive. And you can do this without this hardware. You could like to use it to act as RF, the software to turn the radio back on. And you can use the USB to do this, but also you can use it to do this. That's the receiver. That's the transmitter, right? It's not responding. Hi. This is the싸ắt, which I throw in the top. And right now what I have, it has the signal. So it is syncing. Actually, this kind of thing in one ride is actually a non-competitive unit. It actually has a keyless entry. I can't remember the name of that. The keyless entry system is a custom-made system that's located in the keyboard by using local latency. It has a latency of 125 kilohertz per second. All right. Sorry. It's been a while. But you can see that it's just part of the scheme that was discovered by the... . The software department was in charge of the system over the course of the entire new year. The whole stuff was with the world of мног-languages. The attacker blocked the first signal just reached by the keyboard and the... . Notるly. We blocked the first one. My quebecite. And the... . And then we played the first one. My quebecite. So it's different than that because when the user pressed the keyboard again, the signal, the second signal, it was invalidated. So it's different. And then that user said, only use that signal once. And with this one, you can use it forever. Because every time you use the signal, at the same time, it will be synchronized with the signal. It can't be the same with the second one. And with the key management of this, we actually have the same thing. So we can change the signal whenever we want. And then also, we can also control the function of it. So in the previous one we did, the function code, we cannot create it. And we can only use the function code. So we cannot, like, change the function. If we call it, we can only call it. And with the second one, we can only call it. And with the other one, we can only call it. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Are you getting sequence numbers in the lockout range? Not because we are going to the same two signals, so we might want. You know, we might want to have a greater dynamic. We don't have to great dynamic response. So you know, we are now going to detect Yeah, you're filming a little bit slightly smaller. So, we're going to have to do this. This is the depression, the rolling pulse. Yeah. Okay. Okay. Okay. Okay. Okay, it works, I found it. That's what I was saying. Thank you. Thank you for waiting for the demo. Any questions? Great. Thank you, thank you everybody.