Lightweight cross-architecture firmware security protection method and system based on debugging agent

Through a lightweight cross-architecture firmware security protection method based on debugging agents, it solves the problem of real-time vulnerability detection and protection of IoT devices in multiple architectures and complex environments, achieves dynamic detection and prevention of typical vulnerability attacks, and improves The security performance and protective effect of the firmware.

CN118611922APending Publication Date: 2024-09-06Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410682024.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing technology is difficult to perform real-time detection and rapid response to the firmware of IoT devices in multiple architectures and complex environments, and cannot effectively protect against typical vulnerability attacks. Traditional static patching methods have significant lag and new attack surfaces.

Method used

Adopting a lightweight cross-architecture firmware security protection method based on debugging agents, by obtaining the processor architecture of the target firmware, configuring inline assembly code, using cross-compilation to generate debugging instructions, and using instrumentation technology to configure monitoring in the target firmware control flow Point, detect the running status of the program, determine the vulnerability type, and perform early warning and defense responses. It supports multiple architectures such as ARM, MIPS, and PPC.

Benefits of technology

It achieves dynamic detection and blocking of typical vulnerability attacks, covers stack overflow, command execution, UAF and other vulnerabilities, provides real-time alarms and automated patch defense, reduces development costs, improves security protection effects, and adapts to the needs of different processor architectures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611922A
    Figure CN118611922A
Patent Text Reader

Abstract

The invention relates to the technical field of network security, in particular to a lightweight cross-architecture firmware security protection method and system based on a debugging agency, and the method comprises the steps: obtaining a processor architecture of target firmware, configuring an inline assembly code according to the processor architecture, and generating a target firmware debugging instruction through cross compiling; the inline assembly code is used for performing cross compiling according to a configuration condition during operation; the debugging agent is used for receiving and executing the debugging instruction, a monitoring point is configured in the target firmware control flow through the instrumentation technology so as to detect the program running state of the monitoring point, and the monitoring point is a non-interruption breakpoint set at the key function or instruction position; potential abnormal behavior information of the target firmware is checked according to the detected program running state, and the vulnerability type is judged and early warning and defense response are carried out by triggering an exception handling process. The system can cover common architectures of various embedded devices such as ARM, MIPS, PPC and the like, can run on various embedded architectures to realize security protection of firmware, and can realize real-time alarm of vulnerabilities and automatic patch defense.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a lightweight cross-architecture firmware security protection method and system based on a debugging agent. Background Art

[0002] Nowadays, various embedded devices have been widely used in various business scenarios and are closely integrated with the Internet of Things. These devices usually run firmware of multiple architectures and versions, such as x86, ARM, PowerPC, etc. However, due to manufacturers' neglect of embedded device security and the complexity of device firmware, firmware vulnerabilities and related attacks are common and have become the main security threat facing the Internet of Things.

[0003] Traditional firmware security protection mechanisms mostly adopt the form of static vulnerability patches. This mechanism plays a role in security protection to a certain extent, but this mechanism requires that patches be produced and released after the vulnerability is discovered, and then the affected devices are updated. This post-launch patching method cannot detect vulnerabilities in real time and automatically apply patches, and has significant lag. In addition, new attack surfaces will be introduced during the firmware update process, especially through vulnerable firmware verification programs. Current security protection measures are still difficult to meet the business's demand for firmware security, and the security issues of IoT devices face major challenges. Therefore, how to timely detect and quickly respond to typical vulnerability attack processes in a variety of architectures and complex environments, and to achieve effective protection of firmware in the form of real-time warnings and dynamic patches, has become an urgent problem to be solved in the current IoT device security field. . Summary of the invention

[0004] To this end, the present invention provides a lightweight cross-architecture firmware security protection method and system based on a debugging agent to solve the existing firmware security protection problems of embedded devices with multiple architectures and complex environments.

[0005] According to the design scheme provided by the present invention, on the one hand, a lightweight cross-architecture firmware security protection method based on a debugging agent is provided, comprising:

[0006] Obtaining a processor architecture of the target firmware, configuring inline assembly code according to the processor architecture and generating target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used to perform cross-compilation according to the configuration at runtime;

[0007] Utilize the debugging agent to receive and execute debugging instructions, and use the plugging technology to configure monitoring points in the target firmware control flow to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions;

[0008] Check the target firmware's potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and issue an early warning and defense response.

[0009] As a lightweight cross-architecture firmware security protection method based on debugging agent of the present invention, further, adjusting the inline assembly code according to the processor architecture and generating the target firmware debugging instructions through cross compilation, including:

