An Intermediate Language-Based Method for Deobfuscating Industrial Control Malware Strings

Through the industrial-controlled malware string antiobfuscation method based on intermediate languages, using IDA Pro and BinVM simulation execution engines, the portability and compatibility issues of malware string obfuscation protection in the existing technology are solved, and a variety of instructions are realized Efficient decryption and verification of malware in the set architecture.

CN114756864BActive Publication Date: 2024-11-19GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210380934.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2024-11-19
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

When existing industrial control security technologies deal with malware protected by string obfuscation, there are problems of poor portability and compatibility, making it difficult to effectively decrypt and verify the string information of the malware.

Method used

Using the industrial control malware string deobfuscation method based on intermediate languages, decompile and simulate execution initialization functions, identify and decrypt encrypted strings, and uses IDA Pro and BinVM to simulate the execution engine to process malware of multiple instruction set architectures.

Benefits of technology

Improves compatibility and portability of string antiobfuscation schemes, and can be applied to malware of multiple instruction set architectures simultaneously, enabling efficient decryption and verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756864B_ABST
    Figure CN114756864B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of industrial control security technology, and in particular to an industrial control malware string deobfuscation method based on an intermediate language, which is not only applicable to both decryption-type string obfuscation schemes and unified decryption-type string obfuscation schemes, but also can process malware of multiple common instruction set architectures such as ARM32, ARM64, X86 and X64, thereby comprehensively improving the compatibility and portability of string deobfuscation schemes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial control security technology, and in particular to an industrial control malware string deobfuscation method based on an intermediate language. Background Art

[0002] Industrial control systems are important infrastructure for various industries such as electricity, petroleum, chemical industry, transportation, and military industry. Their security and stability are directly related to the lifeline of the national economy. The proportion of high-risk and medium-risk vulnerabilities in industrial control systems far exceeds that of traditional industries. After the details of these vulnerabilities are disclosed, malware can easily exploit them and launch malicious attacks with huge impact.

[0003] In order to fully ensure the safe and stable operation of industrial control systems, industrial control security researchers actively fight against malware. In the process of confrontation, string information is one of the most intuitive and effective ways to determine the behavior of malware. By extracting the string information of industrial control malware, the core logic position of the malware can be quickly located, and the key data of the malware can be effectively extracted, which will help the subsequent automated detection and confrontation of malware. However, in order to increase the difficulty of analysis for industrial control security researchers, malware developers began to use string obfuscation.

[0004] At present, when dealing with industrial control malware protected by string obfuscation, existing solutions usually rely on manual analysis of the location of the string decryption function, and then manually restore the logic of the decryption function and complete the string decryption. At the same time, due to the various implementation methods of string obfuscation and the different complexities of the decryption algorithm, this anti-obfuscation solution has problems such as high implementation difficulty and low anti-obfuscation efficiency. In addition, industrial control security researchers may face the problem of industrial control malware with multiple instruction set architectures, and the existing solutions have poor portability and compatibility. Summary of the invention

[0005] The purpose of the present invention is to provide an industrial control malware string deobfuscation method based on an intermediate language, aiming to solve the problems of poor portability and compatibility of existing solutions when processing industrial control malware protected by string obfuscation.

[0006] To achieve the above object, the present invention provides an industrial control malware string deobfuscation method based on an intermediate language, comprising the following steps:

[0007] Decompile the industrial control malware to obtain the initialization function, code segment, and data segment;

[0008] Simulating execution of the initialization function on the data segment;

[0009] Overwriting the simulated executed data segment into the industrial control malware to obtain a first decryption result;

[0010] identifying an encrypted string in the data segment;

[0011] Decrypting the encrypted string, and writing the decrypted string back to the original data location to obtain a second data segment;

[0012] Overwriting the second data segment into the industrial control malware to obtain a second decryption result;

[0013] The first decryption result and the second decryption result are decryptably verified.

[0014] The industrial control malware includes:

[0015] Industrial control malware that uses a unified decryption-based string obfuscation scheme and industrial control malware that uses a decryption-based string obfuscation scheme.

[0016] The step of simulating and executing the initialization function on the data segment includes:

