Machine learning through iterative memory analysis for malware detection

JP2023002435A5Active Publication Date: 2024-10-03ACRONIS INT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2021156496
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-06-22
Filing Date
2021-09-27
Publication Date
2024-10-03
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

Existing malware detection methods, particularly pre-execution analysis, struggle to effectively analyze encrypted or packed malware samples due to limitations in static and dynamic analysis techniques, leading to inefficiencies and reduced detection rates.

Method used

A combined static and dynamic analysis approach using machine learning to iteratively refine malware classification by intercepting and decoding data blocks during execution, leveraging system-level interceptors and user-mode hooks to update file attributes, with iterative analysis cycles until accurate classification is achieved.

Benefits of technology

Enhances malware detection accuracy by overcoming evasion techniques employed by advanced malware, improving detection rates through synergistic use of static and dynamic analysis methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a method for training a machine learning static analysis unit based on iterative executable file analysis in which static analysis and dynamic analysis are combined to analyze potentially malicious files including encrypted files, a system, and a computer-readable storage medium.SOLUTION: In a method of training static analysis of machine learning, an executable file 502 has its attributes collected in a file attributes tree. A hook 1 is applied to an original static file attribute 504 to recover an attribute 508. A hook 2 follows iteratively and recovers attributes 512, 514. A hook 3 recovers attributes 518, 520, and 522. The original static file attribute and results of the hooks 1 and 3 are transmitted to a machine learning analysis unit 524 for analysis.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computer security including static and dynamic analysis of malware and malware detection.

Background Art

[0002] In computer security, malware detection strategies can be classified according to at which stage of malware execution to intervene. That is, the strategies include those before execution, those during execution, and those after execution. Although pre-execution (“PE (pre-Execution)”) analysis is often useful, it has been difficult to perform on a wide collection of encrypted or packed malware samples.

[0003] One of the problems is that there is a lack of a solution in performing PE analysis for such encrypted or packed samples. In general methods, behavioral runtime methods and event collection are used. In such cases, PE analysis is not fully utilized and the detection rate is not improved.

[0004] Here, “static analysis” refers to a program analysis technique based on software structure. In conventional static analysis methods, a portable executable file is parsed and disassembled to create an attribute tree including certificates, headers, libraries, imports, names, sizes, and other attributes. These trees are used to classify whether the executable file is malicious. However, when the malware is encrypted, difficulties occur in a general static file analysis part. Due to the encryption, the code cannot be effectively analyzed by static analysis.

[0005] Dynamic analysis may be used as an alternative when static analysis is ineffective. The purpose of dynamic analysis is to test untrusted files, revealing their inherent properties during execution by running them in a secure environment. Examples of traditional dynamic behavior analysis tools include emulation, sandboxing, and similar methods.

[0006] While emulators can deeply analyze applications, they have several limitations. Emulators cannot emulate the original system with 100% accuracy. Some malware can test the runtime environment and stop execution if an emulator is detected. Furthermore, emulators consume system resources and require considerable time for analysis. This is well known, and some malicious files include dummy loops to prolong execution and emulation time. These loops cause the emulator to terminate the analysis before the malicious code is executed.

[0007] A sandbox is an isolated, secure environment used for file execution testing and analysis. Like emulators, a sandbox does not precisely match the target computer system. Therefore, execution of a potentially malicious file in a sandbox may differ from execution in the target environment. Furthermore, sandboxing is a resource-intensive process that cannot be efficiently performed in a real-time environment. Nevertheless, sandboxes are sometimes used in addition to lighter, static analysis methods.

[0008] A system behavior analyzer is a method of controlling the execution of files on a target computer. It tracks all actions, including API calls, threads, read and write operations, and other actions that help detect malware. However, the problem is that such methods are not lightweight, can burden the system, and degrade performance. [Overview of the project]

[0009] To overcome the limitations of conventional techniques, static and dynamic analysis can be combined to analyze potentially malicious files, including encrypted files. For example, in static analysis, since many data blocks are encrypted, the entropy of the file body can be estimated to reach a tentative conclusion that the file is suspicious. After reaching a tentative determination, dynamic methods are used to improve the accuracy of the determination. Dynamic methods reveal the nature of untrusted files by disclosing their execution behavior. For example, if a file overwrites its own header when execution begins, or has other attributes that conceal its nature, this observed behavior contributes to the conclusion that the file is malicious. Classification can be performed based on machine learning techniques.

