Security authentication method for secure debug firmware, adb device and storage medium
By introducing authentication methods into the ADB firmware of the Android system, dangerous commands are identified and handled, which solves the problems of system crashes and data leaks caused by excessive permissions and achieves secure protection of device information.
Patent Information
- Application Number
- CN202310244065.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-03-14
Smart Images

Figure CN116738431B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of firmware debugging technology, specifically relating to an authentication method for secure debuggable firmware, an ADB device, and a storage medium. Background Technology
[0002] ADB (Android Debug Bridge) is a versatile command-line tool used to perform various operations on Android devices (such as installing and debugging applications) and provides access to the Unix shell (which can be used to run various commands on Android devices). It is a client-server program consisting of three components: a client, a daemon, and a server. The native ADB firmware in the Android system has the following vulnerabilities and shortcomings: 1. The native daemon and server do not perform authentication processing on commands sent by the client, and ADB clients are very easy to obtain on the Internet.
[0003] 2. The native ADB client has excessive permissions and does not restrict some dangerous commands. If the user uses dangerous commands incorrectly, it may cause the Android system to crash.
[0004] 3. Due to excessive client privileges and the lack of authentication between the daemon and the server, if a user's Android device is lost, it may be used by criminals to read personal data from the device using ADB. Summary of the Invention
[0005] To overcome the above-mentioned technical defects, the present invention provides an authentication method, ADB device and storage medium for secure debuggable firmware, which can perform authentication processing on instructions.
[0006] This invention is achieved through the following scheme: An authentication method for secure debuggable firmware, comprising the following steps: Upon receiving authentication information from the server, determine whether the authentication information is a dangerous instruction; If the authentication information is a dangerous instruction, a prompt message will be generated for the user to choose from; Upon receiving confirmation from the user, a command carrying authentication information is sent to the server.
[0007] As a further improvement of the present invention, when an authentication request is initiated to the server, the server sends authentication information.
[0008] As a further improvement of the present invention, if the authentication information is not a dangerous instruction, an instruction carrying the authentication information is sent to the server.
[0009] As a further improvement of the present invention, in the step of generating a prompt message for the user to choose if the authentication information is a dangerous instruction, if a cancellation message issued by the user is obtained, the instruction carrying the authentication information is cancelled from being sent to the server.
[0010] An authentication method for secure debuggable firmware includes the following steps: Determine whether a command carrying authentication information sent by the client is a dangerous command; If an instruction carrying authentication information is deemed a dangerous instruction, then the instruction carrying authentication information will be intercepted.
[0011] As a further improvement of the present invention, if the instruction carrying authentication information is not a dangerous instruction, then the instruction carrying authentication information is issued.
[0012] Compared with the prior art, the present invention has the following beneficial effects: authenticating commands before debugging or installing applications can greatly improve the security performance of the Android system.
[0013] The present invention also provides an ADB device, comprising: The client is used to implement the authentication method described above; The server communicates with the client to implement the authentication method described above. The instruction processing module is used to receive instructions carrying authentication information sent by the server.
[0014] As a further improvement of the present invention, the client includes: The first authentication module is used to send an authentication request to the server and obtain authentication information sent by the server. The instruction sending module is used to determine whether the authentication information is a dangerous instruction. If the authentication information is a dangerous instruction, the instruction sending module generates a prompt message for the user to choose from. When the user sends a confirmation message, the instruction sending module sends an instruction carrying the authentication information to the server. Alternatively, if the authentication information is not a dangerous instruction, the instruction sending module sends an instruction carrying the authentication information to the instruction processing module.
[0015] As a further improvement of the present invention, the server includes: The second authentication module is used to send authentication information to the client; The instruction receiving module is used to determine whether an instruction carrying authentication information sent by the client is a dangerous instruction; if the instruction carrying authentication information is a dangerous instruction, the instruction receiving module intercepts the instruction carrying authentication information.
[0016] Compared with the prior art, the present invention has the following advantages: it can effectively protect the information security of the device, and clients without the first authentication module cannot obtain administrator privileges; at the same time, servers with the second authentication module can also perform authentication processing on clients.
[0017] The present invention also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the above-described authentication method. Attached Figure Description
[0018] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart of the method for upgrading a touchscreen to switch functions as described in Example 1; Figure 2 This is a schematic diagram of the structure of the device described in Example 2; Figure 3 This is a schematic diagram of the ADB device described in Example 3. Detailed Implementation
[0019] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0020] It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, the sequence numbers of each step are merely used to distinguish between steps and do not imply that each step must be strictly performed in the order of the numbers.
[0021] Example 1 This invention provides an authentication method for secure and debuggable firmware, such as... Figure 1 As shown, the steps include: An authentication request is sent to the server, at which point the server returns authentication information.
[0022] When the authentication information sent by the server is received, it is determined whether the authentication information is a dangerous instruction; If the authentication information is a dangerous instruction, a prompt message is generated for the user to choose from. Preferably, the prompt message includes: a textual prompt of the dangerous instruction, and several selection buttons can also be provided for the user to choose from, such as "Confirm" and "Cancel". If the customer selects the confirm button, it indicates that the user is aware of the risk and confirms to perform the operation. If the authentication information is not a dangerous instruction, an instruction carrying the authentication information is sent to the server.
[0023] Upon receiving confirmation from the user, a command carrying authentication information is sent to the server.
[0024] If a cancellation message is received from the user, cancel the instruction to send authentication information to the server.
[0025] This embodiment performs command authentication before debugging or installing applications, which can greatly improve the security performance of the Android system.
[0026] Example 2 This embodiment provides an authentication method for secure and debuggable firmware, such as... Figure 2 As shown, the steps include: Determine whether a command carrying authentication information sent by the client is a dangerous command; If the instruction carrying authentication information is a dangerous instruction, then the instruction carrying authentication information is intercepted; if the instruction carrying authentication information is not a dangerous instruction, then the instruction carrying authentication information is issued.
[0027] This embodiment performs command authentication before debugging or installing applications, which can greatly improve the security performance of the Android system.
[0028] Example 3 This embodiment provides an ADB device, such as Figure 3 As shown, it includes: a client and a server. The client is used to implement the authentication method of Embodiment 1; the server communicates with the client to implement the authentication method of Embodiment 2.
[0029] Furthermore, the client includes: a first authentication module and an instruction sending module; the first authentication module is used to send an authentication request to the server and obtain authentication information sent by the server; the instruction sending module is used to determine whether the authentication information is a dangerous instruction; if the authentication information is a dangerous instruction, the instruction sending module generates a prompt message for the user to choose from; when obtaining confirmation information sent by the user, the instruction sending module sends an instruction carrying the authentication information to the server; or if the authentication information is not a dangerous instruction, the instruction sending module sends an instruction carrying the authentication information to the server.
[0030] The server includes a second authentication module and an instruction receiving module. The second authentication module is used to send authentication information to the client. The instruction receiving module is used to determine whether an instruction carrying authentication information sent by the client is a dangerous instruction. If the instruction carrying authentication information is a dangerous instruction, the instruction receiving module intercepts the instruction carrying authentication information. The instruction processing module is used to receive the instruction carrying authentication information sent by the instruction receiving module.
[0031] Preferably, the debugging permissions of ADB devices can be managed in layers, allowing only clients with the first authentication module to use dangerous commands.
[0032] In the actual real-time process, the client is equipped with a primary authentication module. After the client connects to the server, this module automatically sends an authentication request. The primary authentication module saves the obtained authentication information and sends it to the command sending module. In the command sending module, all commands are categorized into ordinary commands and dangerous commands. Dangerous commands are accompanied by corresponding risk warning text and authentication information is included when sending them.
[0033] The server processes authentication requests from clients by setting up a second authentication module and sends authentication information to the clients. In the instruction receiving module, all instructions are classified and processed. Dangerous instructions are checked to see if they carry authentication information and the authentication information is verified. Only dangerous instructions that pass authentication are sent to the instruction processing module, while dangerous instructions that fail authentication are intercepted.
[0034] This embodiment effectively protects the information security of the device, preventing clients without the first authentication module from obtaining administrator privileges; at the same time, the server with the second authentication module can also authenticate the client.
[0035] Example 4 This embodiment provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the authentication methods of Embodiments 1 and 2.
[0036] Storage media can include physical devices for storing information, typically digitizing the information and then storing it using media that employ electrical, magnetic, or optical methods. Storage media can include: devices that store information using electrical energy, such as various types of memory, like RAM and ROM; devices that store information using magnetic energy, such as hard disks, floppy disks, magnetic tapes, magnetic core memory, bubble memory, and USB flash drives; and devices that store information using optical methods, such as CDs or DVDs. Of course, there are other types of readable storage media, such as quantum memories and graphene memories.
[0037] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An authentication method for secure and debuggable firmware, characterized in that, Including the following steps: When the client receives authentication information from the server, it determines whether the authentication information is a dangerous instruction. If the authentication information is a dangerous instruction, the client generates a prompt message for the user to choose from. If the client receives a cancellation message from the user, it cancels sending the instruction carrying the authentication information to the server. When the client receives the confirmation message from the user, it sends a command carrying authentication information to the server. The server determines whether a command carrying authentication information sent by the client is a dangerous command. If a command carrying authentication information is deemed a dangerous command, the server will intercept the command.
2. The authentication method according to claim 1, characterized in that, When an authentication request is sent to the server, the server sends authentication information.
3. The authentication method according to claim 1, characterized in that, If the authentication information is not a dangerous instruction, then an instruction carrying the authentication information is sent to the server.
4. The authentication method according to claim 1, characterized in that, If an instruction carrying authentication information is not considered a dangerous instruction, then the instruction carrying authentication information will be issued.
5. An ADB device, characterized in that, include: A client, used to implement the authentication method as described in any one of claims 1 to 4; The server communicates with the client to implement the authentication method as described in any one of claims 1 to 4; The instruction processing module is used to receive instructions carrying authentication information sent by the server.
6. The ADB device according to claim 5, characterized in that, The client includes: The first authentication module is used to send an authentication request to the server and obtain authentication information sent by the server. The instruction sending module is used to determine whether the authentication information is a dangerous instruction. If the authentication information is a dangerous instruction, the instruction sending module generates a prompt message for the user to choose from. When the user sends a confirmation message, the instruction sending module sends an instruction carrying the authentication information to the server. Alternatively, if the authentication information is not a dangerous instruction, the instruction sending module sends an instruction carrying the authentication information to the instruction processing module.
7. The ADB device according to claim 6, characterized in that, The server includes: The second authentication module is used to send authentication information to the client; The instruction receiving module is used to determine whether an instruction carrying authentication information sent by the client is a dangerous instruction; if the instruction carrying authentication information is a dangerous instruction, the instruction receiving module intercepts the instruction carrying authentication information.
8. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the authentication method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for preventing PC (Personal Computer) side from obtaining layout operation of mobile equipment screen
CN104978518A
Connection control method and system, and hosts
CN106534342A
