Operating system threat detection method, device, electronic device and storage medium

By comparing and disassembly analyzing the jump instructions of the operating system, the problem of jumping instructions that cannot be saved in the database in the existing technology is solved, which improves the accuracy and efficiency of system threat detection and reduces errors Rate of return.

CN114329446BActive Publication Date: 2024-11-05QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111333224.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2024-11-05
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

In the prior art, only the instruction jump information that is passed through static analysis is stored in the database, and information that cannot be static analysis is not saved, resulting in a high false alarm rate of system threat detection. How to improve the system threat detection effect is a technical problem that needs to be solved urgently .

Method used

By collecting jump instructions generated by the target operation of the operating system, comparing them with the jump instruction database of the operating system, determining the starting address and target address offset of the jump instruction. If it does not match, it is determined that there is a threat and When the operating system is in a trusted state, use C language to analyze the code area, and use the capstone disassembly engine to output the jump instruction database to improve detection accuracy.

Benefits of technology

It realizes the reduction of false alarm rate while ensuring the threat detection rate, and improves the accuracy and efficiency of operating system threat detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329446B_ABST
    Figure CN114329446B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an operating system threat detection method, device, electronic device and storage medium, which are applied to electronic devices, and the method includes: collecting jump instructions generated by target operations on the operating system of the electronic device; comparing the jump instructions with jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: jump instruction data in the operating system extracted when the operating system is in a trusted state; when the jump instruction does not match the jump instruction data in the jump instruction database, determining that there is a threat in the operating system. The present invention can detect whether there is a threat in the operating system, and reduce the false alarm rate under the premise of ensuring the threat detection rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network equipment, and in particular to an operating system threat detection method, device, electronic equipment and storage medium. Background Art

[0002] With the development of computer technology, data in the system is stored in the database in various ways.

[0003] In the related art, the database is made by statically analyzing the relevant modules in the system using static decompilation software (Interactive Disassembler Professional, IDA) to extract the instruction jump information in the system. However, the database only stores the instruction jump information that has been statically analyzed, and does not store the instruction jump information that cannot be statically analyzed. This results in a high false alarm rate when detecting whether there is a threat in the system. In view of this, how to improve the detection effect of system threats is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the problems in the related art, embodiments of the present invention provide an operating system threat detection method, device, electronic device and storage medium.

[0005] Specifically, the embodiment of the present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides an operating system threat detection method, which is applied to an electronic device, and the method includes:

[0007] Collecting jump instructions generated by target operations of the operating system of the electronic device;

[0008] Comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state;

[0009] When the jump instruction does not match the jump instruction data in the jump instruction database, it is determined that there is a threat in the operating system.

[0010] Furthermore, the jump instruction data includes at least one of the following:

[0011] Jump instruction pair array, indirect jump instruction array, sub-function call instruction array and return value instruction array.

[0012] Further, in the case where the jump instruction data includes the return value instruction array, comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system includes:

[0013] Compare the starting address from address offset of the jump instruction with the return value instruction array in the jump instruction database;

[0014] When the from address offset of the jump instruction is found in the return value instruction array, the target address to address offset of the jump instruction is matched with the next sub-function call instruction of the sub-function call instruction in the target stack currently used by the user;

[0015] If not, it is determined that the jump instruction does not match the return value instruction array.

[0016] Furthermore, the method further comprises:

[0017] In the case where the jump instruction matches the sub-function call instruction array in the jump instruction database, the from address offset of the jump instruction is written into the target stack.

[0018] Furthermore, before comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system, the method further includes:

[0019] Converting the from address and the to address of the jump instruction to offsets respectively; if converting the from address of the jump instruction to offset fails, or converting the to address of the jump instruction to offset fails, determining that there is a threat in the operating system;

[0020] When the from address and the to address of the jump instruction are respectively shifted, searching the jump instruction database of the operating system for a target module corresponding to the from address offset or the to address offset of the jump instruction; when the target module corresponding to the from address offset or the to address offset of the jump instruction is not found in the jump instruction database, determining that there is a threat in the operating system;

