Recently, two security researchers, Roberto Paleari and Aristide Fattori, released technical details about the security vulnerabilities of Samsung Galaxy mobile devices. The Galaxy phone is said to be used by unauthorized third-party personnel to send calls and text messages in the lock screen state.
Lock Screen Bypass Overview
According to the technical details released by Roberto Paleari and Aristide Fattori, an attacker could access a mobile device via USB and connect it to a Linux work platform by means of a temporary access to a mobile device or a stolen user's phone. Finally sends the instruction to realize the telephone call and the text message sends.
And this way does not use any software vulnerabilities, even if the phone turned off the USB debugging function (ADB, Android Debug Bridge, can help users to manage the device or emulator state) or USB network sharing function, can also achieve the above phone calls and SMS sent.
How the implementation works
The current core issue for this vulnerability is that when a phone is connected to another Linux system via USB, it is generally possible to communicate with a mobile device through a virtual USB serial port (primarily/DEV/TTYACM0 device) of the Linux system.
According to the test situation, when connected to a USB controller (such as a regular laptop), for the Samsung Galaxy phone, this will expose a serial interface, and by using this interface we can communicate with the phone's USB modem.
"Easy" mode (for older Samsung phones and firmware versions)
For older Samsung phones and firmware versions, such as gt-i9192 (Samsung S4 Mini, version number I9192XXUBNB1), after connecting the phone to a Linux host and confirming that the interface is connected to the USB modem, you can attempt to send the at (Attention) command, It is analyzed that some of these instructions are passed to the baseband modem, while others are processed by the user space application.
Using the interface above to run and pass simple at (Attention) commands, in theory, allows a skilled attacker to perform various operations on a mobile device.
Small Encyclopedia
At, all called attention, invented by Hayes, the at instruction set mainly allows the computer or terminal to communicate with the modem. By sending an at command to control the function of the mobile station, it interacts with the GSM network service. The user can control the call, text message, telephone book, data service and fax through the AT command.
"Hard" mode (for new Samsung phones and firmware versions)
And in recent firmware versions (such as the latest version of Samsung S4 and Samsung S6) to exploit this vulnerability is not so simple, because the most recent firmware version, its default configuration is, when the device is connected to the host, open to the host only MTP interface function, mainly for file transfer.
However, after testing, we found that the attacker could still communicate with the modem by switching the default configuration to a second USB configuration. So, suppose in this case, before the attacker connects to the modem, the default configuration needs to be switched to USB configuration # #. This can be done with a PC terminal without unlocking the phone device. The following is the default configuration information,
$ LSUSB-v ... Bus001Device007: ID 04e8:6860Samsung Electronics Co., Ltd Galaxy (MTP) Device descriptor:blength -bDescriptorType1Bcdusb2.00Bdeviceclass0(Defined at Interface level) Bdevicesubclass0Bdeviceprotocol0BMaxPacketSize0 -Idvendor0x04e8Samsung Electronics Co., Ltd idproduct0x6860Galaxy (MTP) ... bnumconfigurations2Configuration Descriptor: ... Interface Descriptor:blength9bDescriptorType4Binterfacenumber0balternatesetting0bnumendpoints3Binterfaceclass6Imaging Binterfacesubclass1still Image Capture binterfaceprotocol1Picture Transfer Protocol (PIMA15470) IInterface5MTP ... Configuration Descriptor:blength9bDescriptorType2Wtotallength thebnuminterfaces3Bconfigurationvalue2iconfiguration0bmattributes0xc0Self Powered maxpower 96mA ... Interface Descriptor:blength9bDescriptorType4Binterfacenumber1balternatesetting0bnumendpoints1Binterfaceclass2Communications Binterfacesubclass2Abstract (Modem) Binterfaceprotocol1at-commands (v.25ter) IInterface6CDC Abstract Control Model (ACM) ...
In this POC, we developed a simple tool (written in c), called Usbswitcher. With this tool, we can switch the specified Samsung phone device to the USB configuration #2. The tool uses the LIBUSB library to achieve these functions. And the same task, we can also be done by using the/SYS/BUS/USB virtual file system.
The process we use to force the mobile switch configuration is to first reset the USB device (via the Usb_reset () function), and then switch the configuration (via the Set_configuration () function). Sometimes, the first execution of the tool usbswitcher may not take effect, so it is best to run two times to ensure that the configuration has been switched over. Tool Usbswitcher Source Code link address is: usbswitcher.c
Test results
We know that the most obvious consequence of visiting a modem is making it possible to make calls and send text messages. For the former, the outgoing call can be achieved by using the following command:
atd+123456;
The effect of this command is mainly to dial phone number 123456 in the lock screen state. As described in the POC video below.
Demo Video
* in Upload *
For some friends asking, is it possible to exploit this vulnerability to gain access to devices, such as access to their contacts, photos, and internal storage? In theory, the AT command can be processed directly by the baseband processor, but as we mentioned earlier, the AT command may be parsed by the user space application in the process of passing, so the baseband processor cannot process the instruction, so it cannot directly implement the above mentioned access rights.
In this test, we observed that S4 Mini (firmware version number I9192XXUBNB1) can support some at directives that can be used to control the settings of the Android system. In this, for example, the AT+USBDEBUG directive allows the USB debug feature to be enabled, the At+wifivalue directive to enable or disable device Wi-Fi, and so on.
In recent phone firmware versions, Samsung may be aware of the risks associated with such a command, and it has begun to introduce a blacklist-based filtering mechanism (executed by the Ddexe binary application) to filter out threatening commands. For example, when passing the at+ usbdebug instruction during testing, we can see that the following information is recorded in the system log of the Galaxy S6 device,
D/datarouter ( 302): Write [151] bytes of data to USB fd[9]d/datarouter ( 302 Select D/datarouter ( 302): Read USB Data[len:]d/datarouter ( 302): Read USB data message:at+usbdebugd/datarouter ( 302): not allowed at cmd!! # not allowed to execute at command D/datarouter ( 302Select
Impact Range
Currently, the type of device that has been tested and found to be able to perform the actions described earlier includes the following:
sm-g920f, version number: G920FXXU2COH2 (Galaxy S6) SM3) GT-I9192, version number: 9192XXUBNB1 (Galaxy S4 Mini ) GT-I9195, version number: I9195xxucol1 (Galaxy S4 mini LTE) GT-i9505, version number: I9505xxuhoj2 (Galaxy S4)
* Reference source : Github,softpedia
Technical Analysis: Lock screen Bypass, Samsung Galaxy series mobile phone can also "be" out of the phone