WEBVTT

00:00.000 --> 00:00.780
Okay.

00:01.720 --> 00:04.360
Good afternoon, every hacker.

00:05.020 --> 00:08.600
For me it's a pleasure to be here for the second time in the Car Hacking Village.

00:08.900 --> 00:10.940
So, yeah, let's go ahead.

00:10.940 --> 00:13.400
Hacking a hard unit with a malicious PNG.

00:13.400 --> 00:15.280
This is a zero‑day technique.

00:16.540 --> 00:18.500
I hope you enjoy it.

00:18.500 --> 00:19.120
Okay.

00:19.300 --> 00:27.300
I'm the founder of Reverse Everything, the founder of the Pwn or Die, the most underground conference in all over the world.

00:27.300 --> 00:28.280
It's in Ecuador.

00:28.440 --> 00:29.500
You are invited.

00:29.500 --> 00:30.380
It's very underground.

00:30.380 --> 00:31.440
I really like it.

00:31.440 --> 00:39.400
The founder of the Car Hacking Village, you are invited in Buenos Aires, the most important, biggest Latin American conference.

00:39.400 --> 00:41.960
I am Howard Segura, my free time.

00:42.680 --> 00:47.140
And my YouTube channel, if you scan the QR.

00:47.540 --> 00:52.200
So we are talking about the KIA infotainment console, okay?

00:52.200 --> 01:01.860
So in this case we have that KIA, KIA Motor Group manufactured the KIA infotainment console.

01:01.860 --> 01:06.780
So in Europe, Russia, Australia use Linux Automotive OS.

01:06.860 --> 01:11.260
In most of the cases the model G5WB.

01:11.260 --> 01:17.500
In the case of the United States, Canada, Saudi Arabia, India and so on use Android Automotive OS.

01:17.500 --> 01:24.400
But what about the rest of the countries, Latin America, what about the rest of the countries that I don't mention here?

01:24.800 --> 01:31.300
So let's start with a reversing in all the ways KIA infotainment console.

01:31.300 --> 01:37.820
So here we have the victim in this day is this one, okay?

01:38.280 --> 01:41.920
So who has a KIA car?

01:43.000 --> 01:43.960
Nice.

01:43.960 --> 01:46.980
Do you recognize this time of infotainment console?

01:46.980 --> 01:50.860
Maybe it could be the you, so it's vulnerable.

01:50.860 --> 02:00.600
So this is the model, the high unit model, the high unit FCCID you want to check, the software version, the firmware version, okay?

02:01.240 --> 02:14.560
When you disassemble, here we have many components, but principal we have to focus in the system of a chip that is an unknown system of a chip, TMM9200, no data chip, no information about that.

02:14.620 --> 02:28.780
After that we have the microcontroller, the microcontroller is very old, so this board is a trash, it's a shit because it's like built with very many cheapest components.

02:28.780 --> 02:45.060
So after that we have the EEPROM, the safe configuration information, we have also the flash SPI WB25Q128JB that have the firmware, all the firmware, after that we have another flash SPI that have another binary.

02:45.060 --> 02:49.020
But principal these are the principal components.

02:49.020 --> 03:01.200
So the system of a chip communicate with the SPI and also with the EEPROM and the SPI 2 megabytes of 2 megabytes have the factory binary, okay?

03:02.500 --> 03:08.360
In the backside we have the power connector, CAN connector, USB, the antenna and the parking lights.

03:08.680 --> 03:23.160
In the backside also we have a two touch screen controller, the ATMXT449 that is capacitive touch controller, like very similar to the red fingerprints, okay?

03:23.160 --> 03:28.680
Another touch screen controller is the AK4183.

03:28.800 --> 03:35.820
So this infotainment console is supplied to Kyiv by Motrix, okay?

03:36.080 --> 03:39.520
This is the unique information that we have about this system of a chip.

03:39.520 --> 03:41.260
No more information, okay?

03:41.260 --> 03:45.920
I asked for the data sheet to the manufacturer, but now I need responses.

03:46.200 --> 03:55.580
So here we have the system of a chip, manufacturer, the supplier, the old, the head unit and the end, it's Kyiv, it's the vendor.

03:57.160 --> 04:07.400
When we dump the EEPROM we have the software information, universal, unique, identified number, also is printed in the board.

04:08.080 --> 04:19.800
And when we need the communication between the EEPROM and the system of a chip in the boot process we have this kind of information, so there is information in the boot process with the EEPROM about the configuration, software and so on.