[0021] Alternatively, when a target module corresponding to the from address offset and to address offset of the jump instruction is found in the jump instruction database of the operating system, a function corresponding to the from address offset or to address offset of the jump instruction is searched in the target module of the jump instruction database; when a function corresponding to the from address offset or to address offset of the jump instruction is not found in the target module of the jump instruction database, it is determined that there is a threat in the operating system.

[0022] Furthermore, before collecting the jump instruction generated by the target operation of the operating system of the electronic device, the method further includes:

[0023] When the operating system is in a trusted state, using C language to analyze the image of the operating system to identify the code area of ​​the operating system;

[0024] The capstone disassembly engine is used to disassemble the code area of ​​the operating system, and the jump instruction database of the operating system is output.

[0025] In a second aspect, an embodiment of the present invention further provides an operating system threat detection device, comprising:

[0026] A collection module, used for collecting jump instructions generated by target operations of the operating system of the electronic device;

[0027] A first comparison module, used to compare the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state;

[0028] The first determination module is used to determine that there is a threat in the operating system when the jump instruction does not match the jump instruction data in the jump instruction database.

[0029] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the operating system threat detection method described in the first aspect are implemented.

[0030] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the operating system threat detection method described in the first aspect.

[0031] In a fifth aspect, an embodiment of the present invention further provides a computer program product having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the steps of the operating system threat detection method described in the first aspect.

[0032] The operating system threat detection method provided by the embodiment of the present invention compares the jump instruction generated by the collected target operation with the jump instruction data in the jump instruction database to determine whether the jump instruction is a normal jump or an abnormal jump in the operating system, and then detects whether there is a threat currently in the operating system, thereby reducing the false alarm rate while ensuring the threat detection rate. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0034] Figure 1 One of the flow charts of the operating system threat detection method provided by the present invention;

[0035] Figure 2 The second flowchart of the operating system threat detection method provided by the present invention;

[0036] Figure 3 The third flowchart of the operating system threat detection method provided by the present invention;

[0037] Figure 4 The fourth flowchart of the operating system threat detection method provided by the present invention;

[0038] Figure 5 A schematic diagram of the structure of the operating system threat detection device provided by the present invention;

[0039] Figure 6 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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] Figure 1 One of the flow charts of the operating system threat detection method provided by the present invention is as follows: Figure 1 As shown, the method includes steps 110-130:

[0042] Step 110: collecting jump instructions generated by target operations of the operating system of the electronic device.

[0043] It should be noted that the operating system threat detection method provided by the present invention can be applied to operating system threat detection scenarios, for example, detecting operating system threats in a class operating system (Linux) to achieve trusted environment detection. The execution subject of the operating system threat detection method provided by the present invention can be an operating system threat detection device, for example, a desktop computer or a server, or a control module in the operating system threat detection device for executing the operating system threat detection method.

[0044] Optionally, the operating system may be a Linux system, a Windows operating system, or other operating systems. The target operation includes at least one of the following: a file operation, a network operation, a process operation, and a thread operation. The jump instruction includes at least one of the following: a jump instruction pair array, an indirect jump instruction array, a sub-function call instruction array, and a return value instruction array.

[0045] Step 120, comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state.

[0046] In practice, the jump instruction database is a jump instruction database obtained by the electronic device by extracting a driver file in an operating system in a trusted state, obtaining the jump instructions in the driver file and storing them, and the jump instruction database contains jump instructions.

[0047] Optionally, the jump instruction data includes at least one of the following: a jump instruction pair array, an indirect jump instruction array, a sub-function call instruction array, and a return value instruction array.

[0048] Optionally, the addresses of the collected jump instructions generated for the target operation of the operating system are compared with the addresses in the jump instruction data in the jump instruction database.

[0049] Step 130: When the jump instruction does not match the jump instruction data in the jump instruction database, it is determined that there is a threat in the operating system.