[0010] Various system-level interceptors are used to re-estimate decisions on the application at specific control flow points such as thread / process creation and file mapping. The decisions re-estimated by a trained machine learning PE analysis model utilize data extracted from application memory, rather than from files on disk. In this scenario, application memory contains a new code area where the decoded code is executed. Several iterations are performed to obtain more accurate results. Some methods utilize the synergistic effects of static and dynamic analysis to achieve more accurate decisions than traditional methods.

[0011] The method described above employs a PE analysis service, a driver, a file system, and requests to the file system. The driver communicates with the user-mode service to invoke PE model evaluation and obtain the latest PE analysis decision. The driver can use user-mode hooks to define control points in the code flow and re-estimate the model.

[0012] New code regions containing decompressed or decrypted code are detected using the stack analysis unit and user-mode hooks that operate with the process virtual memory API. The detected new code regions are added to the model's dataset and used for model training or calculating new decisions.

[0013] Alternatively, the new code area is collected within a Portable Executable (BSS) uninitialized data segment. This uninitialized data segment, also known as a "BSS" segment, acts as a placeholder for uninitialized variables that do not require actual disk space.

[0014] Similar combinations of drivers and user-mode hooks are used to train PE analysis models with sets of packed or encrypted malware samples. The latest PE analysis results are then utilized in endpoint security products to improve malware detection.

[0015] In one embodiment of the present invention, anti-malware scanning of a file is performed when an executable file is executed on the target computer system. Static analysis of the file is performed using a tree of file attributes that allows the file to be classified as malicious with a certain degree of precision. If the static analysis cannot classify the file with the specified precision, dynamic file analysis is performed iteratively. The dynamic analysis intercepts the operation of decrypting data blocks during the execution of the file code and updates the tree of file attributes to take encrypted data blocks into consideration. Subsequently, static analysis of the file is performed based on the updated tree of file attributes. The intercepting and updating steps are repeated until the file can be classified with the specified precision.

[0016] In one embodiment, a data block is decrypted in existing memory allocated to the application, in a new buffer within the allocated memory, or in an existing buffer of the application. A buffer is a temporary storage area, typically a block in memory, where items are held while waiting to be transferred or modified from an input device or output device, or while waiting to be transferred or modified for processing from another memory block.

[0017] In one embodiment, the steps of intercepting the decryption of a data block and updating the file attribute tree are repeated more than three times, more than five times, or more than ten times.

[0018] In one embodiment, file analysis relies on a second untrusted file that is modified from the first file after execution. The second untrusted file arises when the header, data blocks, or body of the first file are modified, or when a new file is created, during the execution of the first file.

[0019] In one embodiment, file execution is frozen after analyzing the added file data. In one embodiment, a predetermined area of ​​the buffer is made executable, and execution is switched to that predetermined area. [Brief explanation of the drawing]

[0020] [Figure 1] This diagram shows an overview of the system for implementing PE analysis. [Figure 2] This diagram shows the process of performing iterative static-dynamic analysis on an unknown object. [Figure 3] This diagram illustrates the process of performing iterative static-dynamic analysis on an unknown object in machine learning. [Figure 4]This figure details one embodiment of iterative static-dynamic analysis performed in the execution environment. [Figure 5] This document describes a machine learning implementation based on iterative static-dynamic analysis performed in the execution environment. [Modes for carrying out the invention]

[0021] The implementation of iterative malware analysis uses static and dynamic techniques to overcome detection obstacles. These obstacles are embedded in the malware by the malware creator, who is familiar with the detection methods used by anti-malware systems.