[0017] Design the intermediate language IDA microcode simulation execution engine BinVM based on the interpreted instruction set simulation strategy;

[0018] The BinVM is used to simulate and execute the initialization function.

[0019] The step of identifying the encrypted string in the data segment includes:

[0020] The data segment is identified using IDAPro, and non-ASCII and non-Chinese encoded character string information in the data segment are all used as the encrypted character string.

[0021] The decrypting of the encrypted string and writing the decrypted string back to the original data location to obtain the second data segment includes:

[0022] According to the mapping relationship between the data segment and the code segment, the encrypted string is used to find the location where the string is referenced in the code segment, and the next function at the location is used as the string decryption function;

[0023] Use the BinVM to simulate and execute the string decryption function to complete the string decryption;

[0024] The decrypted character string is written back to the original data location to obtain the second data segment.

[0025] The performing decryptability verification on the first decryption result and the second decryption result includes:

[0026] If the first decryption result or the second decryption result is within the ASCII code or Unicode Chinese encoding range, the decryption is successful, and the decryption result within the range is used as the final decryption result.

[0027] The beneficial effects of the present invention are as follows: it is not only applicable to both the decryption-type string obfuscation scheme and the unified decryption-type string obfuscation scheme, but also can process malware of multiple common instruction set architectures such as ARM32, ARM64, X86 and X64. Therefore, the present invention comprehensively improves the compatibility and portability of the string anti-obfuscation scheme. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 these drawings without paying creative work.

[0029] Figure 1 It is a schematic diagram of the steps of an industrial control malware string deobfuscation method based on an intermediate language according to an embodiment of the present invention.

[0030] Figure 2 It is a flowchart of an intermediate language-based industrial control malware string deobfuscation method according to an embodiment of the present invention.

[0031] Figure 3 It is a framework diagram of BinVM according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] See also Figures 1 to 3 , Figure 1 Schematic diagram of the steps of an intermediate language-based industrial control malware string deobfuscation method provided by an embodiment of the present invention. Specifically, Figure 1 As shown, the intermediate language-based industrial control malware string deobfuscation method may include the following steps:

[0033] S101. Decompile the industrial control malware to obtain the initialization function, code segment, and data segment.

[0034] Specifically, the industrial control malware includes industrial control malware that adopts a unified decryption-type string obfuscation solution and industrial control malware that adopts a decryption-on-use string obfuscation solution.

[0035] If the string obfuscation scheme of the industrial control malware is a unified decryption type, the decryption function exists in the initialization function, and the encrypted and decrypted string data exists in the data segment.

[0036] If the string obfuscation scheme of the industrial control malware is a decryption-on-use type, the decryption function exists in the code segment of the non-initialization function, and the encrypted string data exists in the data segment. However, the decrypted string data is not necessarily stored in the data segment.

[0037] S102: Simulate and execute the initialization function on the data segment.

[0038] Specifically, for the unified decryption type string obfuscation scheme, the decryption function exists in the initialization function, and the decrypted string will be stored in the data segment. Therefore, the present invention first designs and implements the intermediate language IDA microcode simulation execution engine BinVM based on the interpreted instruction set simulation strategy. Then, BinVM simulates and executes the initialization function of the malicious industrial control software.

[0039] like Figure 3 As shown, the simulation execution engine BinVM is the core part of this step. The specific processing flow is as follows:

[0040] Initialize the environment: initialize virtual registers, map virtual memory space and other environmental information.

[0041] Instruction fetch and decode: Read an IDAmicrocode instruction in sequence and parse the opcode and operand of the instruction.

[0042] Execution phase: Enter the Handler function corresponding to the opcode, which can simulate the function of the opcode, perform operations on operands or read and write virtual memory, etc. After that, repeat the second step until all instructions are executed.

[0043] S103: Overwrite the data segment after the simulation execution into the industrial control malware to obtain a first decryption result.

[0044] Specifically, the data segment information after the simulation execution in S102 is overwritten into the original malicious industrial control software. At this time, the obfuscated protected string will be successfully replaced by the decrypted string to obtain the first decryption result.

[0045] S104: Identify the encrypted character string in the data segment.