04:20.180 --> 04:30.640
After that we dump the SPI WB25 16 and we see that in the boot process we don't have information, okay?

04:30.640 --> 04:38.460
So from the block, a black box we are executing a hardware engineering process to understand what is going on in the boot process.

04:38.680 --> 04:45.820
After that we have the dumping of the firmware because in this flash is the firmware.

04:46.200 --> 04:48.420
All the magic is in this flash.

04:48.580 --> 04:49.220
Okay?

04:49.220 --> 05:03.640
After that we see that in the boot process there are communications, so that means that after the root boot, after the root boot, we have the second stage that is in this flash.

05:03.640 --> 05:08.820
So we are going to check that in a few slides.

05:09.920 --> 05:13.480
So we have communication through SPI.

05:13.480 --> 05:17.220
Remember in AEPROM we have communication I2C.

05:17.220 --> 05:22.420
In the SPI, in this firmware we have communication through SPI communication, okay?

05:22.420 --> 05:29.440
And after that I realize that in the back side of the URL we have a UART access, okay?

05:29.440 --> 05:38.820
So I proceed to soldering and this was very useful for execute a reverse engineering process through the UART locks.

05:39.200 --> 05:40.080
Okay?

05:40.120 --> 05:42.980
Next to that we have the binary parsing.

05:42.980 --> 05:57.040
So this is very interesting because Bingwall lies us in this case because Bingwall told me that this binary is a Q and X boot block and so on.

05:57.040 --> 06:00.520
And also the PNG files are not rendered well.

06:00.520 --> 06:08.800
So Bingwall show me many false positives, 100% false positives.

06:08.800 --> 06:19.500
So the solution was execute a manual extraction looking for the real magic bytes of the PNG, the JPEG files and so on.

06:19.500 --> 06:25.060
So this file is like my SQL copyright is ‑‑ doesn't exist.

06:25.720 --> 06:32.460
So also I realize that the Bluetooth information is saved in this raw binary in plain text.

06:32.460 --> 06:33.420
Very dangerous.

06:33.420 --> 06:37.120
Here we can see the Bluetooth password in plain text.

06:37.120 --> 06:39.340
Also the connections, the contents and so on.

06:39.340 --> 06:41.800
So very dangerous.

06:41.800 --> 06:47.000
So Bingwall told me that, hey, this is a Q and X boot block.

06:47.000 --> 06:48.960
But this is not true.

06:49.760 --> 07:01.240
If you search the code, the source code of the Bingwall you can see that the magic byte of the Q and X is EB109000.

07:01.240 --> 07:03.340
But this is not official information.

07:03.340 --> 07:04.560
This is wrong.

07:04.660 --> 07:07.380
And anyone, everyone choose Bingwall.

07:07.380 --> 07:14.100
But if you search about this issue, it is still open, it is still not verified.

07:14.100 --> 07:18.220
So Bingwall ‑‑ don't use Bingwall.

07:19.120 --> 07:20.480
Okay.

07:21.340 --> 07:24.360
So at this moment Bingwall is in version 3.

07:24.360 --> 07:27.080
It's better than the version 2.

07:27.120 --> 07:29.620
So it's less false positives.

07:30.020 --> 07:43.380
So I reject that because when I disassemble this architecture is ARM thumb in big endian we have the magic byte is not a Q and X.

07:43.380 --> 07:51.680
In this case the magic byte is a part of the branch link exchange instruction in the thumb architecture.

07:51.800 --> 07:52.320
Okay.

07:52.320 --> 07:54.380
So this is a call function.

07:54.380 --> 07:55.160
Okay.

07:55.400 --> 08:00.860
And we can verify that in the same address, 2D6572.

08:00.860 --> 08:01.340
Okay.

08:02.540 --> 08:09.040
So after many reversing process we have here the parts of the Bingwall.

08:09.040 --> 08:13.360
So first of all we have a RAR file that have the recovery, you know, the factory reset.

08:13.360 --> 08:17.440
After that we have another big RAR file that is the premain.

08:17.440 --> 08:18.840
What is the meaning of the premain?

08:18.840 --> 08:21.200
It is the second stage boot loader.

08:21.220 --> 08:33.360
In this case we have the one image that appears in the boot loader process when you power on the unit, you are able to see a key image.

08:33.440 --> 08:40.420
After that you have two key images that are not user, the boot loader binary and more information.

08:40.740 --> 08:44.440
The third part is the 3D RAR file.

08:44.480 --> 08:45.000
Okay.

