00:00:00.000,00:00:09.309 >>Alright I’m gonna hand it over to your speakers please give them a warm welcome. [applause] 00:00:09.309,00:00:16.884 >>Uh hello. Uh today’s talk, How the 4G Module Could Be Hacked. And uh here is our team and uh 00:00:16.884,00:00:29.930 we are from the Baidu security lab. I’m Shupeng. >>I’m Huang Zheng. >>Uh ok. Uh uh let’s 00:00:29.930,00:00:36.370 introduce first. Uh here’s the agenda of today’s talk. First of all we will introduce the 00:00:36.370,00:00:42.175 fundamentals of the 4G module. Secondly we will introduce the new attack surface of the 4G 00:00:42.175,00:00:47.481 module. Thirdly we discuss what needs to be done in order to carry out the other surface 00:00:47.481,00:00:54.221 attack for example obtain the firmware, get some shell and so on. Fourthly we will uh talk 00:00:54.221,00:00:59.927 about some various ways to discover the 1 pin test. And last we will provide some best 00:00:59.927,00:01:08.035 defense practice based on experience. Ok uh this uh picture show- show you more than 00:01:08.035,00:01:15.709 50 v- various 4G modules and the USBs we have studied. Uh the 2 just about uh some 4g routing 00:01:15.709,00:01:21.782 device and uh some we call 5G devices. Yes, many vulnerabilities of the 4g module 00:01:21.782,00:01:30.090 uh we mention today uh also use it on 5G. Uh in the middle there are some card deposit and some 00:01:30.090,00:01:36.763 puzz ball wifi devices. Uh down the bottom uh there are all kinds of open or 4G modules. 00:01:36.763,00:01:45.072 About 30 of them. Uh most of them are PCE interface and as they say packages. So uh what we 00:01:45.072,00:01:51.445 have found we have found several general vulnerabilities or uh different uh baseband chips, and 00:01:51.445,00:01:59.987 the uh risk in several V2X 5G modules and RCE- RCE in more than 5 cars’ T-Box and uh uh 00:01:59.987,00:02:07.260 vulnerabilities in uh all parts of the 4G modules. Uh because vulnerabilities repair it’s a 00:02:07.260,00:02:14.267 long process uh so we just show- uh just to show you the 1 bit test which will fixed uh- in 00:02:14.267,00:02:22.943 this lab. Ok uh why did we do these studies? First of all we found that not man- uh not many 00:02:22.943,00:02:28.315 people have done relevant research in this direction before. And uh no one is aware 00:02:28.315,00:02:34.521 of the security problem and the wide impact of the 4G module. So we want to shed a light on more 00:02:34.521,00:02:41.228 uh directions of security research for example, uh cars now have uh networking traffic- 00:02:41.228,00:02:47.401 uh networking functions. But uh uh it seems that no one has attacked the T-box uh it’s 00:02:47.401,00:02:53.607 called- sometimes it’s called TCU. Uh there are also security issue with uh baseband. Baseband 00:02:53.607,00:03:00.380 security is usually important, such as you’re like how the baseband security on Qualcomm 00:03:00.380,00:03:05.952 and the same stuff. In fact there are many other baseband uh chips such as uh intel, 00:03:05.952,00:03:13.260 [inaudible], MTK, uh Marvel, bluffs and the so on. And compared with mobile phones it’s 00:03:13.260,00:03:19.833 easier to analyze through the 4G module. Uh we will also introduce some new and effect- 00:03:19.833,00:03:26.840 effectual attack interface and methods. In short the goal of the threat is not only to ensure 00:03:26.840,00:03:33.113 there’s some threshold on the base of the 4G module but also to provide you with some new 00:03:33.113,00:03:41.188 ideas methods for SS attacks. Ok we can see the 4G module everywhere. IoT devices could 00:03:41.188,00:03:47.794 connect to the internet so uh 4g driver- um modules. For example we can control a car remotely by 00:03:47.794,00:03:53.533 the APP. It seems the communication system of a car, it’s on like all the time. Maybe 00:03:53.533,00:03:59.706 some process is table shed and lemon test are long long yen to the connection. Uh there are 00:03:59.706,00:04:06.513 other devices such as like 4G WiFi, 4G routers, TK’s vending machine, uh our laptop and then 00:04:06.513,00:04:14.387 some instructional uh devices, even the slot machine in Las Vegas. Uh there are- there are 00:04:14.387,00:04:21.161 many things interface. Uh interfaces in fact the internal structure is the same, we will 00:04:21.161,00:04:28.435 see later. Uh on the left is the circuit board dress of the vending machine. Uh we can see a 00:04:28.435,00:04:35.809 module with many pieces of interface plaid here in the red. Uh there is act- actually a AM 00:04:35.809,00:04:43.617 processor motherboard uh running Linux on Android system. On the right uh is a Tesla model 3 uh 00:04:43.617,00:04:50.157 4g module. Uh which implements uh navigation, mobile remote control system, upgrade, and 00:04:50.157,00:04:57.731 other functions. Uh the module is uh attached directly to the motherboard. Uh in this slide on 00:04:57.731,00:05:05.405 the left is the industrial 4G router. Uh we can this uh mini PCI-E interface module on the 00:05:05.405,00:05:13.113 motherboard. In fact it’s a common router as this- allows to implement the function we 00:05:13.113,00:05:18.451 [inaudible] assess. Uh the device on the right is a bit special. It’s a powerful wifi 00:05:18.451,00:05:24.891 device but it doesn’t have several of the 4g module. It uses CTE’s echo chipset. In 00:05:24.891,00:05:31.965 fact, it's also a 4g module, the chip in the module is uh attached to the PCI-E valve, 00:05:31.965,00:05:37.504 which uh implement-uh implements manual key driving wifi, run your RTP source, and other 00:05:37.504,00:05:43.944 functions. Uh there are many other devices that [inaudible] in this way, such as uh some 00:05:43.944,00:05:52.619 local safari router. Uh let’s look how the structure of the 4g module. In fact, uh the 4g 00:05:52.619,00:05:59.893 module is a company’s uh computer system, ARM CPU and the baseband system are integrated 00:05:59.893,00:06:05.532 in the main control chip. They all use uh anti flash which has a large shortage of space? and 00:06:05.532,00:06:12.172 the locals. And uh they are ooh uh they are other chips such as power management, uh radio 00:06:12.172,00:06:18.311 frequency chip, and the so on. Uh let’s look at the software. Um most of the 4g module uh 00:06:18.311,00:06:27.787 embedded Linux system and a few RTOS systems. Uh ok this is a picture of the internal uh 00:06:27.787,00:06:36.296 intuct- uh uh instructions of the Qualcomm EC20 module with- with uh top of shade remote. Uh 00:06:36.296,00:06:44.537 the memory chip is an NAND flash plug uh TRIM memory which is integrated into a chip. Uh but 00:06:44.537,00:06:52.545 looking at the module the flash is uh BGA 162 point. Uh if we are- we want to read or modify 00:06:52.545,00:07:01.821 the data inside, we need to pair the con- the chip socket. Uh so how do the module work and how 00:07:01.821,00:07:08.461 should they be used? We can see that the upper left corner is the OS system module. It builds 00:07:08.461,00:07:16.002 a minimal system for you too, includes you know power, uh supply, a sim card, UI 00:07:16.002,00:07:22.942 interface, yes? How do you ask- communicate with the 4g module? Use a USB cable. First, we need 00:07:22.942,00:07:30.717 to install the corresponding drivers in the operating system. Uh when the module is pliant uh 00:07:30.717,00:07:36.723 the operating system loads the corresponding driver uh according to VID, PID, and the 00:07:36.723,00:07:44.097 interface number. Uh then the system uh generates a network card and gives uh the cor- 00:07:44.097,00:07:51.338 corresponding IP address. Then this has the internet. Uh the 4g module will respond to multiple 00:07:51.338,00:07:58.578 connection modes and each mode has different k- kernel module or drivers. Uh for example, uh 00:07:58.578,00:08:05.752 the upper part of the slide shows the PPP and RMNET modes. Uh when the tunnel is successful 00:08:05.752,00:08:11.891 the device will get a IP address from operator just like the IoT device directly gives your 00:08:11.891,00:08:18.398 public IP address. Here uh the uh one zero network system is also considered a public network 00:08:18.398,00:08:25.972 address. Another way for example in RNDIS or EISM modes, the 4g module usually has 2 network 00:08:25.972,00:08:32.212 cards, uh when they are forced to get the public address from the operator, and the other 00:08:32.212,00:08:40.387 network card is connected to the IoT device. Using one and two network systems. It uh looks 00:08:40.387,00:08:46.893 like the 4g module became the router and the IoT device was sent through this router. This 00:08:46.893,00:08:55.602 second path is the path we can assess. Ok RNDIS on the ECM mode because this- uh these 2 modes 00:08:55.602,00:09:01.274 don’t require additional drivers. Uh but we are recommending to us so now most 00:09:01.274,00:09:10.083 uh most of the 4g modules are u- using the modules. Uh using this mode uh the T box in the car is 00:09:10.083,00:09:15.722 uh this way. So you see the security of the 4g module has turned into the security of the 00:09:15.722,00:09:23.329 linux system uh as followed in the network. Uh let’s go into some new attacks- attack 00:09:23.329,00:09:31.137 surface. As we stated earlier that uh m- most of these 4g modules have higher impact in 00:09:31.137,00:09:40.380 their system. So whether their operating system uh manages and such as supporting 2, 3, 4g 00:09:40.380,00:09:46.619 which requires a computing result and for example, automobile manufacturers often 00:09:46.619,00:09:52.959 need to run their own program in T-box to achieve remote control and other functions which 00:09:52.959,00:10:01.201 requires- uh require modules with secondary development. Uh now let’s uh analyze the attack 00:10:01.201,00:10:08.441 surface of the 4g module. As we said, just now, other kinds of 4g modules have a complete linux 00:10:08.441,00:10:14.714 sys- eh- linux operating system. At the same time we found that most the modules now use RNDIS 00:10:14.714,00:10:21.621 or ECM mo- networking modes. It’s- it means that the module will be a send a separate IP 00:10:21.621,00:10:27.560 address. This provides a challenge for attack. Linux operating system also has some 00:10:27.560,00:10:36.002 listening ports, or uh connects to the car for OTA updates or remote management. Uh now it has 00:10:36.002,00:10:43.977 a seperate IP. Uh we can directly access the- this path uh intercept its IP link and do 00:10:43.977,00:10:52.552 some MITM attack and so on. So now the the the the attack is uh essentially the test to analyze 00:10:52.552,00:11:00.026 the outer systems- system security. Uh when the Linux host uh is exposed to the internet or 00:11:00.026,00:11:07.300 intranet. Uh but wait it seems like we can’t utilize the- the separate IP unless in the same 00:11:07.300,00:11:15.708 lot slash uh wifi hotspot. Uh let’s talk about s- some more intended attack surfaces. Uh the 00:11:15.708,00:11:21.814 4g module is a wireless cellular device connected to the operator’s network. But some 00:11:21.814,00:11:29.088 operators due to uh configuration errors don’t have network isolation so clients can 00:11:29.088,00:11:38.398 access IPO, ISH, uh or- or other devices. And other 4g modules support 2g GSM mode uh because 00:11:38.398,00:11:44.304 of the security problem with oh- GSM it can use a fake base station to monitor and modify 00:11:44.304,00:11:52.579 traffic. Uh also it can alter IP links in the set path. And there are also many sur paths, uh 00:11:52.579,00:12:00.887 service, and ID to the module. Such as the car control service. Uh now let’s list some uh attack 00:12:00.887,00:12:07.594 ideas. First of all we need to collect enough information and [inaudible] vulnerabilities show 00:12:07.594,00:12:16.336 uh under epolites so when vulnerabilities will get shell firmware, analyze network, 00:12:16.336,00:12:23.910 internet- uh network traffic on this and so on. Uh there may be lots of rewards engineers will 00:12:23.910,00:12:32.251 hear um on the process of virus that’s an impulse. Then maybe we can see there how to run uh our 00:12:32.251,00:12:38.725 attack or the code and uh we introduce the uh traditional methods. Uh many in that network 00:12:38.725,00:12:46.432 such as wifi hotspots and uh uh to assess the- the path of the 4g module to attack. And the the 00:12:46.432,00:12:53.539 new attack method we can use the incorrect configuration of the operator network to transform 00:12:53.539,00:12:59.746 the local LAN attacks into a very wide rendered remote online attacks, which can generally 00:12:59.746,00:13:07.920 increase the scope of the attacks. Uh in addition because of 4g’s because of 4g spots uh 00:13:07.920,00:13:15.995 we can- we have a way of- a way to fully control the IP link of the nearby 4g module. We can 00:13:15.995,00:13:24.303 directly- directly assess its path and direct our attack to code. With these attacking ideas 00:13:24.303,00:13:31.411 it seems very easy to attack the 4g module. Uh let’s first talk about using fake base station to 00:13:31.411,00:13:39.852 attack. Uh because clients can’t identify whether the base station uh uh is real or not in 00:13:39.852,00:13:47.527 GSM mode- network, we can build a fake base station system to attack and control traffic. Uh 00:13:47.527,00:13:53.666 interestingly this attack is ef- effective for all- all 4g modules and the- the problem 00:13:53.666,00:14:00.940 will uh proceed for a long time regardless of whether the operator shuts down the 2g base 00:14:00.940,00:14:08.014 station or not. It’s not too difficult to build a fake base station but previous people uh 00:14:08.014,00:14:15.121 have not solved the problem of auto attachment. If it doesn't attach uh automatically uh 00:14:15.121,00:14:22.862 client need to select to the fake base station manually. Uh inspired by Pseudo Base Station 00:14:22.862,00:14:30.603 in China, we can improve the C2 uh parameters in GSM or broadcasting channel, and the 00:14:30.603,00:14:36.375 client will automatically connect to our fake base station. Uh C2 is the cell 00:14:36.375,00:14:43.950 reselection for REM2 uh the larger the value the more client tends to connect to the base 00:14:43.950,00:14:53.993 station. Uh we can build uh our fake base station via a software radio such as the BladeRF and uh 00:14:53.993,00:15:01.601 YateBTS system. But we needed to change uh the value of C2. This parameter is not set into 00:15:01.601,00:15:10.543 YateBTS. So let’s hardcode it uh in the source code. Uh set it to maximum and uh recompile it. 00:15:10.543,00:15:19.118 Here we need to remind you that uh it’s illegal to build a fake base station although this 00:15:19.118,00:15:24.423 attack is very ef- effective we can tell you to use a shield box as shown in the figure on the 00:15:24.423,00:15:32.865 right. In order to force the downgrade of the 4g module to 2g, you need to be able to 00:15:32.865,00:15:39.572 interfere with a sort of uh radio incrementer such as sending some, uh white noise 00:15:39.572,00:15:45.978 interference in the current uh 3g and the 4g path. Uh this is also illegal, you just need to 00:15:45.978,00:15:52.885 know that uh this method is effective. Finally the 4g module automatically attach to our fake 00:15:52.885,00:16:00.159 base station, like the lower part. Uh the lower red- uh red figure shows that the C2 value 00:16:00.159,00:16:07.967 is already very high, usually around 70. So it can now fully control the IP link, monitor the 00:16:07.967,00:16:15.708 IP data transmission, access the port, run our exploit, and modify the data. The most common 00:16:15.708,00:16:24.617 approach used is to assess the path such as SSH and other service. Let’s talk about uh uh 00:16:24.617,00:16:31.123 attacks through the operator’s intranet. Alright we have just implemented IP links to assess 00:16:31.123,00:16:39.265 nearby devices, but is there a way to attack remotely? Uh most uh operators uh assign uh uh 00:16:39.265,00:16:47.373 assign uh 1, 0 also 1 7 2 network uh system to uh system to address uh to client. But 00:16:47.373,00:16:54.547 many of them don’t have a network uh isolation. So uh such as China unicom and uh China 00:16:54.547,00:17:01.721 telecom. At the same time most 4g module don’t have a firewall enabled. This means that we can 00:17:01.721,00:17:08.861 directly assess the part uh or other class or other paths again. The picture on the right 00:17:08.861,00:17:15.968 is the result of scanning open path on ADB and telnet stories on the uh intranetwork of the 00:17:15.968,00:17:24.710 operator. You can tell that many clients have the the path open. Uh more interestingly we can 00:17:24.710,00:17:31.884 measure a wide range- wide range of attacks through private uh private- private APN. Private 00:17:31.884,00:17:39.158 APN is uh attack uh technology that clients connect to their intranet server directly so 00:17:39.158,00:17:45.831 operators tunnel that, just like the VPN connection, client and the server are communicating 00:17:45.831,00:17:53.572 with each other on some well known equipment. Special SIM card and APN side point are 00:17:53.572,00:17:59.912 required. This kind of connection is widely adopted by most car comand- uh most car 00:17:59.912,00:18:07.486 companies and uh are commonly s- seen among well known IoT equipments such as China’s 00:18:07.486,00:18:15.928 YouPow vending machine. And uh uh all cars in this uh intranet are equipped with the same type, 00:18:15.928,00:18:22.668 are made by the same company. So we can move forward with this in such device that lends to 00:18:22.668,00:18:32.878 multiple attempts, as a result we gain full control of these devices. So how can we guess the 00:18:32.878,00:18:40.186 configuration of the APN or set point? For example, so for my uh- from our analysis and our 00:18:40.186,00:18:46.959 log analysis and how to connect to the- hack into a private APN network, uh we can detach the 00:18:46.959,00:18:55.001 e-SIM chip on the motherboard and uh attach it back to our 4g module. And uh use uh AT command 00:18:55.001,00:19:02.975 to configure uh the correct APN or set point. So now we can connect to the manufacturer’s 00:19:02.975,00:19:12.518 private APN network and start the parser again and hack. Uh I just introduced some new attack 00:19:12.518,00:19:19.158 surfaces, let’s implement the attack, the pre- attack preparation work. To get ready 00:19:19.158,00:19:26.232 for a successful attack, you need to complete some- at least 1 of the following. Get some 00:19:26.232,00:19:32.405 firmware, get some shell, or obtain network traffic. In general guys getting the shell 00:19:32.405,00:19:39.578 is the most beneficial out of getting the shell it’s easier to get firmware on the net update 00:19:39.578,00:19:44.483 but sometimes it’s uh not uh always possible to get the shell. Uh let’s take a closer 00:19:44.483,00:19:52.224 look at how to achieve it. First uh uh I will introduce several methods for obtaining firmware. 00:19:52.224,00:20:00.166 If this method- uh if this method don’t work, there is an alternate method, an NAND flash 00:20:00.166,00:20:08.941 dump. Uh we can get firmware fr- by downloading- uh by downloading the firmware updater 00:20:08.941,00:20:15.347 program from the official website and uh unpacking it. This figure shows the firmware 00:20:15.347,00:20:23.355 update software program of a well known 4g wifi device. Uh we easily get the Linux system 00:20:23.355,00:20:34.033 part- uh partition um instead of uh unpacking the dot exe file with a pin block. Uh the 00:20:34.033,00:20:40.139 firmware can be obtained through the manufacturer’s update- upgrade tools. Uh most of 00:20:40.139,00:20:47.446 manufacturers have provided the upgrade tools to the developers. For example, Qualcomm [coughs] 00:20:47.446,00:20:54.253 Qualcomm's uh module has uh 9008 recover mode which is a s- a side by a short circuit some 00:20:54.253,00:21:02.228 solder points. We can guess the up to data tooth from the vendor tears apart uh which contains 00:21:02.228,00:21:12.338 the initialization test for all uh partitions. We can see uh that the tool contains the 00:21:12.338,00:21:20.412 initial we made on our partition. We needed to focus- focus uh on system dot IMG. This 00:21:20.412,00:21:28.320 file used the UBIFS file system it can use the UBI reader to- to successfully extract the file 00:21:28.320,00:21:37.563 format and get the final Linux file system. If we can’t get uh upgraded tools there is uh an 00:21:37.563,00:21:46.739 alternate solution. NAND flash dump, NAND flash dump uh is more complex to read and uh modifies 00:21:46.739,00:21:55.014 like EMI say flash. Uh the lower right common chip is a common PG 6 3 chip it’s very small and it 00:21:55.014,00:22:04.924 needs special NANAD program to read and write. After dumping the uh uh after dumping the chip 00:22:04.924,00:22:16.635 we can use a binwalk to identify the file system. Uh let’s introduce how to get the shell. 00:22:16.635,00:22:22.741 Uh. Where do we get the shell? If we can get the shell, it may- it will be more convenient for 00:22:22.741,00:22:29.715 us to real process field networks and then debug all of our- our programs. It’s very 00:22:29.715,00:22:36.622 intriguing that many 4g modules use a common password, oelinux123. And then eh 00:22:36.622,00:22:43.529 sometimes passwords may not be required. In addition to serial ports you can also use some 00:22:43.529,00:22:50.069 remote management tools such as ADB, telnet, SSH, and so on. Uh these services can be obtained 00:22:50.069,00:22:59.345 uh by parser scanning. Other methods such as getting shell from AT command. After the 00:22:59.345,00:23:06.652 module is connected, the USB interface will be uh virtualized with several serial ports such 00:23:06.652,00:23:16.028 as dev TTYUB0. So which AT command can be sent? According to the manual, we can send an AT 00:23:16.028,00:23:23.535 command to open the ADB service uh or some module could uh have cured system commands through 00:23:23.535,00:23:31.610 sending an AT command. If now this works basically you have uh [inaudible] to uh modify NAND 00:23:31.610,00:23:39.551 flash and a telnet process to the start of the scrape and then re-attach the NAND flash pack. 00:23:39.551,00:23:49.762 Let’s look at uh- let’s look at how to gather manual traffic. We can build a 4g base station 00:23:49.762,00:23:56.101 system uh where is a 4g base station. Because it’s used for the search. Uh compared with a 00:23:56.101,00:24:02.942 2g base station building 4g will be more stable coming in and fast. As you can see in the 00:24:02.942,00:24:10.149 figure on the right, our work can automatically connect to the 4g base station and gets the IP 00:24:10.149,00:24:18.090 address. We can use version to monitor the traffic. We use the srsLTE 4g base station system in 00:24:18.090,00:24:25.097 this method, which is much more convenient uh uh installation than OEI. FInally we need to 00:24:25.097,00:24:34.740 write a sim card. We need to buy a writeable SIM card and a reader. Uh not uh less uh no 00:24:34.740,00:24:43.248 size less than card are only used for- for security testing, not for other illegal things. We 00:24:43.248,00:24:51.991 needed to write the correct IMSI KI OP to the SIM card to ensure that uh this parameter uh the 00:24:51.991,00:24:58.931 same as those in the srsLTE. Finally we start our 4g base station and uh it works 00:24:58.931,00:25:05.938 perfectly. In fact no matter whether it’s a 2g base station or 4g base station, it contains 00:25:05.938,00:25:14.546 a large number of configuration attempts. Uh time solution time relations in this talk we only 00:25:14.546,00:25:22.821 can learn the most important to you. Now let’s have our recap uh what information can we gather 00:25:22.821,00:25:29.628 from this uh preparation. Uh most likely uh the shell will be captured, then the firmware 00:25:29.628,00:25:36.001 system and the network traffic will certainly be captured. These are essential for the full 00:25:36.001,00:25:54.686 vulnerability menu. Ok. >>Ok Shupeng just talked alot about attack surface and preparation 00:25:54.686,00:26:01.026 for attacking 4g modules. Now let me show the critical vulnerabilities we found in 00:26:01.026,00:26:09.101 detail. Uh let’s focus on system management service uh vulnerabilities first. Usually, 00:26:09.101,00:26:16.542 4g modules uh runs Linux systems. Uh Linux systems probably uh stopped many remote 00:26:16.542,00:26:24.483 management so as- so as is- uh such as SSH, telnet, and the web server. We can use fast skin 00:26:24.483,00:26:32.291 tools- uh fast- faster skin tools uh like uh mass scan uh which can scan the port opening 00:26:32.291,00:26:43.068 status in just a few minutes. Uh for example uh we found uh a 4g module are open port 23 uh which 00:26:43.068,00:26:50.642 means the telnet device is started. Uh in most cases, uh telnet uh need password to log 00:26:50.642,00:26:58.250 in. Uh we can extract the ATC password file from the firmware and then crack it by using 00:26:58.250,00:27:07.960 hashcat tools. And if you are rich, uh you can buy a lot of GPU to speed up the crack. Uh 4g 00:27:07.960,00:27:15.534 modules uh generally are not using 1 machine, 1 secret key, or 1 secret password. Uh 00:27:15.534,00:27:22.441 strategy. So if you successfully cracked the password uh which means that you have just cracked 00:27:22.441,00:27:29.248 the password of all 4g modules of this manufacturer. Uh once we get the password, uh we can 00:27:29.248,00:27:35.187 successfully login to the file system uh login to the system remotely and this device is 00:27:35.187,00:27:43.795 ours. Uh in addition uh we find that many well known manufacturers of 4g modules have 00:27:43.795,00:27:52.504 open remote ADB devices by default. Uh we only list uh some of them in this table, uh in 00:27:52.504,00:28:01.647 fact some manufacturers, uh some automobile uh manufacturers uh when it course. Also open remote 00:28:01.647,00:28:09.154 ADBs devices by default. What’s the consequence of this? Uh we can simply use ADB tool to 00:28:09.154,00:28:20.532 connect to port 5 5 5 5 of this module and in most cases, uh without authentication, uh we 00:28:20.532,00:28:27.706 can get the shell remotely. So we can hack it. And there are many other types of system 00:28:27.706,00:28:33.779 management devices vulnerabilities such as a weak password for web management 00:28:33.779,00:28:42.387 devices, and even SSH that do not require password uh I find it on some case. And some 00:28:42.387,00:28:50.896 manufacturers in order to convenience the repair of the 4g modules, uh they hide backdoor, 00:28:50.896,00:28:57.102 they hide backdoor in some external monitoring port. Uh maybe you can use the backdoor 00:28:57.102,00:29:04.309 to open telnet or do something dangerous. I will talk about uh an inter- an in- interesting 00:29:04.309,00:29:13.085 case uh like this on the next page. This is uh this is this bug was caused by a secondary 00:29:13.085,00:29:20.092 development of 4g module. On a car T- box, T-box. Uh we reported this problem to 00:29:20.092,00:29:27.899 manufacturer 6 months ago and the manufacturer has completely fixed it. Uh now a days some 00:29:27.899,00:29:35.307 cars can unlock and open its engine remotely through mobile phone APP, uh which aroused our 00:29:35.307,00:29:47.185 interest. We bought this car T- box uh from uh from the uh auto parts shop uh with this 00:29:47.185,00:29:56.728 capability uh the capability is it can use a mobile phone APP tool open its uh door uh and 00:29:56.728,00:30:06.538 start its engine. Eh. First we dumped with firmware with a NAND program- programmer, and we find 00:30:06.538,00:30:16.848 a process listening on 24xxx port uh and when we used IDA- IDA to scan the string of this 00:30:16.848,00:30:25.524 process, we find uh a telnet related string. Uh let’s analyse it. As you see we find a 00:30:25.524,00:30:33.498 dangerous function. This function passed the receive data from that port and appear to 00:30:33.498,00:30:40.138 command to execute. As the picture shows, uh it can be used to open telnet, these device. We 00:30:40.138,00:30:49.614 analyzed the logic of the protocol uh uh of this port actually it used a PKI system 00:30:49.614,00:30:56.788 RSA certifications and uh uh AES encryptions. Uh but we find there are multiple 00:30:56.788,00:31:05.897 vulnerabilities in uh this such as uh the AES key is hardcoded in binary uh and we get the RSA 00:31:05.897,00:31:14.906 private uh private key from the file system. And the password of the f- of the private key we can 00:31:14.906,00:31:21.980 guess it so we can use it to generate public key. Uh and we used these problems to bypass 00:31:21.980,00:31:28.954 the TRS uh certification successfully. After we was engineering uh we like to 00:31:28.954,00:31:36.828 explore code like this uh as expected we finally start up the Telnet these device on this 00:31:36.828,00:31:47.339 T-box, through this port and using uh by using this exploit. However uh telnetd in this mode 00:31:47.339,00:31:54.713 requires password verification so here’s comes the new pa- uh problem, what the password is- 00:31:54.713,00:32:04.322 is. We use the most powerful for p-soft Nvidia 2080Ti graph sick- uh cart to crack the password. A 00:32:04.322,00:32:11.730 day later we finally uh got the password. The password is very complex; uh include- include big 00:32:11.730,00:32:20.806 and little case charts, numbers and special charts. Uh so now we have our root shell of this 00:32:20.806,00:32:30.348 T-box. So how can we control the car through uh this root shell? First uh let’s- let’s learn how 00:32:30.348,00:32:37.789 remote control of the car is implemented. First, uh the red dotted line in this figure uh 00:32:37.789,00:32:46.064 represents the 4g module. It has a long connection with the cloud server. Uh the uh 4g module loc- 00:32:46.064,00:32:55.874 located in the T-box and located in the MPU of T-box. Uh when the door uh when the open door 00:32:55.874,00:33:02.547 instruction is issued from mobile phone APP uh the 4g module uh receive the 00:33:02.547,00:33:11.389 instruction. A process in MPU communicates with MCU through uh the series port, uh another 00:33:11.389,00:33:20.232 process in MPU uh yes uh. Another process in MCU that receives the instruction and 00:33:20.232,00:33:31.676 pass it and dispatch to to combust and the door open. I think this could be the easiest 00:33:31.676,00:33:44.289 way to uh control the car. As we can get shell of the MPU MPU so we can write a program to record 00:33:44.289,00:33:52.230 the data- uh the data that MPU write to MCU. So when we want to hack another car, uh the step is 00:33:52.230,00:33:59.571 we used uh uh exploit we write before to start this telnet and get the shell, and execute- 00:33:59.571,00:34:07.579 execute a new program to replay the data uh we recorded before so the door will open. The most 00:34:07.579,00:34:16.288 important question is: how to run our attack code? Or how to access that port? Do we remember 00:34:16.288,00:34:24.095 that attack surface uh attack method that Shupeng uh just uh uh mentioned before? Uh through 00:34:24.095,00:34:30.735 our fake base station uh operating intranet or wifi hotspot, we can access that port 00:34:30.735,00:34:37.542 by running uh the exploit without touching the car. Uh if the car manufacturers use the 00:34:37.542,00:34:47.252 private APN network without isolation, uh everything will become simple, or terrible. Uh 00:34:47.252,00:34:54.559 in the right picture uh we emptied a private APN network of this T-box. Uh so we can scan 00:34:54.559,00:35:04.703 the port 24xxxx and we find there are many devices will open this port so we could attack 00:35:04.703,00:35:13.111 many devices at the same time. Uh maybe we can use these things attack methods to build zombie 00:35:13.111,00:35:22.387 cars, team, just like the things in Fast and Furious 8. Next, let- let’s talk about the 00:35:22.387,00:35:31.529 vulnerability in FOTA. FOTA is a way to upgrade firmware. We find that uh some 4g modules 00:35:31.529,00:35:38.603 frequently check whether uh the cre- the credentials is the last- latest. Uh some devices 00:35:38.603,00:35:46.177 check update when the device start up and some uh every 40 minutes. In this case, 00:35:46.177,00:35:54.853 afterwards engineering we find uh that he logged in to our FTP server to check for new firmware 00:35:54.853,00:36:03.395 version. Because FTP, username, and password is hardcoded uh we can use it. We can use use FTP 00:36:03.395,00:36:12.103 password to l- login the FTP server successfully. And after login we can download all the 00:36:12.103,00:36:32.924 versions uh we got. Wait for a second [sniffles]. Yes uh we can download all versions of the 00:36:32.924,00:36:42.300 firmware of all devices. So uh we probably get the old firmware version, uh but this is not the 00:36:42.300,00:36:53.845 craziest thing. Uh we find that this FTP account has right bar paragee so we can uh and uh 00:36:53.845,00:37:02.487 another good news uh the 4g modules uh did not verify the firmware file uh in the FTP. So 00:37:02.487,00:37:09.527 we can use a rewritable privilege to upload a new firmware with backdoor uh to the 00:37:09.527,00:37:16.434 FTP server and uh uh there are many many 4g modules of this manufacturer. We are download 00:37:16.434,00:37:23.007 the new firmware automatically and upgrade to it. That means- that means we can hack all 4g 00:37:23.007,00:37:30.348 modules uh of this manufacturer in just uh, uh less than 1 day. Uh. So that's a n- nice day 00:37:30.348,00:37:43.461 probably. [applause] We have just talked about uh problems on the FTP s- uh FOTA server side, 00:37:43.461,00:37:51.402 let’s look at the vulnerability of the FOTA client side. We find that some 4g modules listen to 00:37:51.402,00:37:59.911 some ports for FOTA uh for example in this case we find this 4g module listened to the 00:37:59.911,00:38:10.188 port uh 45xxx and it used to receive the upgrade m- command. Uh this port was originally used 00:38:10.188,00:38:19.864 for interprocess communication, but it was incorrectly bound to public- bounded to 0 dot 0 dot 0 00:38:19.864,00:38:29.908 dot 0 dot 0 not local host so we can send data to this port remotely. And after crack the 00:38:29.908,00:38:35.547 data exchange protocol to this ca- uh this port and we was engineering the structure of the 00:38:35.547,00:38:43.388 uh upgrade uh firmware file. Uh as you can see, the structure of this uh firmware file is very 00:38:43.388,00:38:51.963 complicated. It- it costs us a long time but we finally get it. So we can- so now we can make a 00:38:51.963,00:38:59.237 new firmware file with backdoor and force the 4g module upgrade to it. So we hacked it a- again. 00:38:59.237,00:39:07.579 Almost every 4g module has its own AT command uh processing process. And some manufacturers 00:39:07.579,00:39:14.152 eh impl- un implement some custom ca- capabilities for example uh only the factory 00:39:14.152,00:39:21.259 engineers know- know- they they know some hidden AT command. Uh if you can find them out maybe 00:39:21.259,00:39:28.766 you can open the ADB device uh through the hidden instructions or open t- open ADB or 00:39:28.766,00:39:34.839 something. Uh we mentioned it before. Uh in another case, AT command injection vulnerability 00:39:34.839,00:39:42.213 is also allowed. For example, this fallen picture uh in the left uh, is an introduction for 00:39:42.213,00:39:48.987 adding route in the development document. Uh we analyzed it we analyzed the system command 00:39:48.987,00:39:55.927 called here deeply we find there’s a command injection vulnerabilities. In the image on 00:39:55.927,00:40:03.901 the right we append LF stream to the AT command uh and the routing content shows the LS 00:40:03.901,00:40:08.406 command executed success- successfully. That proves there’s a code injection 00:40:08.406,00:40:16.180 vulnerability in AT command parsing. In general, the AT command can be only executed uh 00:40:16.180,00:40:25.590 on the- the USB serial port, uh but some 4g modules uh they support, uh they support use of 00:40:25.590,00:40:35.066 SMS to execute AT commands. It use- it’s usually used for remote control. Uh. If we can 00:40:35.066,00:40:42.206 find a AT- if we can find an AT command injection vulnerability in this scenario uh we can 00:40:42.206,00:40:52.250 exploit the bug remotely by sending an attack message to it. In fact we did find such per- uh 00:40:52.250,00:41:00.024 we did find some uh some problem in some 4g modules like this. Uh this is a 4g module that 00:41:00.024,00:41:08.766 supports- use SMS to execute AT commands. In this case we find it requires a password in the 00:41:08.766,00:41:15.707 content to verify- verification uh if the password is right uh it will execute the AT command 00:41:15.707,00:41:23.915 in the uh SMS. But the way uh the way he uses the verification is too weak still to solve the 00:41:23.915,00:41:31.789 problem. The password is hardcoded in binary and every device the- the pa- password is 00:41:31.789,00:41:40.331 the same. And we can get it from uh uh uh from the firmware once we get uh 1 device. Uh this is 00:41:40.331,00:41:53.344 that that that 4g module support uh AT command uh using SMS to to control it. Uh actually we find 00:41:53.344,00:42:00.284 a command injection vulnerability in parsing SMS AT command. The command name is 00:42:00.284,00:42:11.229 SETFCSN. And finally we can get a reversed shell by simply send a text message to it. We hacked 00:42:11.229,00:42:20.438 it again remotely. There are many other successful case of attack. Because this talk uh 00:42:20.438,00:42:28.613 limit of 50 minutes I can not talk about them detail 1 by 1. Let me talk about some other 00:42:28.613,00:42:37.054 interesting c- cases quickly. Uh such as, we can use uh the jammer to attack the 4g module. 00:42:37.054,00:42:44.462 Uh using and then using the man in the middle and combined with uh some browser vulnerabilities, 00:42:44.462,00:42:51.169 such as 0-day or end-day to intercede to intercede the IO firmware of a car. And the debug 00:42:51.169,00:42:59.844 process on the 4g module is also an attack surface. Uh DDoS it’s 2 deaths, that may cause the car 00:42:59.844,00:43:10.188 lose connection uh with the cloud server for a long time. Uh. And the IPV6, even if the 4g 00:43:10.188,00:43:17.061 module has en- enabled IP table- IP table as firewall, uh but sometimes we can still access 00:43:17.061,00:43:25.069 the- that port. Why? Because the IP6 tables are not enabled. We can simply bypass the firewall 00:43:25.069,00:43:35.580 by using IPV6 address. And almost every 4g wifi used 8 digital password. 8 digital 00:43:35.580,00:43:42.453 password. That means the password is only number- n- numbers. It’s it’s weak 00:43:42.453,00:43:50.561 password. Uh we can use DDoS attack to get the handshake packet and then crack the 00:43:50.561,00:44:05.109 password with uh many uh classic uh crack like an 2080Ti in a few minutes or a few seconds. After 00:44:05.109,00:44:11.382 crack the password, we are in the same intranet of the 4g module. We can launch the uh 00:44:11.382,00:44:19.991 further attacks such as we can attack the um system management of the 4g module. Uh we can 00:44:19.991,00:44:29.767 attack uh all devices connected to the 4g module. Uh uh in the next chapter, let's talk about 00:44:29.767,00:44:36.507 the suggestions for defending against those attacks. Uh we have talked about uh a lot of 00:44:36.507,00:44:43.047 attack mechanisms and vulnerabilities detail before, and it seems that there are many 00:44:43.047,00:44:50.655 problems. So how should we uh do we- uh we can avoid those problems. After command kit with 00:44:50.655,00:44:57.194 many 4g module manufacturers hardware manufacturers and car manufacturers. Uh we find that 00:44:57.194,00:45:06.337 they did not realize there is an complete- uh complete operating system in 4g modules. Uh 00:45:06.337,00:45:12.543 sometimes there are many, uh there could be many operating systems on the motherboard. Uh 00:45:12.543,00:45:21.752 for example there could be uh 3 uh 3 operating systems on the T-box motherboard. Uh so if 1 of 00:45:21.752,00:45:28.125 the system has problem, it may affect each other- uh it may uh affect each other. So- so first 00:45:28.125,00:45:36.434 of all we must identify uh those systems, their IPS, and next we should check the listening port. 00:45:36.434,00:45:42.707 Uh ex- especially uh those ports that can be accessed remotely. Uh we have found many many high 00:45:42.707,00:45:48.245 risk vulnerabilities in most uh of the listening port- listening port process. Uh if not 00:45:48.245,00:45:56.587 absolutely necessary we should not listening port. >>How much time do you have left? 2 00:45:56.587,00:46:04.629 minutes? >>Yes. And be- uh uh and be a- aware of uh network ac- access by using 4g 00:46:04.629,00:46:12.870 interface. Uh many people think that 4g channel is safer uh but actually hacker can play man in 00:46:12.870,00:46:18.509 the middle easily through the fake base station. And another problem is that we find that 95 00:46:18.509,00:46:26.917 percent of IP tables used in the 4g modules uh are empty, it's dangerous. So uh we think, we 00:46:26.917,00:46:35.292 think the simplest way, we think the simplest way to defend against uh uh attacks is to uh 00:46:35.292,00:46:45.536 let the developer learn how to use IP tables uh well. [siren sound] Uh here uh thanks to our 00:46:45.536,00:46:56.847 team’s members uh uh you know this is uh teamwork. We have 4 ana- analysts over 50, uh 50? 50 00:46:56.847,00:47:03.821 yes 5 0 uh devices. This is our talk about security re- uh research of 4g modules. I hope 00:47:03.821,00:47:09.493 that our work can give you some in- inspiration. If you have any questions, uh you can email to 00:47:09.493,00:00:00.000 us. Uh thank you for listening. [applause]