[0010] The inline assembly code alignment parameters are configured according to the processor architecture, wherein the processor architecture is an ARM architecture, a MIPS architecture, a PPC architecture, or an X86 architecture;

[0011] Based on the inline assembly code alignment parameters, a cross-compilation chain is built in the compiler, and target firmware debugging instructions are generated through cross-compilation.

[0012] As a lightweight cross-architecture firmware security protection method based on debugging agent of the present invention, further, inline assembly code alignment parameters are configured according to the processor architecture, including:

[0013] Classifying the processor architecture into a first architecture type using C language code to implement the debug agent and a second architecture type using assembly language and C language code to implement the debug agent;

[0014] Configures the architecture type alignment parameter according to the processor architecture to generate compiler inline assembly code when the architecture type alignment parameter is aligned.

[0015] As a lightweight cross-architecture firmware security protection method based on debugging agent of the present invention, further, the monitoring point is configured in the target firmware control flow by using the plugging technology, including:

[0016] Modify the instruction at the monitoring point so that the target firmware control flow execution flow jumps to the free memory, collects and records the current program running status; and returns the target firmware control flow to the next instruction in the original program of the target firmware at the monitoring point.

[0017] As a lightweight cross-architecture firmware security protection method based on a debugging agent of the present invention, further, the target firmware potential abnormal behavior information is checked according to the detected program running status, including:

[0018] Verify whether the return address in the stack matches the saved address and whether the function parameters meet the expected security constraints. If the address does not match or the function parameters do not meet the expected security constraints, it is determined that the target firmware has potential stack overflow abnormal behavior information.

[0019] As a lightweight cross-architecture firmware security protection method based on a debugging agent of the present invention, further, the target firmware potential abnormal behavior information is checked according to the detected program running status, including:

[0020] The security of the system call function is verified by checking the legitimacy of the function parameters. If there is an abnormality in the system call function parameters, it is determined that the target firmware has potential abnormal command execution behavior information.

[0021] As a lightweight cross-architecture firmware security protection method based on a debugging agent of the present invention, further, the target firmware potential abnormal behavior information is checked according to the detected program running status, including:

[0022] The metadata and double-linked list structure are used to record the memory block status, and the target firmware is detected for potential abnormal behavior of memory space by tracking and detecting memory operations;

[0023] And / or, monitoring the frequency of the target firmware control flow executing the ret instruction, if the frequency exceeds a preset threshold, it is determined that the target firmware has potential ROP chain abnormal behavior information.

[0024] On the other hand, the present invention also provides a lightweight cross-architecture firmware security protection system based on a debugging agent, comprising: a compilation module, a debugging module and a protection module, wherein:

[0025] A compiling module, used to obtain the processor architecture of the target firmware, configure the inline assembly code according to the processor architecture and generate the target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used to perform cross-compilation according to the configuration at runtime;

[0026] A debugging module, which is used to receive and execute debugging instructions using a debugging agent, and configure monitoring points in the target firmware control flow using a plug-in technique to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions;

[0027] The protection module is used to check the target firmware's potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and perform early warning and defense response.

[0028] Beneficial effects of the present invention:

[0029] The present invention adopts a non-interrupt debugging mechanism to solve the problem of abnormal restart of the existing debugger on an embedded device with a watchdog mechanism, and realizes stable debugging and running of the program on the embedded device; it can cover various common architectures of embedded devices such as ARM, MIPS, PPC, etc., and can run on various embedded architectures to realize firmware security protection, detect typical vulnerability attack processes in a dynamic debugging manner, and prevent vulnerability exploitation and block ROP chain attacks by tracking and detecting various typical vulnerability exploitation processes such as stack overflow, command execution vulnerability, and UAF vulnerability, covering various common vulnerabilities such as buffer overflow, UAF and command execution, and realizing real-time vulnerability alarm and automatic patch defense; it can increase cross-architecture support for the actual situation that the embedded device architecture is multiple and complex, and can adapt to the needs of different processor architectures, provide a unified and efficient security protection solution for embedded devices, reduce development costs, and improve security protection effects, and has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of a lightweight cross-architecture firmware security protection process based on a debugging agent in an embodiment;

[0031] Figure 2 The cross-architecture firmware security protection principle architecture in the embodiment is schematically illustrated. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and technical solutions.

[0033] In view of the current IoT device firmware security issues, the present invention embodiment, see Figure 1 As shown, a lightweight cross-architecture firmware security protection method based on a debugging agent is provided, comprising:

[0034] S101, obtaining a processor architecture of a target firmware, configuring inline assembly code according to the processor architecture, and generating target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used for cross-compilation according to the configuration at runtime.

