A debugging and analysis method for stack overflow vulnerabilities in MIPS instruction set programs

Through IDA plug-in and register initialization, combined with gadget fragments and payloads, convenient debugging and analysis and vulnerability exploitation of MIPS instruction set programs are achieved, solving the problem of debugging and analysis difficulties in the existing technology and improving vulnerability utilization efficiency.

CN112347487BActive Publication Date: 2025-01-17HANGZHOU DBAPPSECURITY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011377403.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2025-01-17
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

The prior art is difficult to debug and analyze the MIPS instruction set program easily, especially in bare metal firmware programs that lack third-party library environments or no operating system. The offset fill amount cannot be effectively determined, resulting in difficulty in exploiting vulnerabilities.

Method used

By using the IDA plug-in to load the MIPS instruction set program, set the memory space segment, initialize the registers, determine the target assembly code, obtain the gadget fragment, construct the target ROP chain, use the payload to achieve stack overflow vulnerability exploit, and obtain shell permissions.

Benefits of technology

It realizes convenient debugging and analysis of MIPS instruction set programs, obtains offset fill volume, improves vulnerability utilization efficiency, is suitable for programs lacking third-party library environments or no operating system, and reduces the complexity and time of manually constructing ROP chains. Consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112347487B_ABST
    Figure CN112347487B_ABST
Patent Text Reader

Abstract

The present application discloses a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program, including: using an IDA plug-in to load a MIPS instruction set program, and setting a memory space segment for the IDA plug-in; determining the target assembly code to be detected from the MIPS instruction set program, and setting the target assembly code in the memory space segment; initializing and assigning values ​​to registers to implement debugging and analysis of the target assembly code, and determining the offset padding of the MIPS instruction set program. The present method is not limited by a third-party library environment or an operating system, that is, the present method can debug and analyze programs that lack a third-party library environment or programs of bare metal firmware without an operating system, and can improve the convenience of determining the offset padding of a MIPS instruction set program. The present application also discloses a debugging and analysis device, equipment, and storage medium for a stack overflow vulnerability of a MIPS instruction set program, all of which have the above-mentioned beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vulnerability detection, and in particular to a debugging and analysis method, device, equipment and computer-readable storage medium for a stack overflow vulnerability of a MIPS instruction set program. Background Art

[0002] The MIPS (Million Instructions Per Second) architecture is a processor architecture that uses a reduced instruction set computing (RISC), and is commonly used in some embedded devices, such as smart IOT (Internet of things) devices, smart routers, smart cameras, etc. In the scenario of debugging and analyzing the assembly code of the MIPS architecture, it is necessary to analyze the logic of the assembly code, derive the deep logic of the assembly code, determine the offset padding of the MIPS instruction set program, and then exploit the vulnerability.

[0003] At present, MIPS instruction set programs cannot be directly run on PCs (Personal Computers) on X86 platforms. Therefore, existing dynamic debugging technologies for MIPS instruction set programs all rely on the QEMU simulator (virtual operating system simulator); and the simulation running debugging of the QEMU simulator can only target a single process. For some programs that lack the corresponding third-party library environment, or some bare metal firmware (such as firmware U-Boot) programs without an operating system, the QEMU simulator cannot be used normally for debugging and analysis, and thus the offset padding of the MIPS instruction set program cannot be easily determined, which brings difficulties to debugging and analysis and vulnerability exploitation.

[0004] Therefore, how to debug and analyze the MIPS instruction set program more conveniently and obtain the offset filling amount is a technical problem that technical personnel in this field need to solve at present. Summary of the invention

[0005] In view of this, an object of the present invention is to provide a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program, which can more conveniently debug and analyze the MIPS instruction set program and obtain the offset filling amount; another object of the present invention is to provide a debugging and analysis device, equipment and computer-readable storage medium for a stack overflow vulnerability of a MIPS instruction set program, all of which have the above-mentioned beneficial effects.

[0006] In order to solve the above technical problems, the present invention provides a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program, comprising:

[0007] Loading a MIPS instruction set program using an IDA plug-in, and setting a memory space segment for the IDA plug-in;

[0008] Determine the target assembly code to be detected from the MIPS instruction set program, and set the target assembly code in the memory space segment;