08:45.000 --> 09:00.140
So in this case we have the kernel, the file system and also here we have the certificates, the boot loader , the private key, the public key, one PNG file and three more RAR files as you can see.

09:00.140 --> 09:02.840
That is part of this big binary.

09:03.220 --> 09:09.560
After that you have the Bingwall and software information in a very short part of the Bingwall.

09:09.560 --> 09:12.260
And after that, very dangerous, the Bluetooth data in plain text.

09:12.260 --> 09:14.760
Bluetooth connection, Bluetooth password, Bluetooth name.

09:14.840 --> 09:19.680
And after that if you pay attention here we have 882 PNG files.

09:19.820 --> 09:20.360
Okay.

09:20.360 --> 09:33.640
So all the displays, all the images that you see in the display, all these images are PNG files that are loaded from the firmware in the boot process.

09:33.640 --> 09:35.680
All these images.

09:35.680 --> 09:38.520
The home, the seats, everyone.

09:38.520 --> 09:52.660
They are all ‑‑ so after I get all the images as you can see, okay, so let's start to analyze this real‑time operating system.

09:52.840 --> 10:00.400
As you can see here we have 110 tasks identified at the moment, identified at the moment as you can see.

10:00.560 --> 10:16.440
So remember the main real‑time operating system is the function that run a loop, you know, so after the boot process, after the system and application init, initialization application and system in for hardware verification process integrity and so on,

10:16.440 --> 10:23.140
we enter in a main application task that is the brain of this real‑time operating system, okay?

10:23.600 --> 10:35.300
So yeah, as you can see, we have here set application state, initialization hardware drivers, initialization of the services systems and so on.

10:35.300 --> 10:52.960
And here we have the loop that manage, you know, the log status, the process events, the handlers and create the event, dispatch, the state transition, ensuring the system remains operational and responsible to events or commands.

10:54.120 --> 11:03.020
We have here many PNG functions, a lot of PNG functions live, around 100 functions just with PNG functions.

11:03.020 --> 11:15.020
Anyway, all these functions are renamed by me because in the thing where we don't have variable names, function names, so I invented these names of the functions also.

11:15.020 --> 11:20.260
So it's interesting here because many functions are regarding to the live PNG library detection.

11:20.260 --> 11:41.280
Remember, live PNG library is the library that allow us execute the PNG process to the verification, the checksum verification in the each header, you know, the header, the data, the chunk data and the EN all have CRC verification process, okay?

11:41.280 --> 11:47.300
So here we have many, many, many functions regarding to this library.

11:48.340 --> 11:50.260
More functions about PNG.

11:50.360 --> 11:59.760
So after that, if you visit the page of the manufacturer of the system or chip, you can see.

11:59.940 --> 12:02.420
Remember, here I have two options.

12:02.420 --> 12:11.840
Android Automotive OS, Linux Automotive OS and the tier that it is right now is show it is IRTOS.

12:12.100 --> 12:23.840
So here you can verify the name IRTOS because in the binary there are strings about the path or where is the, you know, the files.

12:23.840 --> 12:27.260
So here we have IRTOS, IRTOS solution, IRTOS.

12:27.260 --> 12:31.020
So the name of this real time operating system is IRTOS.

12:31.400 --> 12:39.920
This is all the technical information about that, you know, ARM, Cortex A9 is developing in C, libraries.

12:40.180 --> 12:46.420
At the moment there are vulnerabilities like the Bluetooth is implanting things in the URL loads.

12:46.420 --> 12:48.720
There are two private keys recovered from the firmware.

12:50.000 --> 12:56.680
Many things because we have like our own three private keys and four public keys.

12:57.400 --> 13:09.060
The real time operating system use vulnerabilities like metric SSL that has CBEs, also like PNG version have more CBEs.

13:09.060 --> 13:12.560
So let's start test the boot loader process, okay?

13:12.560 --> 13:16.700
So to do that remember that in the firmware we have many RAR files.

13:16.700 --> 13:21.400
In this case the RAR files are compressed with version 4.

13:21.400 --> 13:24.260
So that's the reason that I don't change anything.

13:24.260 --> 13:46.180
I just take the binary of the second boot stage process, see, second boot loader stage, and I just compress with RAR version 4 and I patch the firmware with this new compress to check if there are integrity process in the boot load process, okay?

13:46.720 --> 13:50.780
So as you can see, the system don't boot.

13:51.560 --> 13:56.280
It appears a white image, okay?

13:56.280 --> 13:57.360
But don't give up.

13:57.360 --> 13:59.020
Let's continue testing more.