[0022] Iterative malware analysis is designed to improve detection rates by selectively using static and dynamic techniques, thereby overcoming the anti-detection properties found in advanced malware. For example, it may include methods to evade detection when the main malicious code is executed in an untrusted file. If malware can detect a virtualized runtime environment that does not match the target environment, it can evade dynamic methods such as emulation and sandboxing. Another detection evasion method used by malware is obfuscation. Obfuscation takes the code and makes it unreadable by conventional means. It also delays detection and makes the code less susceptible to reverse engineering. Packing is a type of obfuscation used by malware that utilizes packers. Packers are tools that modify the form of code by compressing or encrypting data.

[0023] Encrypted or packed files require something different from conventional ones known from prior art malware analysis protocols. When an encrypted malware is executed, first a suspicious malicious file is read and executed. Generally, since the main body is encrypted or packed, the nature of the file cannot be determined with sufficient accuracy. To overcome this, the data blocks are decrypted within a new buffer of the allocated memory. Alternatively, the data blocks may be decrypted within an existing buffer to make a predetermined area executable and switch the execution to the said predetermined area. This cycle can be repeated many times before the execution of the malicious code starts. Therefore, the decryption proceeds step by step by the data blocks read from the encrypted data blocks and written to the existing application memory or a new buffer.

[0024] Alternatively, an uninitialized data segment (BSS) is used for decryption. Packing often targets executable files. The packing process can generate a new header and transform the original file. The transformed original file is copied to a new file. A stub is added to the new file. If the file is an executable file, the stub reverses the transformation during execution.

[0025] Microsoft Windows® program files use the Portable Executable format. This format was first introduced in Windows NT3.1 and has been extended to other binary formats including support for.NET and 64 bits. The said Portable Executable format is the standard binary format for EXE and DLL files in the Windows OS. The Linux® Executable and Linkable Format (“ELF”) is a similar format for executable files in the Linux environment. In the following description, the Windows format is used as an example, but the techniques described below are applicable to any file format that is structurally similar.

[0026] Process hollowing is a method of executing code within the address space of a live process. It is typically performed by creating a suspended process and then unmapping or "hollowing out" its memory. This process hollowing can be done within an uninitialized data segment (BSS). Detection can be achieved by setting the execute bit to allow access to the directory containing it.

[0027] Overwriting the portable executable header is a technique used by malware at runtime to evade detection. For example, the original file contains a header, a code section, and other sections such as .data or .rsrc. During the packing process, a completely new executable file with a new header can be generated. The original file can be transformed by compression, encryption, or a combination of these. When loaded, the packed file is started and mapped into virtual memory. A decompression stub is invoked to reverse the compression or encryption operation as needed. The original file is then restored into memory, resulting in a new header. The modification of the file header at runtime is evidence that the target file has been packed.

[0028] Static and dynamic analysis techniques have different impacts on the overall system performance. For example, a static PE analysis unit can achieve a high detection rate when decrypting data from portable executable files (PE files) loaded into memory, while simultaneously classifying PE files more quickly and efficiently than dynamic analysis of the same files.

[0029] Figure 1 shows an overview of system 100 for implementing PE analysis. The anti-malware system 100 includes a PE analysis hosting service 102 for analyzing a potentially malicious application 104. The PE analysis service 102 generates access scans 106 with iteration 0, and continues from iteration 1 (108) to N (110). These elements and the user-mode UM hook unit 112 are located in user mode 114.

[0030] Kernel mode 116 includes a kernel driver 122 that executes input / output I / O commands from the UM hook unit 112, and a link 120 between the result 122 of the UM hook unit 112 and the PE analysis service 102. Link 120 passes the result 124 to the PE analysis unit 102. Request 126 from the PE analysis service 102 includes a request for a process area from the PE analysis memory. User mode is distinguished from kernel mode in that the application operates in user mode and the core operating system components operate in kernel mode.

[0031] Figure 2 shows a method 200 for performing iterative static-dynamic analysis on an unknown file. Once this process begins, it intercepts the start of file execution (step 202) and then retrieves file attributes (step 204). Based on the retrieved attributes, a static analysis is performed (step 206). The preliminary results of the static analysis generate a security ranking 208 and attribute-based file classification 210 using machine learning algorithms on a collection of known files, enabling matching of known malware with file attributes in a blacklist of suspicious certificates, libraries, code structures, and hash sums 212.