[0009] Initialize and assign values ​​to registers to implement debugging and analysis of the target assembly code and determine the offset filling amount of the MIPS instruction set program.

[0010] Preferably, it further comprises:

[0011] Use the preset plug-in to obtain the gadget fragment;

[0012] Determine a target ROP chain using a plurality of the gadget fragments;

[0013] Determine a corresponding load according to the target ROP chain and the offset fill amount;

[0014] The payload is used to exploit the stack overflow vulnerability and obtain shell permissions.

[0015] Preferably, the process of using the payload to exploit a stack overflow vulnerability and obtain shell permissions specifically includes:

[0016] The shellcode assembly code is executed to utilize the payload to exploit a stack overflow vulnerability and obtain the shell permission.

[0017] Preferably, the process of using the payload to exploit a stack overflow vulnerability and obtain shell permissions specifically includes:

[0018] The system function is executed to utilize the payload to exploit a stack overflow vulnerability and obtain the shell permission.

[0019] Preferably, after the registers are initialized and assigned values ​​to implement debugging and analysis of the target assembly code and determining the offset filling amount of the MIPS instruction set program, the method further includes:

[0020] The offset fill amount is recorded.

[0021] Preferably, after the registers are initialized and assigned values ​​to implement debugging and analysis of the target assembly code and determining the offset filling amount of the MIPS instruction set program, the method further includes:

[0022] Issue a corresponding prompt message.

[0023] In order to solve the above technical problems, the present invention also provides a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program, comprising:

[0024] A preset module is used to load a MIPS instruction set program using an IDA plug-in and set a memory space segment for the IDA plug-in;

[0025] A setting module, used for determining the target assembly code to be detected from the MIPS instruction set program, and setting the target assembly code in the memory space segment;

[0026] The detection module is used to initialize and assign values ​​to registers to implement debugging and analysis of the target assembly code and determine the offset filling amount of the MIPS instruction set program.

[0027] In order to solve the above technical problems, the present invention also provides a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program, comprising:

[0028] Memory for storing computer programs;

[0029] The processor is used to implement the steps of the debugging and analysis method for stack overflow vulnerabilities of any of the above-mentioned MIPS instruction set programs when executing the computer program.

[0030] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the debugging and analysis method for the stack overflow vulnerability of any of the above-mentioned MIPS instruction set programs are implemented.

[0031] A debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program provided by the present invention is to set a target assembly code that needs to be detected in the MIPS instruction set program in a memory space segment of an IDA plug-in, and to perform debugging and analysis on the target assembly code by initializing and assigning values ​​to registers, thereby obtaining an offset padding amount of the MIPS instruction set program; the method is not limited by a third-party library environment or an operating system, that is, the method can perform debugging and analysis on a program that lacks a third-party library environment or a bare metal firmware program without an operating system, and can improve the convenience of determining the offset padding amount of the MIPS instruction set program.

[0032] In order to solve the above technical problems, the present invention also provides a debugging and analysis device, equipment and computer-readable storage medium for stack overflow vulnerabilities of MIPS instruction set programs, all of which have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0034] Figure 1 A flowchart of a method for debugging and analyzing a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention;

[0035] Figure 2 A flow chart for determining a target ROP chain provided by an embodiment of the present invention;

[0036] Figure 3 Another flow chart for determining a target ROP chain provided by an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of a process for determining a target ROP chain provided by an embodiment of the present invention;

[0038] Figure 5 A structural diagram of a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention;

[0039] Figure 6 A structural diagram of a debugging and analysis device for a stack overflow vulnerability of a MIPS instruction set program provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] The core of an embodiment of the present invention is to provide a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program, which can more conveniently debug and analyze the MIPS instruction set program to obtain the offset filling amount; another core of the present invention is to provide a debugging and analysis device, equipment and computer-readable storage medium for a stack overflow vulnerability of a MIPS instruction set program, all of which have the above-mentioned beneficial effects.

[0042] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0043] Figure 1A flowchart of a method for debugging and analyzing a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention. Figure 1 As shown, a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program includes:

[0044] S10: Use the IDA plug-in to load the MIPS instruction set program and set the memory space segment for the IDA plug-in;