13:59.120 --> 14:01.520
So, you know, remember, power die.

14:01.520 --> 14:02.840
I don't want to die.

14:03.320 --> 14:06.100
So at this moment the room board is okay.

14:06.100 --> 14:12.440
As you can see, the first stage boot loader, the signature, the crypto key is perfect as I was testing.

14:12.560 --> 14:15.700
So let's test the second stage boot loader, okay?

14:15.780 --> 14:26.000
Because remember, the pre‑main binary is the second stage boot loader that loads the entire main binary that is the real time operating system.

14:26.000 --> 14:30.060
And after that you can use the hard unit.

14:30.300 --> 15:01.760
So as you can see, I realize that there are no integrity in the 882 PNG files because we have a secure boot loader in the room board, the second boot loader also has integrity check process also in the main real time operating system and the beginning of the main function of the real time operating system also there are integrity verification.

15:01.760 --> 15:13.240
But when the PNG functions are loaded from the firmware to the ROM in the system of the chip, there is no integrity verification process.

15:13.240 --> 15:23.880
So it's like we have here a bridge, a secure boot loader and after that the 882 PNG files without verification integrity.

15:23.880 --> 15:30.100
So you can verify this in the pre‑main and also in the main function, okay?

15:30.100 --> 15:40.640
So here we have the init system and boot loader, the initialization boot loader system function, the flash detection function loop, the detect flash device as you can see.

15:42.670 --> 15:52.220
So here we have the second stage boot loader and here we have the part where the ‑‑ okay?

15:52.340 --> 15:59.900
So also in the ‑‑ remember in the main function of the real time operating system we have here.

15:59.900 --> 16:17.760
Our information through your logs, flash detection, memory uses logs and here we have also the plane of the main task of the real time operating system where the file system is mounted and in this part is where all the PNG files are loaded, okay?

16:17.760 --> 16:26.280
And basically after that we have more functions, more talks, but this is the main.

16:26.280 --> 16:28.540
The main application task.

16:28.540 --> 16:30.680
So let's go to check.

16:30.680 --> 16:40.000
So this is ‑‑ in here we have the vulnerability because in this line it appears the file system mounting process, okay?

16:40.000 --> 16:41.900
But what is going on here?

16:41.900 --> 16:52.060
The application, you know, the UI daemon execute a file open cause to the operating system.

16:52.060 --> 17:06.520
So basically the operating system reads the raw PNG bytes from flash into the main memory via the system which is memory controller and boot fabric and after that this is ‑‑ passes to the leaf PNG function, okay?

17:06.520 --> 17:21.400
So basically the leaf PNG library just pass the headers, execute verification process into the image, they compress the EDAT channels and produce a compressor RGBA buffer in RAM.

17:21.400 --> 17:23.640
But what is going here?

17:23.640 --> 17:39.480
Leaf PNG checks don't are useful if you don't ‑‑ if you don't ‑‑ if you don't execute integrity verification process of the hash of the entire image, basically leaf PNG checks don't are useful, okay?

17:39.480 --> 17:59.960
So that's the reason that right now we have here the most elaborated QR phishing in the automotive world because basically I infected this was the hello world for this vulnerability so I changed this with this image with the world hack and here we have hack world.

17:59.960 --> 18:06.180
When I realized that was, hey, this is danger and the boot process don't detect this change.

18:06.180 --> 18:12.600
So I can change whatever image that I want, defacement, execute defacement and so on.

18:12.600 --> 18:15.100
So you are thinking that it's possible.

18:15.640 --> 18:17.180
Absolutely, yes.

18:17.180 --> 18:20.900
But at the moment I am going to show the QR.

18:20.900 --> 18:24.560
So QR phishing attack through parking tickets, no.

18:24.560 --> 18:28.540
Let's go to execute a very sophisticated QR attack.

18:28.540 --> 18:43.920
So in this case, after many attempts and after many reversing process I realized that to execute these back door requirements we need that the fake image would be the same size as the original image.

18:43.920 --> 18:58.560
If the fake image is smaller than the original, the image will not render if it is compressed so the image has to be all the metadata, all the PNG headers because it is verified by the, remember, leaf PNG library.

18:58.820 --> 19:03.480
So it is possible to replace any image as long the same offset is maintained in the firmware.

19:03.480 --> 19:11.120
So you achieve this retype, you are able to execute, inject whatever image.

19:11.120 --> 19:18.200
In this case, this is the official QR that redirects to the KIA web user manual as you can see.