[0046] Specifically, step S102 is not applicable to the decryption-type string obfuscation scheme when in use. Therefore, all possible encrypted strings must be found from the data segment. Thanks to the powerful static analysis capabilities of IDA Pro, it establishes a mapping relationship between data segment data and code segment read and write instructions. Therefore, non-ASCII and non-Chinese encoded string information in the data segment will be used as encrypted strings.

[0047] S105. Decrypt the encrypted string, and write the decrypted string back to the original data location to obtain a second data segment.

[0048] According to the mapping relationship between the data segment and the code segment, the position where the string is referenced in the code segment can be queried from the string data in S103. Usually, the next function at this position is a string decryption function, so the string decryption can be completed by using BinVM to simulate the execution of the function at this position, and the decrypted string is written back to the original data position to obtain the second data segment.

[0049] S106. Overwrite the second data segment into the industrial control malware to obtain a second decryption result.

[0050] Specifically, the data segment information after the simulation execution in S105 is directly overwritten into the original malware to obtain the second decryption result.

[0051] In particular, if the decrypted string cannot be written back to the original data location in step S105, the decryption function parameters, return value, function offset and other information will be printed. Since the printed information contains the decrypted string data, industrial control security researchers can also use this as a clue to analyze and fight against malware.

[0052] S107: Perform decryptability verification on the first decryption result and the second decryption result.

[0053] Specifically, if the first decryption result or the second decryption result is within the ASCII code or Unicode Chinese encoding range, the decryption is successful, and the decryption result within the range is used as the final decryption result.

[0054] The present invention implements an industrial control malware string deobfuscation method based on the intermediate language IDA microcode. The method is not only applicable to both the decryption-type string obfuscation scheme and the unified decryption-type string obfuscation scheme, but also can handle malware of multiple common instruction set architectures such as ARM32, ARM64, X86 and X64. Therefore, the present invention comprehensively improves the compatibility and portability of the string deobfuscation scheme.

[0055] What is disclosed above is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. A person skilled in the art can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.

Claims

1. A method for deobfuscating industrial control malware strings based on intermediate language, characterized in that: The steps include: Decompile the industrial control malware to obtain the initialization function, code segment, and data segment; Simulating execution of the initialization function on the data segment; Overwriting the simulated executed data segment into the industrial control malware to obtain a first decryption result; identifying an encrypted string in the data segment; Decrypting the encrypted string, and writing the decrypted string back to the original data location to obtain a second data segment; Overwriting the second data segment into the industrial control malware to obtain a second decryption result; The first decryption result and the second decryption result are decryptably verified.

2. The method for deobfuscating industrial control malware strings based on intermediate language according to claim 1, characterized in that: The industrial control malware includes: Industrial control malware that uses a unified decryption-based string obfuscation scheme and industrial control malware that uses a decryption-based string obfuscation scheme.

3. The method for deobfuscating industrial control malware strings based on intermediate language as claimed in claim 2, characterized in that: The simulating execution of the initialization function on the data segment includes: Design the intermediate language IDA microcode simulation execution engine BinVM based on the interpreted instruction set simulation strategy; The BinVM is used to simulate and execute the initialization function.

4. The method for deobfuscating industrial control malware strings based on intermediate language as claimed in claim 3, characterized in that: The identifying the encrypted string in the data segment comprises: The data segment is identified using IDAPro, and non-ASCII and non-Chinese encoded character string information in the data segment are all used as the encrypted character string.

5. The method for deobfuscating industrial control malware strings based on intermediate language as claimed in claim 4, characterized in that: The step of decrypting the encrypted string and writing the decrypted string back to the original data location to obtain a second data segment includes: According to the mapping relationship between the data segment and the code segment, the encrypted string is used to find the location where the string is referenced in the code segment, and the next function at the location is used as the string decryption function; Use the BinVM to simulate and execute the string decryption function to complete the string decryption; The decrypted character string is written back to the original data location to obtain the second data segment.

6. The method for deobfuscating industrial control malware strings based on intermediate language as claimed in claim 5, characterized in that: The performing decryptability verification on the first decryption result and the second decryption result includes: If the first decryption result or the second decryption result is within the ASCII code or Unicode Chinese encoding range, the decryption is successful, and the decryption result within the range is used as the final decryption result.