[0045] S20: Determine the target assembly code to be detected from the MIPS instruction set program, and set the target assembly code in the memory space segment.

[0046] First of all, it should be noted that IDA plug-ins such as IDA Pro are interactive, programmable, and scalable multi-processor tools that can analyze programs across Windows, Linux, and MacOS platform hosts. They are recognized as the best debugging analysis and vulnerability exploitation tools that money can buy. IDA Pro has become the de facto standard for analyzing hostile code, and has quickly become an important tool in the field of attack research; it supports dozens of CPU instruction sets, including Intel x86, x64, MIPS, PowerPC, ARM, Z80, 68000, c8051, etc.; IDA Pro supports plug-in expansion.

[0047] In actual operation, after the IDA plug-in loads the MIPS instruction set program and performs code initialization analysis, the IDA plug-in is manually loaded dynamically. Due to its characteristics based on the unicorn engine simulation environment, the IDA plug-in needs to initialize the virtual environment and set the basic memory space segments such as code segment, data segment, and stack segment for the IDA plug-in. It should be noted that unicorn is a multi-platform, multi-architecture CPU (Central Processing Unit) simulation framework, developed based on the QEMU simulator, and supports CPU architectures including Arm, Arm64 (Armv8), M68K, Mips, Sparc, and X86 (include X86_64); its advantage is that it can simulate any assembly code within the supported instruction architecture, and can support dynamic hooks and patches during the simulation execution process, and output the results.

[0048] Then, the target assembly code that needs to be detected in the MIPS instruction set program is determined, that is, the target assembly code that needs to be simulated, and then the bytecode of the target assembly code is read out and copied to the code segment of the pre-set IDA plug-in.

[0049] S30: Initialize and assign values ​​to registers to implement debugging and analysis of the target assembly code and determine the offset filling amount of the MIPS instruction set program.

[0050] Specifically, after the target assembly code is set in the code segment in the memory space segment of the IDA plug-in, the registers to be used are initialized and assigned accordingly. It should be noted that if the simulated target assembly code is located at the beginning of the function, the process of initializing and assigning values ​​to the r0, r1, and r2 registers is equivalent to assigning values ​​to the function parameters, which is similar to manually passing parameters to the function. At this time, the effect of debugging and analyzing a specific function in the target assembly code is achieved, and the intermediate results of the target assembly code running and the specific values ​​of the registers and memory segments are obtained, thereby determining the offset padding of the MIPS instruction set program.

[0051] More specifically, first specify the format of the parameter content according to the original input, that is, initialize and assign values ​​to the r0, r1, and r2 registers. When the simulation is executed to the vulnerability point (such as the stack overflow position of the strcpy function), regardless of whether the overflow is triggered or the return address is overwritten, let the program continue to simulate until it reaches the end of the function; monitor the behavior of the program and check the return address corresponding to the current function; determine whether the return address is an illegal value; if not, that is, the return address is a legal value, indicating that the return address is not overwritten, then continue to mutate the original input data, increase the length of the input data, and re-simulate the vulnerable function, and repeat this step until it is detected that the return address at the end of the function is an illegal value, that is, the mutated input value, then record the input data and the offset padding of this controllable input to the return address, and the offset padding is the length of the input to the return address that triggers the stack overflow.

[0052] It should also be noted that during the process of debugging and analyzing the target assembly code, the IDA plug-in supports the use of hook technology to dynamically hook certain registers and memory data, and can also perform instruction-level patching on the target assembly code that needs to be simulated to achieve more convenient debugging.

[0053] A debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention is to set a target assembly code that needs to be detected in the MIPS instruction set program in a memory space segment of an IDA plug-in, and to debug and analyze the target assembly code by initializing and assigning values ​​to registers, thereby obtaining the offset padding of the MIPS instruction set program; the method is not limited by a third-party library environment or an operating system, that is, the method can debug and analyze programs that lack a third-party library environment or programs of bare metal firmware without an operating system, and can improve the convenience of determining the offset padding of the MIPS instruction set program.