[0035] During the inline assembly code configuration process, the inline assembly code alignment parameters are configured according to the processor architecture, and the processor architecture is ARM architecture, MIPS architecture, PPC architecture, or X86 architecture; based on the inline assembly code alignment parameters, a cross-compilation chain is constructed in the compiler, and target firmware debugging instructions are generated through cross-compilation.

[0036] Since the instruction sets and debugger programs of different architectures may be different, when performing cross-architecture real-time, the inline assembly code can be modified to adapt to different architectures and debugging environments, and cross-compilation can be performed to ensure that it can run correctly on various architectures.

[0037] Specifically, the processor architecture can be divided into a first architecture type that uses C language code to implement the debugging agent and a second architecture type that uses assembly language and C language code to implement the debugging agent; the architecture type alignment parameters are configured according to the processor architecture so that the compiler inline assembly code is generated when the architecture type alignment parameters are aligned.

[0038] Supports multiple architectures such as ARM, MIPS, PPC, and X86. Since the instruction sets and operating system kernel versions of different architectures are different, these differences need to be handled specially when developing across architectures. For debugging agents that can be fully implemented in C code, directly build a cross-compilation chain and compile to other architectures such as ARM and MIPS in the development environment of x86. However, for some shellcodes, functions such as saving context and inserting function jumps need to be completed, which requires a combination of assembly code and C language code. At this time, it is necessary to write independent platform code for different target architectures. For example, directly using call / ret under x86 can implement inserting jumps, but in the ARM architecture, the LR register saves the return address, and directly using the BL instruction will overwrite LR, resulting in a function call stack error. Therefore, in the ARM architecture, the value of LR needs to be saved in advance when entering the inserting function. This makes the debugging agent independent of the architecture, and only needs to be cross-compiled into the corresponding architecture program; while shellcode is designed for different architectures so that it can run on different processor architectures.

[0039] S102, using a debugging agent to receive and execute debugging instructions, and using the plug-in technology to configure monitoring points in the target firmware control flow to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions.

[0040] By modifying the instruction at the monitoring point, the target firmware control flow execution flow can jump to the free memory, collect and record the current program running status; and return the target firmware control flow to the next instruction in the original program of the target firmware at the monitoring point.

[0041] The instrumentation technology is used to modify the instructions at the breakpoint, control the program execution flow to jump to a free memory area, execute the injected shellcode, record the current program running status, execute the original instructions, and then return the control flow to the next instruction of the original program breakpoint, which can avoid the traditional interrupt processing mechanism and thus will not trigger the watchdog mechanism of the embedded device. Figure 2As shown, the debugging framework can be designed to include three core components: debugging front-end, debugging agent and shellcode, so as to achieve efficient, secure and lightweight code debugging.

[0042] The debugging front end is the interface for users to interact with the debugging system. It is responsible for receiving debugging commands input by users, such as setting breakpoints, reading and writing memory and registers, etc. These commands are parsed and standardized by the front end, converted into a unified format, and securely sent to the debugging agent through an encrypted network connection.

[0043] As the core of the framework, the debugging agent is responsible for receiving and executing commands from the front-end. It hijacks the control flow of the target process, performs breakpoint setting, memory reading and writing, and collects process status information, which is then encoded and fed back to the front-end. The design of the debugging agent ensures fast response and efficient execution of debugging commands while maintaining the stability of the target process.

[0044] Shellcode is the execution tool of the debugging framework, which is responsible for persisting control flow hijacking at breakpoints and saving and restoring register states. This ensures that the program can continue to execute seamlessly from the breakpoint after debugging operations, and provides the ability to perform detailed inspection and modification of the program in the breakpoint state.

[0045] After the user initiates a debugging command, the command flow starts from the front end, is transmitted to the debugging agent through the network, is decoded and executed by the agent, and performs necessary memory and register operations through shellcode. The operation results are captured, encoded and sent back to the front end by the debugging agent, and the front end decodes and displays the results to complete the entire debugging process.

[0046] S103: Check the target firmware for potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and perform early warning and defense response.

[0047] The non-interrupt breakpoint mechanism is implemented by using the plugging technology, and the cross-compilation technology is used to implement the cross-architecture debugging mechanism. In order to realize the vulnerability detection and security protection functions, the security defense technologies such as sensitive function context detection, randomized memory loading, and instruction disorder can be used, and the Canary mechanism, shadow stack technology, fine-grained memory permission supervision mechanism and other conventional security defense mechanisms are attached to monitor and protect the typical vulnerability attack process in real time.