[0032] As a result of the static analysis determination 214, the ranking 208, classification 210, and matching 212 results are obtained. This determination may or may not have sufficient accuracy to classify the target file according to a predetermined confidence level (or specific precision). The confidence level may depend on the security policy and the file class. For example, high security should correspond to a confidence level of less than 1% of type I errors, and moderate security should correspond to a confidence level of less than 1% of type II errors. If, in step 216, it is determined that the file can be classified as malware with a specific precision, the execution of the file is terminated (step 218), and the detection of a malicious file is recorded (step 220). If the determination 214 does not classify the file, a determination is made as to whether further verification is required according to determination 214 (step 222). On the other hand, if it is classified, the file analysis is stopped, and the file is released for execution (step 224).

[0033] If malware cannot be identified with a certain degree of accuracy through security ranking 208, file classification 210, or matching file attributes with known malware in a blacklist of suspicious certificates, libraries, code structures, and hash sums 212, further verification is required. If further verification is required to classify a file, for example, if the trust level is lower than a predefined level, or if other malware detection engines make a different judgment about the classification, the iterative process from step 226 is performed with a portion of the file running. File attributes are further identified using hooking behavior (step 228). Hooking behavior modifies or extends a running application by intercepting function calls, messages, or events that occur between software components. Code used for this purpose is commonly known as a hook.

[0034] File execution is stopped in step 230, and the previously collected PE file attributes are updated based on the static analysis generated in step 206 (step 232). In iterative malware analysis, execution is stopped, so the execution of a single file can be tested up to N times without executing the entire code related to the target file.

[0035] Figure 3 shows a method 300 for performing iterative static-dynamic analysis of unknown files in machine learning. Once this process begins, a new PE file analysis starts (step 302). PE file attributes are received (step 304) and evaluated (step 306). For example, if the attribute set allows for file classification at a confidence level higher than a predefined confidence level, or if the attribute set consists of a minimal set of attribute variables, it is determined whether the attribute set is sufficient to train the system to identify the target file. If it is determined that it is not sufficient, the PE file is executed in a secure computing environment (step 308). Examples of secure computing environments include emulators, sandboxes, dedicated test machines, machines disconnected from any network, or other environments where the ability of malware to propagate is limited. A hook operation is performed, and further file attributes are identified (step 310). Based on these additional attributes, the original set of attributes is updated (step 312). The iterative process continues until the evaluation in step 306 produces a positive result. If a positive result is obtained, the collected files (including the newly collected attributes based on the PE file) are used to train the machine learning file analysis unit (step 314). Based on the collected files and attributes, the detection rule set is updated (step 316).

[0036] Figure 4 shows details of one embodiment of iterative static-dynamic analysis 400 performed in execution environment 402. This environment includes system objects operating in user mode 404 and kernel mode 406, namely the PE analysis unit 408 and application 410 operating in user mode 404, and the kernel security driver 434. User mode is distinguished from kernel mode in that applications operate in user mode and core operating system components operate in kernel mode. Application 410 is executed from PE file 412 containing encrypted data block 414. When application 410 is executed, code 416, library 418, and data 420 are exposed. Block decryption is performed iteratively within buffer 0 (422), with decryption block 426 being executed and continuing to buffer N (428) and the decrypted block 430. Alternatively, block decryption can be performed within data block 420.

[0037] The hook unit 432 operates in user mode 404 under the control of the kernel security driver 434. As in other embodiments, the hook unit 432 modifies or extends the running application by intercepting function calls, messages, or events between software components and sends them to the kernel security driver 434. The kernel security driver 434 sends the commands, messages, or events to the PE analysis unit 408.

[0038] The initial PE file attribute 436 is collected by the PE analysis unit 408 through the N-item collection of PE file attribute 440 process, along with the first iteratively collected PE file attribute 438. The file attribute malware analysis unit 442 evaluates the initial PE file attribute 436 and the iteratively collected file attributes 438 and 440 based on instructions from the iteration controller 444.

[0039] Some malware does not create buffers for block decryption. In such cases, the data can be decrypted using existing memory pages. For example, code block 416 and data block 420 are used for decryption.