[0054] It should be noted that in the process of exploiting the stack overflow vulnerability of the MIPS instruction set architecture, ROP technology is used to exploit the vulnerability. By constructing a target ROP chain, the program is allowed to execute the corresponding shellcode assembly code or execute system commands to achieve the stack overflow vulnerability exploitation. However, the target ROP chain for the MIPS instruction set is currently constructed manually, which is time-consuming, cumbersome and inefficient, resulting in low efficiency in vulnerability exploitation.

[0055] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, this embodiment further includes:

[0056] Use the preset plug-in to obtain the gadget fragment;

[0057] Using multiple gadget fragments, we can determine the target ROP chain.

[0058] Specifically, in this step, the preset plug-in may be an open source mipsrop plug-in.

[0059] like Figure 2 As shown, a flow chart for determining a target ROP chain provided by an embodiment of the present invention. In actual operation, the final result of the whole process is to jump to the stack to execute the shellcode code. If the shellcode code is to be executed on the stack, the sleep function needs to be executed first to refresh the CPU cache space. According to each step, all the gadget fragments obtained by using the mipsrop plug-in are stored, and the addresses of the available gadget fragments in each step are combined. These combinations are gradually simulated by the dynamic simulation instruction execution function of the IDA plug-in to simulate the assembly code. During the simulation, the stack filling amount and the shellcode generation rules are automatically determined. After the simulation is completed, various factors (such as the payload length required to be input and the complexity of the ROP chain) are used to comprehensively judge, determine, and select some more appropriate path information to determine the target ROP chain.

[0060] like Figure 3 As shown, another flow chart for determining the target ROP chain provided by an embodiment of the present invention is provided. Specifically, firstly, the gadget fragment obtained by executing the mipsrop.system() function is obtained, and the required padding amount on the stack is automatically determined according to the obtained gadget fragment, and then the system function is executed. After the simulation execution is completed, the corresponding path information and stack padding amount in the simulation process are recorded, and the better path information is determined, that is, the target ROP chain is obtained. Figure 4A schematic diagram of a process for determining a target ROP chain provided by an embodiment of the present invention. In this embodiment, different paths are obtained through multiple gadget fragments, and the optimal path is determined according to all available path information, that is, the target ROP chain is obtained.

[0061] Determine the corresponding load based on the target ROP chain and the offset fill amount;

[0062] Use the payload to exploit the stack overflow vulnerability and obtain shell permissions.

[0063] Specifically, in this embodiment, the corresponding payload is determined based on the offset padding amount corresponding to the stack overflow vulnerability determined by using the IDA plug-in.

[0064] After determining the offset padding amount and the target ROP chain of the stack overflow, the corresponding payload is determined according to the offset padding amount and the target ROP chain; the determined payload is then input into the program to run, so as to exploit the stack overflow vulnerability and obtain shell permissions.

[0065] It can be seen that by obtaining the target ROP chain in the manner of this embodiment, manual operation can be avoided, the operation is convenient, human resources can be saved, operation time can be saved, the efficiency of obtaining the target ROP chain can be improved, and the efficiency of vulnerability exploitation can be further improved.

[0066] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, the process of using the payload to exploit the stack overflow vulnerability and obtain shell permissions specifically includes:

[0067] By executing the shellcode assembly code to exploit the payload to implement the stack overflow vulnerability, shell permissions are obtained.

[0068] As another preferred implementation, the process of using the payload to exploit the stack overflow vulnerability and obtain shell permissions specifically includes:

[0069] By executing the system function to use the payload to exploit the stack overflow vulnerability, shell permissions are obtained.

[0070] It should be noted that in the process of exploiting the stack overflow vulnerability of the MIPS instruction set architecture, there are generally two ways to obtain shell permissions. One is to obtain shell permissions by executing the shellcode assembly code to call the execve function or call the rebound shell function; the other is to obtain shell permissions by executing the system function that comes with the program.

[0071] It should be noted that in actual operation, the specific method of exploiting the stack overflow vulnerability needs to be determined according to the type of vulnerability point. Specifically, if the vulnerability is caused by some string copying functions (such as strcpy function), these functions will use \x00 as the end mark of the copy. Because the high byte address of the current program memory space is \x00, when constructing the payload, the address of the current program memory space cannot be entered as the gadget. In this case, it often jumps to the memory address space of libc to execute the shellcode; if the vulnerability is caused by byte copying of the pointer, \x00 bytes can be copied. The vulnerability exploitation in this case is relatively simple. Just find the gadget in the current program memory space and execute the system function.