[0050] Optionally, if the addresses of the jump instructions generated by the target operation of the operating system are compared with the addresses in the jump instruction data in the jump instruction database, the addresses in the jump instruction data in the jump instruction database do not have the addresses corresponding to the jump instructions generated by the target operation of the operating system, thereby determining that there is a threat in the system operating system. For example, the threat may include hidden modules, unaudited modules, HOOKs, injections, etc. in the operating system.

[0051] The operating system threat detection method provided by the present invention compares the jump instruction generated by the collected target operation with the jump instruction data in the jump instruction database, determines whether the jump instruction is a normal jump or an abnormal jump in the operating system, and then detects whether there is a threat currently in the operating system, thereby reducing the false alarm rate while ensuring the threat detection rate.

[0052] Figure 2 The second flowchart of the operating system threat detection method provided by the present invention is as follows: Figure 2 As shown, the method includes steps 210-250:

[0053] Step 210: collecting jump instructions generated by target operations of the operating system of the electronic device.

[0054] Step 220, compare the starting address from address offset of the jump instruction with the return value instruction array in the jump instruction database.

[0055] Optionally, the starting address from address offset refers to the address obtained by subtracting the from address of the jump instruction from the base address of the target module corresponding to the jump instruction, wherein the base address is the address of the target module corresponding to the jump instruction before the jump.

[0056] In practice, only the starting address from of the jump address is saved in the return instruction array. Therefore, the starting address from address offset of the jump instruction can be compared with the return instruction data in the jump instruction database.

[0057] Step 230, when the from address offset of the jump instruction is found in the return value instruction array, the target address to address offset of the jump instruction is matched with the next sub-function call instruction of the sub-function call instruction in the target stack currently used by the user.

[0058] Optionally, the target address to address offset refers to the address obtained by subtracting the to address of the jump instruction from the base address of the module corresponding to the jump instruction.

[0059] Optionally, at least two sub-function call instructions are recorded in the target stack. When the from address offset of the jump instruction is found from the return instruction array, the from address offset of the jump instruction is read to see if it is a call instruction. If so, the call instruction is allowed to enter the target stack and saved. At this time, for the call instruction, there is a return value (return, ret) instruction corresponding to it. When the ret instruction exists, the target address to address offset of the jump instruction is compared with the next instruction address of the sub-function call instruction at the top of the stack in the target stack, and the target address to address offset is compared to see if the instruction corresponding to the jump to the starting address from address is the next address of the call instruction.

[0060] Step 240: If there is no match, it is determined that the jump instruction does not match the return value instruction array.

[0061] Optionally, the target address to address offset of the jump instruction jumps to the instruction corresponding to the starting address from address which is not the next address of the call instruction, that is, the to address offset of the jump instruction does not match the address of the next sub-function call instruction of the sub-function call instruction in the target stack, then it is determined that the jump instruction does not match the return value instruction array, thereby determining that there is a threat in the operating system.

[0062] Step 250: When the jump instruction does not match the jump instruction data in the jump instruction database, it is determined that there is a threat in the operating system.

[0063] The operating system threat detection method provided by the present invention matches the starting address from address offset of the jump instruction with the return value instruction array in the jump instruction database, and then matches the target address to address offset of the jump instruction with the next sub-function call instruction address of the sub-function call instruction in the target stack. If there is no match, it is determined that the jump instruction does not match the return value instruction array, and the existence of threats in the operating system is detected, thereby reducing the false alarm rate while ensuring the threat detection rate.

[0064] Optionally, when the jump instruction matches the sub-function call instruction array in the jump instruction database, the from address offset of the jump instruction is written into the target stack.

[0065] Specifically, when the jump instruction matches the sub-function call instruction array in the jump instruction database, the jump instruction is determined to be a normal jump. At this time, the from address offset of the jump instruction can be written into the target stack and stored for the next threat detection of the operating system.

[0066] Optionally, Figure 3 The third flow chart of the operating system threat detection method provided by the present invention is as follows: Figure 3As shown, taking the collected jump instruction generated by the target operation of the operating system of the electronic device as an example, for example, the jump instruction includes a from address and a to address, and the from address and the to address of the jump instruction are offset respectively.