19:18.360 --> 19:29.960
But I created the image with Inkscape that completes all the requirements, you know, the same size, the same pixels and so on.

19:29.980 --> 19:36.920
And after that I create this tool that I will publish right now after I finish my conference I will publish this.

19:38.020 --> 19:43.820
So I create a phishing web page.

19:43.960 --> 19:44.260
Okay.

19:44.260 --> 19:46.180
As you can see, it's very similar.

19:46.280 --> 19:54.300
I just added the download button to download a malware application for the Android phones.

19:54.300 --> 20:00.840
So you can see in this case the malware is an official KIA app infected with a bug there with our Android detection.

20:00.840 --> 20:04.920
So as you can see, my KIA app installed it was correctly.

20:04.940 --> 20:09.120
So when you open, basically I have access to the phone.

20:09.300 --> 20:18.660
What are the ways to infect that is through USB and also with hardware hacking, executing a flash, flashing the malicious firmware.

20:18.660 --> 20:19.340
Okay.

20:19.580 --> 20:25.400
For finish, let me show you the demo.

20:28.780 --> 20:33.300
I need to scan the QR because in the QR I have the manual.

20:33.300 --> 20:34.880
I have everything about the car.

20:34.880 --> 20:35.700
This is a new car.

20:35.700 --> 20:37.980
So I'm going to scan the QR.

20:38.140 --> 20:39.000
Where's the QR?

20:39.000 --> 20:44.440
It's in the hard unit in the setup system and manual.

20:44.460 --> 20:46.600
As you can see, here we have the QR.

20:46.600 --> 20:50.780
I'm going to scan but what is going on?

20:50.780 --> 21:00.020
As you can see, this redirects to a new official KIA web page because this is not a manual KIA web page.

21:00.020 --> 21:02.860
As you can see, the domain is driversout.com.

21:02.860 --> 21:06.220
This is set up in my own web page.

21:06.480 --> 21:13.160
But as you can see, it's very real KIA.

21:14.240 --> 21:15.420
I don't know.

21:15.760 --> 21:18.640
Maybe here, start and so on.

21:19.100 --> 21:21.120
Setup and so on.

21:21.360 --> 21:24.300
So hey, what I have here?

21:24.300 --> 21:27.720
I have here download KIA official app.

21:27.720 --> 21:29.200
Let's go to download.

21:29.780 --> 21:32.180
I already downloaded it previously.

21:38.140 --> 21:44.100
So here is .99 megabytes and so on.

21:44.100 --> 21:48.760
But anyway, I'm going to stop because the application is this one, kia.apk.

21:48.760 --> 21:59.200
This is a malicious application that if I install more details, it started scanning.

22:00.080 --> 22:01.900
App is started.

22:02.040 --> 22:02.800
Okay?

22:03.340 --> 22:14.300
So before open, at this moment, I'm going to this is the big thing here.

22:14.300 --> 22:16.200
I have the interpreter.

22:16.200 --> 22:23.120
So this is the C2 where I am able to get the connection on the Android cell phone.

22:24.040 --> 22:25.200
Okay.

22:26.280 --> 22:28.720
Let's go.

22:29.000 --> 22:31.760
I'm going to open the application

22:35.250 --> 22:40.250
and immediately I have drivers out.

22:40.590 --> 22:43.450
As you can see, I have access to the form.

22:43.450 --> 22:44.850
So let me show you.

22:45.590 --> 22:48.690
Android 14.

22:48.990 --> 22:52.470
And I'm going to put, for example, get your ID.

22:52.530 --> 22:56.910
I'm going to dump the SMS, for example.

22:59.210 --> 23:03.490
So basically I have access to the cell phone.

23:03.490 --> 23:06.670
I will show the results.

23:06.810 --> 23:09.130
So here we have.

23:11.350 --> 23:22.970
So I was able to get access to the cell phone to, you know, have a location, contacts and CMS is down, recording the microphone.

23:22.970 --> 23:25.010
This is very dangerous.

23:25.290 --> 23:25.970
Yeah.

23:25.970 --> 23:30.870
At the moment, this is, kia will create a CBE about that.

23:32.790 --> 23:33.830
Yeah.

23:34.470 --> 23:36.670
But it's the moment, it's a zero day.

23:36.670 --> 23:40.330
Because kia will not patch that.

23:40.330 --> 23:40.970
Okay?

23:40.970 --> 23:43.830
So that's the reason that I decided to show it in this conference.

23:43.830 --> 23:44.810
Thank you so much.