[0072] It can be seen that the implementation method of the stack overflow vulnerability exploitation provided by this embodiment has a convenient and easy operation process.

[0073] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, after initializing and assigning values ​​to registers to debug and analyze the target assembly code and determine the offset padding amount of the MIPS instruction set program, this embodiment further includes:

[0074] Record the offset fill amount.

[0075] Specifically, in this embodiment, after the registers are initialized and assigned values ​​to debug and analyze the target assembly code and determine the offset padding of the MIPS instruction set program, the determined offset padding is further recorded. It should be noted that in actual operation, the specific recording method can be in the form of text, Excel spreadsheet, or database table. This embodiment does not limit this and is selected according to actual needs. More specifically, it can be stored in a memory stick, hard disk, TF (Trans-flash Card) card, SD (Secure Digital Memory Card) card, etc., which is selected according to actual needs and is not limited in this embodiment.

[0076] In this embodiment, by further recording the offset filling amount, it is convenient for operation and maintenance personnel to view the specific circumstances that cause the stack overflow vulnerability, thereby further improving the user experience.

[0077] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, after initializing and assigning values ​​to registers to debug and analyze the target assembly code and determine the offset padding amount of the MIPS instruction set program, this embodiment further includes:

[0078] Issue a corresponding prompt message.

[0079] Specifically, in this embodiment, after the offset filling amount of the MIPS instruction set program is determined, the prompt device is further triggered to send corresponding prompt information to prompt the user to determine the offset filling amount corresponding to the MIPS instruction set program.

[0080] It should be noted that, in the present embodiment, the prompt device may specifically be a buzzer and / or an indicator light and / or a display, which may trigger the buzzer / indicator light / display and other prompt devices to issue corresponding prompt information, such as a buzzer sound / flashing light / displaying text or images, etc., to intuitively prompt the user of the current situation of determining the offset fill amount corresponding to the MIPS instruction set program, thereby further enhancing the user experience.

[0081] The above describes in detail an embodiment of a debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program provided by the present invention. The present invention also provides a debugging and analysis device, equipment and computer-readable storage medium for a stack overflow vulnerability of a MIPS instruction set program corresponding to the method. Since the embodiments of the device, equipment and computer-readable storage medium parts correspond to the embodiments of the method part, the embodiments of the device, equipment and computer-readable storage medium parts refer to the description of the embodiments of the method part, and will not be repeated here.

[0082] Figure 5 A structural diagram of a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention, such as Figure 5 As shown, a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program includes:

[0083] A preset module 51 is used to load a MIPS instruction set program using an IDA plug-in and set a memory space segment for the IDA plug-in;

[0084] A setting module 52, used for determining the target assembly code to be detected from the MIPS instruction set program, and setting the target assembly code in the memory space segment;

[0085] The detection module 53 is used to initialize and assign values ​​to registers to implement debugging and analysis of the target assembly code and determine the offset filling amount of the MIPS instruction set program.

[0086] The debugging and analyzing device for stack overflow vulnerabilities of MIPS instruction set programs provided by the embodiment of the present invention has the beneficial effects of the debugging and analyzing method for stack overflow vulnerabilities of MIPS instruction set programs described above.

[0087] As a preferred embodiment, a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program further comprises:

[0088] The acquisition module is used to obtain the gadget fragment using the preset plug-in;

[0089] A first determination module is used to determine a target ROP chain using multiple gadget fragments;

[0090] A second determination module is used to determine a corresponding payload according to a target ROP chain and an offset fill amount;

[0091] Vulnerability exploitation module, used to exploit stack overflow vulnerability using payload and obtain shell permissions.

[0092] As a preferred embodiment, a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program further comprises:

[0093] A recording module is used to record the offset filling amount.

[0094] As a preferred embodiment, a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program further comprises:

[0095] The prompt module is used to initialize and assign values ​​to registers to implement debugging and analysis of target assembly code, and to issue corresponding prompt information after determining the offset filling amount of the MIPS instruction set program.