[0067] Specifically, the offset transfer refers to subtracting the from address and to address of the jump instruction from the base address of the module to which the jump instruction belongs, respectively, to obtain the offset address of the from address and to address transfer, that is, completing the from address transfer and to address transfer of the jump instruction. In the case where the from address transfer of the jump instruction fails, or the to address transfer of the jump instruction fails, it indicates that there is a hidden module in the operating system, and then determines that there is a threat in the operating system; or, in the case where the from address and to address of the jump instruction complete the transfer of the offset, the target module corresponding to the from address offset or to address offset of the jump instruction is searched in the jump instruction database of the operating system.

[0068] Further, when the target module corresponding to the from address offset or to address offset of the jump instruction is not found in the jump instruction database, it is determined that there is an unaudited module in the operating system; or, when the target module corresponding to the from address offset and to address offset of the jump instruction can be found in the jump instruction database of the operating system, it means that the from address offset and to address offset of the jump instruction exist in the jump instruction database and there is a corresponding target module, then the jump function corresponding to the from address offset or to address offset of the jump instruction is searched in the target module of the jump instruction database.

[0069] Further, when the jump function corresponding to the from address offset or to address offset of the jump instruction is not found in the target module of the jump instruction database, it indicates that there is an injection in the operating system, and it is determined that there is a threat in the operating system; or, when the jump function corresponding to the from address offset or to address offset of the jump instruction can be found in the target module of the jump instruction database, the from address and to address of the jump instruction are matched with the addresses corresponding to the jump functions in the jump instruction database.

[0070] Further, when the from address and the to address of the jump instruction do not match the address corresponding to the jump function in the jump instruction database, it is determined that there is a HOOK threat in the operating system; or, when the from address and the to address of the jump instruction match the address corresponding to the jump function in the jump instruction database, it is determined that there is no HOOK threat in the operating system, and the above description is repeated for the next jump instruction of the jump instruction until all jump instructions in the operating system are matched with the jump instructions in the jump instruction library.

[0071] Optionally, Figure 4 The fourth flow chart of the operating system threat detection method provided by the present invention is as follows: Figure 4 As shown, the method includes steps 410-450:

[0072] Step 410: When the operating system is in a trusted state, the image of the operating system is analyzed using C language to identify the code area of ​​the operating system.

[0073] Optionally, when the operating system is in a trusted state, the operating system loads a driver file, wherein the driver file is a static file extracted after static analysis of the operating system in a trusted state. The driver file is opened using C language, and the code area of ​​the driver file is read, thereby identifying the code area of ​​the operating system.

[0074] Step 420, use the capstone disassembly engine to disassemble the code area of ​​the operating system and output the jump instruction database of the operating system.

[0075] Optionally, after loading the driver file into the memory of the operating system, the capstone disassembly engine disassembles all the codes in the code area of ​​the driver file, analyzes the instructions corresponding to all the codes in the code area, extracts the ret instructions and jump instructions in the instructions, and stores the extracted ret instructions and jump instructions, thereby obtaining a jump instruction database of the operating system.

[0076] Step 430 , collecting jump instructions generated by target operations on the operating system of the electronic device.

[0077] Step 440, comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state.

[0078] Step 450: When the jump instruction does not match the jump instruction data in the jump instruction database, it is determined that there is a threat in the operating system.

[0079] Optionally, the description and explanation of steps 430-450 may refer to the above description and explanation of steps 110-130, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0080] The operating system threat detection method provided by the present invention analyzes the image of the operating system by using C language, identifies the code area of ​​the operating system, and then uses the capstone disassembly engine to disassemble the code area of ​​the operating system, and outputs the jump instruction database of the operating system. When the operating system is running, the instructions to be replaced can be added to the jump instruction database, which solves the problems of inaccurate IDA parsing and instruction replacement at runtime, and at the same time improves the efficiency of database production, thereby reducing the false alarm rate while ensuring the threat detection rate.

[0081] The operating system threat detection device provided by the present invention is described below. The operating system threat detection device described below and the operating system threat detection method described above can be referenced to each other.