[0048] During the debugging process, specific monitoring points can be configured to check for potential vulnerability exploitation behaviors, such as monitoring the calls of sensitive functions and their parameters; these monitoring points can analyze the behavior of the debugged program in real time, and once abnormal behavior is detected, countermeasures can be automatically taken, such as recording detailed information, suspending execution, or blocking potential vulnerability exploitation attempts.

[0049] Specifically, it is possible to verify whether the return address in the stack matches the saved address and whether the function parameters comply with the expected security constraints. If the address does not match or the function parameters do not comply with the expected security constraints, it is determined that the target firmware has potential stack overflow abnormal behavior information.

[0050] In order to enhance the protection capability against stack overflow vulnerabilities, the protection mechanism of the dynamic debug agent can be used to set breakpoints on key functions or instructions at runtime, and the debug agent is responsible for monitoring. When a function is called, the debug agent automatically copies and saves the current instruction address and the function's parameters to a secure memory area. Before the function returns, the debug agent verifies whether the return address in the stack matches the previously saved address, and checks whether the function's parameters meet the expected security constraints. If an inconsistent return address or an abnormal parameter is detected, this may mean that the stack space has been corrupted, and the debug agent will immediately trigger the exception handling process. This process includes recording detailed debugging information, terminating the current execution process, and even initiating predefined security response measures. In this way, not only can the execution of malicious code caused by stack overflow be prevented, but real-time security monitoring and response can also be provided, thereby significantly improving the security performance of the firmware.

[0051] Specifically, the security of the system call function can also be verified by checking the legality of the function parameters. If there is an abnormality in the system call function parameters, it is determined that the target firmware has potential abnormal command execution behavior information.

[0052] In order to effectively protect against command execution vulnerabilities, a dynamic debugging agent is used to monitor key points in the program execution process. The debugging agent has the ability to capture calls to operating system command execution functions in real time, such as the exec series of functions, and dynamically insert checkpoints before the function is executed.

[0053] When a potential system command execution request is captured, the debugging agent analyzes the request, extracts the system call parameters, and performs a series of security verifications on these parameters. The verification process includes checking the legitimacy of the parameter content to ensure that the input conforms to the expected format and does not contain any potential malicious payloads, such as attempts to execute additional commands or scripts.

[0054] If the debugging agent determines that the parameters are abnormal or contain malicious content, it will block the execution of the command and record the event. At the same time, the agent will trigger a security alarm mechanism to notify the system administrator or related security system so that further response measures can be taken in a timely manner.

[0055] In addition, the debugging agent can also perform necessary filtering or modification on parameters according to predefined security policies to ensure that only verified security parameters are passed to the system call, thereby allowing its execution. This approach not only increases the level of protection against malicious behavior, but also provides more flexible and fine-grained control, thereby greatly improving the firmware's ability to protect against command execution vulnerabilities.

[0056] Furthermore, metadata and a double-linked list structure can be used to record the memory block status, and the target firmware can be detected for potential abnormal behavior information of the memory space by tracking and detecting memory operations;

[0057] And / or, monitoring the frequency of the target firmware control flow executing the ret instruction, if the frequency exceeds a preset threshold, it is determined that the target firmware has potential ROP chain abnormal behavior information.

[0058] Use dynamic debugging agents to monitor memory operations to protect against UAF vulnerabilities. Maintain a metadata and double-linked list structure to record the status of each allocated memory block, including the size of the memory block, read, write and execute permissions, and a pointer list pointing to the memory block. Use an enhanced red-black tree to quickly query metadata and pointer structures.

[0059] The debug agent tracks and detects memory operations. Each time memory is allocated, the corresponding metadata is generated and the pointer is inserted into the linked list. When the pointer is released, the metadata record of the corresponding memory block is deleted. Before each read and write operation, it is checked whether the memory block is valid and has read and write permissions. Through this mechanism, even if the pointer in the program mistakenly attempts to access the memory after the memory is released, the debug agent will detect that the memory block is an invalid memory block and can prevent such illegal access, thereby effectively preventing the exploitation of UAF vulnerabilities. This method can not only monitor the memory status in real time, but also provide precise control over memory access, significantly improving the firmware's protection against UAF vulnerabilities.

[0060] The dynamic debugging agent successfully implements a blocking mechanism for ROP chain attacks. This mechanism relies on the debugging agent to monitor the key instructions of the program and has the ability to monitor the ret instruction in real time. Once it is found that the frequency of the program executing the ret instruction exceeds the set normal threshold, it can be determined that a ROP attack may have occurred and a corresponding protection response will be generated immediately. This protection method can significantly reduce the security risks caused by ROP attacks, thereby effectively improving the overall security of the firmware.