[0096] Figure 6 A structural diagram of a debugging and analysis device for a stack overflow vulnerability of a MIPS instruction set program provided by an embodiment of the present invention, such as Figure 6 As shown, a debugging and analyzing device for a stack overflow vulnerability of a MIPS instruction set program includes:

[0097] A memory 61, used for storing computer programs;

[0098] The processor 62 is used to implement the steps of the debugging and analyzing method for stack overflow vulnerabilities of MIPS instruction set programs when executing computer programs.

[0099] The debugging and analyzing device for stack overflow vulnerabilities of MIPS instruction set programs provided by the embodiment of the present invention has the beneficial effects of the debugging and analyzing method for stack overflow vulnerabilities of MIPS instruction set programs described above.

[0100] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the debugging and analysis method for the stack overflow vulnerability of the MIPS instruction set program as mentioned above are implemented.

[0101] The computer-readable storage medium provided by the embodiment of the present invention has the beneficial effect of the above-mentioned method for debugging and analyzing stack overflow vulnerabilities of MIPS instruction set programs.

[0102] The debugging and analysis method, device, equipment and computer-readable storage medium for the stack overflow vulnerability of the MIPS instruction set program provided by the present invention are introduced in detail above. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0103] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device 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 description.

[0104] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in 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. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

Claims

1. A debugging and analysis method for a stack overflow vulnerability of a MIPS instruction set program, characterized in that: include: Loading a MIPS instruction set program using an IDA plug-in, and setting a memory space segment for the IDA plug-in; Determine the target assembly code to be detected from the MIPS instruction set program, and set the target assembly code in the memory space segment; Initializing and assigning values ​​to registers to implement debugging and analysis of the target assembly code and determine the offset filling amount of the MIPS instruction set program; Further including: Use the preset plug-in to obtain the gadget fragment; Determine a target ROP chain using a plurality of the gadget fragments; Determine a corresponding load according to the target ROP chain and the offset fill amount; The payload is used to exploit the stack overflow vulnerability and obtain shell permissions.

2. The method according to claim 1, characterized in that The process of using the payload to exploit the stack overflow vulnerability and obtain shell permissions specifically includes: The shellcode assembly code is executed to utilize the payload to exploit a stack overflow vulnerability and obtain the shell permission.

3. The method according to claim 1, characterized in that: The process of using the payload to exploit the stack overflow vulnerability and obtain shell permissions specifically includes: The system function is executed to utilize the payload to exploit a stack overflow vulnerability and obtain the shell permission.

4. The method according to claim 1, characterized in that After the registers are initialized and assigned values ​​to implement debugging and analysis of the target assembly code and the offset filling amount of the MIPS instruction set program is determined, the method further includes: The offset fill amount is recorded.

5. The method according to any one of claims 1 to 4, characterized in that: After the registers are initialized and assigned values ​​to implement debugging and analysis of the target assembly code and the offset filling amount of the MIPS instruction set program is determined, the method further includes: Issue a corresponding prompt message.

6. A debugging and analysis device for stack overflow vulnerabilities of MIPS instruction set programs, characterized in that: include: A preset module is used to load a MIPS instruction set program using an IDA plug-in and set a memory space segment for the IDA plug-in; A setting module, used for determining the target assembly code to be detected from the MIPS instruction set program, and setting the target assembly code in the memory space segment; A detection module, used for initializing and assigning values ​​to registers, so as to debug and analyze the target assembly code and determine the offset filling amount of the MIPS instruction set program; Further including: The acquisition module is used to obtain the gadget fragment using the preset plug-in; A first determination module, configured to determine a target ROP chain using a plurality of the gadget fragments; A second determination module is used to determine a corresponding load according to the target ROP chain and the offset filling amount; The vulnerability exploitation module is used to exploit the stack overflow vulnerability using the payload and obtain shell permissions.

7. A debugging and analysis device for stack overflow vulnerabilities of MIPS instruction set programs, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for debugging and analyzing a stack overflow vulnerability of a MIPS instruction set program as claimed in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for debugging and analyzing a stack overflow vulnerability of a MIPS instruction set program as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for applying buffer overflowing on Intel-and-Linux64-integrated platform

    CN107480523A