[0082] The present invention provides an operating system threat detection device, Figure 5 A schematic diagram of the structure of the operating system threat detection device provided by the present invention is shown in FIG. Figure 5 As shown, the operating system threat detection device 500 includes: a collection module 501, a first comparison module 502, and a first determination module 503; wherein,

[0083] A collection module 501 is used to collect jump instructions generated by target operations of the operating system of the electronic device;

[0084] A first comparison module 502, configured to compare the jump instruction with jump instruction data in a jump instruction database of the operating system; wherein the jump instruction database includes: jump instruction data in the operating system extracted when the operating system is in a trusted state;

[0085] The first determination module 503 is configured to determine that a threat exists in the operating system when the jump instruction does not match the jump instruction data in the jump instruction database.

[0086] The operating system threat detection device provided by the embodiment of the present invention determines whether the jump instruction is a normal jump or an abnormal jump in the operating system by comparing the from address offset of the jump instruction generated by the target operation with the jump instruction data in the jump instruction database, and then detects whether there is a threat currently in the operating system, thereby reducing the false alarm rate while ensuring the threat detection rate.

[0087] Optionally, the jump instruction data includes at least one of the following:

[0088] Jump instruction pair array, indirect jump instruction array, sub-function call instruction array and return value instruction array.

[0089] Optionally, the first comparison module 502 is specifically configured to:

[0090] Compare the starting address from address offset of the jump instruction with the return value instruction array in the jump instruction database;

[0091] When the from address offset of the jump instruction is found in the return value instruction array, the target address to address offset of the jump instruction is matched with the next sub-function call instruction of the sub-function call instruction in the target stack currently used by the user;

[0092] If not, it is determined that the jump instruction does not match the return value instruction array.

[0093] Optionally, the operating system threat detection device 500 further includes:

[0094] The second writing module is used to write the from address offset of the jump instruction into the target stack when the jump instruction matches the sub-function call instruction array in the jump instruction database.

[0095] Optionally, the operating system threat detection device 500 further includes:

[0096] a third determination module, configured to convert the from address and the to address of the jump instruction into offsets respectively; and determine that a threat exists in the operating system when converting the from address of the jump instruction into offsets fails or converting the to address of the jump instruction into offsets fails;

[0097] a fourth determination module, configured to search, in a jump instruction database of the operating system, for a target module corresponding to the from address offset or the to address offset of the jump instruction when the from address and the to address of the jump instruction are respectively offset; and determine that a threat exists in the operating system when the target module corresponding to the from address offset or the to address offset of the jump instruction is not found in the jump instruction database;

[0098] Alternatively, when a target module corresponding to the from address offset and to address offset of the jump instruction is found in the jump instruction database of the operating system, a function corresponding to the from address offset or to address offset of the jump instruction is searched in the target module of the jump instruction database; when a function corresponding to the from address offset or to address offset of the jump instruction is not found in the target module of the jump instruction database, it is determined that there is a threat in the operating system.

[0099] Optionally, the operating system threat detection device 500 further includes:

[0100] an identification module, used to analyze the image of the operating system using C language to identify the code area of ​​the operating system when the operating system is in a trusted state;

[0101] The disassembly module is used to disassemble the code area of ​​the operating system using the capstone disassembly engine and output the jump instruction database of the operating system.

[0102] Figure 6 A schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 6 As shown, the electronic device 600 may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the following operating system threat detection method: collecting jump instructions generated by the target operation of the operating system of the electronic device; comparing the jump instructions with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state; when the jump instruction does not match the jump instruction data in the jump instruction database, determining that there is a threat in the operating system.

[0103] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0104] On the other hand, an embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the following operating system threat detection method is implemented: collecting jump instructions generated by a target operation of the operating system of the electronic device; comparing the jump instructions with jump instruction data in a jump instruction database of the operating system; wherein the jump instruction database includes: jump instruction data in the operating system extracted when the operating system is in a trusted state; when the jump instruction does not match the jump instruction data in the jump instruction database, determining that there is a threat in the operating system.