[0061] Furthermore, based on the above method, an embodiment of the present invention also provides a lightweight cross-architecture firmware security protection system based on a debugging agent, comprising: a compilation module, a debugging module and a protection module, wherein:

[0062] A compiling module, used to obtain the processor architecture of the target firmware, configure the inline assembly code according to the processor architecture and generate the target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used to perform cross-compilation according to the configuration at runtime;

[0063] A debugging module, which is used to receive and execute debugging instructions using a debugging agent, and configure monitoring points in the target firmware control flow using a plug-in technique to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions;

[0064] The protection module is used to check the target firmware's potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and perform early warning and defense response.

[0065] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0066] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0067] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.

[0068] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.

[0069] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A lightweight cross-architecture firmware security protection method based on debugging agent, It is characterized in that Include: Obtaining a processor architecture of the target firmware, configuring inline assembly code according to the processor architecture and generating target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used to perform cross-compilation according to the configuration at runtime; Utilize the debugging agent to receive and execute debugging instructions, and use the plugging technology to configure monitoring points in the target firmware control flow to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions; Check the target firmware's potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and issue an early warning and defense response.

2. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 1, It is characterized in that Adjust the inline assembly code according to the processor architecture and generate target firmware debugging instructions through cross compilation, including: The inline assembly code alignment parameters are configured according to the processor architecture, wherein the processor architecture is an ARM architecture, a MIPS architecture, a PPC architecture, or an X86 architecture; Based on the inline assembly code alignment parameters, a cross-compilation chain is built in the compiler, and target firmware debugging instructions are generated through cross-compilation.

3. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 2, It is characterized in that Configure the inline assembly code alignment parameters according to the processor architecture, including: Classifying the processor architecture into a first architecture type using C language code to implement the debug agent and a second architecture type using assembly language and C language code to implement the debug agent; Configures the architecture type alignment parameter according to the processor architecture to generate compiler inline assembly code when the architecture type alignment parameter is aligned.

4. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 1, It is characterized in that Use instrumentation technology to configure monitoring points in the target firmware control flow, including: Modify the instruction at the monitoring point so that the target firmware control flow execution flow jumps to the free memory, collects and records the current program running status; and returns the target firmware control flow to the next instruction in the original program of the target firmware at the monitoring point.

5. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 4, It is characterized in that Check the target firmware for potential abnormal behavior information based on the detected program running status, including: Verify whether the return address in the stack matches the saved address and whether the function parameters meet the expected security constraints. If the address does not match or the function parameters do not meet the expected security constraints, it is determined that the target firmware has potential stack overflow abnormal behavior information.

6. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 1, It is characterized in that Check the target firmware for potential abnormal behavior information based on the detected program running status, including: The security of the system call function is verified by checking the legitimacy of the function parameters. If there is an abnormality in the system call function parameters, it is determined that the target firmware has potential abnormal command execution behavior information.

7. The lightweight cross-architecture firmware security protection method based on debugging agent according to claim 1, It is characterized in that Check the target firmware for potential abnormal behavior information based on the detected program running status, including: The metadata and double-linked list structure are used to record the memory block status, and the target firmware is detected for potential abnormal behavior of memory space by tracking and detecting memory operations; And / or, monitoring the frequency of the target firmware control flow executing the ret instruction, if the frequency exceeds a preset threshold, it is determined that the target firmware has potential ROP chain abnormal behavior information.

8. A lightweight cross-architecture firmware security protection system based on debugging agent, It is characterized in that Contains: compilation module, debugging module and protection module, among which, A compiling module, used to obtain the processor architecture of the target firmware, configure the inline assembly code according to the processor architecture and generate the target firmware debugging instructions through cross-compilation, wherein the inline assembly code is used to perform cross-compilation according to the configuration at runtime; A debugging module, which is used to receive and execute debugging instructions using a debugging agent, and configure monitoring points in the target firmware control flow using a plug-in technique to detect the program running status at the monitoring points, wherein the monitoring points are non-interrupt breakpoints set at key functions or instructions; The protection module is used to check the target firmware's potential abnormal behavior information based on the detected program running status, determine the vulnerability type by triggering the exception handling process, and perform early warning and defense response.

9. An electronic device, It is characterized in that include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 can be implemented.

Citation Information

Cited By

  • Internet of Things firmware debugging method, system and equipment based on simulation

    CN119415413A

  • Debugging method and system of motion control code based on intelligent agent and storage medium

    CN122332254A