[0040] While some decompressed files restore the original file in memory, malware can restore the original file to a different memory address. In such cases, activity related to the second file is analyzed immediately after its inception, focusing on modifications from the first file.

[0041] Alternatively, another technique involves freezing further execution of a file after the data (data blocks, headers, code blocks, or data, etc.) that has been additionally written to the application buffer has been retrieved. For example, all threads of a process can be frozen.

[0042] The iterative collection of PE file attributes using dynamic methods continues until a sufficient tree of file attributes has been created to draw conclusions about the target file. The iterative techniques described above are applicable to computing environments where user machines or networks are likely to encounter malware that has the ability to evade detection, particularly in a way that undermines or imperfects the reliability of static analysis.

[0043] Figure 5 shows an embodiment 500 of the present invention for machine learning. The executable file 502 has its attributes grouped within a file attribute tree 504. The original static file attributes 504 are grouped within the tree. The first hook 506 is applied, and the first attribute 508 is restored. The second hook 510 continues iteratively, restoring attributes 512 and 514. The third hook 516 restores attributes 518, 519, and 529. Thus, in three stages of iteration, the file attribute tree is expanded with six additional attributes for analysis. In this embodiment, there are three or more hooks applied to the executable file.

[0044] Hook attributes are sent to the machine learning analysis unit 524 for analysis. For example, the original attribute 0, and the results for hooks 1 and 3 are sent to the analysis unit 542. File attributes 526 and the definition of the file classification are stored in the database 430, which is used to determine whether the executable file 502 is trustworthy. The file storage 532 is used as a criterion for comparison with existing files. Once the machine learning analysis unit 524 has resolved the executable file 502, the results and a copy or record of the executable file are added to the file storage 532.

[0045] The aforementioned iterative techniques are intended for computer environments where user machines or networks may come into contact with malware capable of evading detection. This malware's ability to evade detection is particularly evident in its ability to judge static analysis as incomplete and unreliable.

Claims

1. 1. A computer-implemented method for training a machine learning static analyzer based on iterative executable file analysis running on a processor, the method comprising: a. restoring file attributes from an untrusted file; b. creating an attribute tree from attributes of the untrusted files; c. iteratively performing a dynamic analysis of the untrusted file, including decrypting at least one of the encrypted data blocks of the untrusted file; d. intercepting an operation of decrypting at least one of the encrypted data blocks during execution of the untrusted file code; e. updating the file attribute tree of the untrusted file taking into account at least one of the decrypted data blocks; f. repeating steps (c), (d) and (e) until untrusted file code is executed; g. training a machine learning static analyzer based on the updated file attribute tree and the categorized file stores of the untrusted files.

2. 2. The method of claim 1, wherein said intercepting step d) and said updating step e) are repeated three or more times.

3. 3. The method of claim 2, further comprising the step of decoding the data block in a new or existing memory.

4. 4. The method of claim 1, further comprising the step of analyzing the file and a second untrusted file that is modified after execution of the file.

5. 5. The method of claim 4, further comprising freezing execution of the file after analyzing the added file data.

6. 2. The method of claim 1, further comprising the steps of enabling execution of a predetermined region and switching execution to the predetermined region.

7. 7. A system for training a machine learning static analyzer based on iterative executable file analysis, comprising: a. an executable analyzer; b. Untrusted files; c. a user-mode hook application for intercepting the decryption of data logs during execution of untrusted file code; d. a data structure that stores at least one file attribute compiled by the static analysis; e. a data structure that stores at least one file attribute of the files summarized by the dynamic analysis.

8. 8. The system of claim 7, further comprising a new buffer of memory allocated for decrypting one or more data logs of the untrusted file.

9. The system of claim 7 further comprising a pre-existing buffer for decrypting the data log of the untrusted file.

10. The system of claim 7 further comprising an existing memory for decrypting the data log of the untrusted file.

11. The system of claim 7 , further comprising a second untrusted file that is modified after execution of the untrusted file.

12. A computer readable storage medium containing program code for performing training of a machine learning static analyzer based on repeatable file analysis of the method of any one of claims 1 to 6.