[0105] On the other hand, an embodiment of the present invention further provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following operating system threat detection method is implemented: collecting jump instructions generated by a target operation of the operating system of the electronic device; comparing the jump instructions with jump instruction data in a jump instruction database of the operating system; wherein the jump instruction database comprises: jump instruction data in the operating system extracted when the operating system is in a trusted state; and determining that a threat exists in the operating system when the jump instruction does not match the jump instruction data in the jump instruction database.

[0106] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting operating system threats, characterized in that: Applied to electronic equipment, the method comprises: Collecting jump instructions generated by target operations of the operating system of the electronic device; Comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state; In a case where the jump instruction does not match the jump instruction data in the jump instruction database, determining that a threat exists in the operating system; Before collecting the jump instructions generated by the target operation of the operating system of the electronic device, the method further includes: When the operating system is in a trusted state, using C language to analyze the image of the operating system to identify the code area of ​​the operating system; The capstone disassembly engine is used to disassemble the code area of ​​the operating system, and the jump instruction database of the operating system is output.

2. The operating system threat detection method according to claim 1, characterized in that: The jump instruction data includes at least one of the following: Jump instruction pair array, indirect jump instruction array, sub-function call instruction array and return value instruction array.

3. The operating system threat detection method according to claim 2, characterized in that: In the case where the jump instruction data includes the return value instruction array, comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system includes: Compare the starting address from address offset of the jump instruction with the return value instruction array in the jump instruction database; When the from address offset of the jump instruction is found in the return value instruction array, the target address to address offset of the jump instruction is matched with the next sub-function call instruction of the sub-function call instruction in the target stack currently used by the user; If not, it is determined that the jump instruction does not match the return value instruction array.

4. The operating system threat detection method according to claim 2, characterized in that: The method further comprises: When the jump instruction matches the sub-function call instruction array in the jump instruction database, the from address offset of the jump instruction is written into the target stack.

5. The operating system threat detection method according to claim 1, characterized in that: Before comparing the jump instruction with the jump instruction data in the jump instruction database of the operating system, the method further includes: Converting the from address and the to address of the jump instruction to offsets respectively; if converting the from address of the jump instruction to offset fails, or converting the to address of the jump instruction to offset fails, determining that there is a threat in the operating system; When the from address and the to address of the jump instruction are respectively shifted, searching the jump instruction database of the operating system for a target module corresponding to the from address offset or the to address offset of the jump instruction; when the target module corresponding to the from address offset or the to address offset of the jump instruction is not found in the jump instruction database, determining that there is a threat in the operating system; Alternatively, when a target module corresponding to the from address offset and to address offset of the jump instruction is found in the jump instruction database of the operating system, a function corresponding to the from address offset or to address offset of the jump instruction is searched in the target module of the jump instruction database; when a function corresponding to the from address offset or to address offset of the jump instruction is not found in the target module of the jump instruction database, it is determined that there is a threat in the operating system.

6. An operating system threat detection device, characterized in that: include: A collection module, used for collecting jump instructions generated by target operations of the operating system of the electronic device; A first comparison module, used to compare the jump instruction with the jump instruction data in the jump instruction database of the operating system; wherein the jump instruction database includes: the jump instruction data in the operating system extracted when the operating system is in a trusted state; A first determination module, configured to determine that a threat exists in the operating system when the jump instruction does not match the jump instruction data in the jump instruction database; The device also includes: an identification module, used to analyze the image of the operating system using C language to identify the code area of ​​the operating system when the operating system is in a trusted state; The disassembly module is used to disassemble the code area of ​​the operating system using the capstone disassembly engine and output the jump instruction database of the operating system.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the operating system threat detection method according to any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the operating system threat detection method as claimed in any one of claims 1 to 5 are implemented.

9. A computer program product having executable instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor implements the steps of the operating system threat detection method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for intercepting target progress with self-protection

    CN102799493A

  • Data security storage method and device

    CN103679042A

  • Kernel-level code reuse type attack detection method based on QEMU

    CN105260659A

  • Page redirection method and device, terminal and computer-readable medium

    CN108491247A

  • Page skip processing method and device and electronic equipment

    CN112579944A