A malware identification method, device, storage medium and program

By extracting static and behavioral feature data from the system kernel and combining them with malicious feature sets and malicious identification models for multi-level identification, the problem of low efficiency and high false detection rate in existing ransomware protection technologies is solved, achieving efficient and accurate malware identification.

CN123179402APending Publication Date: 2026-11-27PURPLE MOUNTAIN LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611696906.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing ransomware protection technologies are inefficient and have a high false positive rate when identifying unknown threats. They are unable to effectively identify variants of modern ransomware and consume too many system resources, leading to a decline in system performance.

Method used

By acquiring event information from the system kernel, extracting static and behavioral feature data, and using malicious static and behavioral feature sets for preliminary detection, and calling the malicious identification model for final judgment when the preliminary detection fails to identify it as malware, the system kernel call frequency is reduced, the identification efficiency is improved, and the false detection rate is reduced.

Benefits of technology

This approach reduces system resource consumption while improving the efficiency and accuracy of malware identification, lowering the false positive and false negative rates, and ensuring effective identification of unknown ransomware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179402A_ABST
    Figure CN123179402A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a malware identification method, device, storage medium and program, and belong to the technical field of information security. The method comprises: obtaining event information generated by to-be-detected software in a system kernel, and extracting static feature data and behavior feature data based on the event information; performing preliminary detection on the static feature data and the behavior feature data of the to-be-detected software based on a malicious static feature set and a malicious behavior feature set respectively; and when the preliminary detection does not determine that the to-be-detected software is malicious software, generating a final discrimination result of the to-be-detected software based on a malicious discrimination model. Embodiments of the present application can solve the problem of high occupation of the system kernel in the process of malware identification, can reduce system resource occupation and improve malware identification efficiency, can enhance the system communication efficiency between the system kernel state and the user state, reduce the influence of malware identification on the system, and improve the false detection rate and the missed detection rate of malware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and specifically to a method, apparatus, storage medium, and program for identifying malicious software. Background Technology

[0002] With the increasing sophistication of cyberattacks, ransomware has become one of the most serious threats to global cybersecurity. Ransomware encrypts users' critical files and demands ransom, causing significant economic losses and data security risks to individuals and businesses. Existing ransomware protection technologies mainly fall into two categories: static signature-based matching techniques and behavioral analysis-based dynamic detection techniques. Static signature-based matching extracts specific binary patterns from known ransomware samples as "signatures" and stores them in a virus database. During detection, the file to be detected is compared with the signature database. This algorithm is simple to implement, efficient, and suitable for rapid identification of known threats. However, static signature-based matching techniques rely heavily on hash values ​​or signatures in traditional antivirus software virus databases. Modern ransomware widely employs code obfuscation, polymorphism, and packing techniques, easily generating countless variants, leading to outdated static signature databases and an inability to effectively identify unknown "zero-day" ransomware attacks. To compensate for the shortcomings of static detection, behavioral monitoring technologies have emerged. These algorithms identify ransomware activity by monitoring system behavior, making them particularly suitable for unknown threats. However, these methods suffer from significant issues in system performance and communication efficiency. The system kernel resource management frequently calls kernel memory allocation functions to handle high-frequency I / O events, and the lack of efficient concurrency control mechanisms leads to severe I / O path congestion. Furthermore, existing identification schemes often analyze individual file operations in isolation, lacking analysis of complete behavioral sequences and intelligent evaluation models. This makes them prone to misclassifying normal backup and compression software as malware, resulting in a high false positive rate and weak adaptive capabilities. Therefore, there is an urgent need for a method that can perform seamless system monitoring and achieve efficient malware identification. Summary of the Invention

[0003] This invention provides a method, apparatus, storage medium, and program for identifying malware, in order to solve the problems of high system kernel usage and low identification efficiency in the malware identification process.

[0004] According to one aspect of the present invention, a method for identifying malware is provided, wherein the method includes: Obtain event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information; Preliminary detection is performed on the static feature data and the behavioral feature data of the software to be detected based on the malicious static feature set and the malicious behavioral feature set, respectively. If the initial detection fails to determine that the software to be detected is malicious, a final judgment result for the software to be detected is generated based on a malicious identification model.

[0005] According to another aspect of the present invention, a malware identification device is provided, wherein the device comprises: The data extraction module is used to acquire event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information. The preliminary detection module is used to perform preliminary detection on the static feature data and the behavioral feature data of the software to be detected based on the malicious static feature set and the malicious behavioral feature set, respectively. The final discrimination module is used to generate a final discrimination result for the software under test based on a malicious identification model when the preliminary detection fails to determine that the software under test is malicious software.

[0006] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the malware identification method according to any embodiment of the present invention.

[0007] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the malware identification method according to any embodiment of the present invention.

[0008] The technical solution provided by this invention generates static feature data and behavioral feature data by acquiring event information generated by the software under test in the system kernel. Preliminary detection is performed on the static feature data and behavioral feature data based on malicious feature sets and malicious behavioral feature sets, respectively. If the preliminary detection fails to determine that the software under test is malicious, a malicious identification model is invoked to perform a final judgment on the software under test to obtain the final judgment result. By collecting event information in the system kernel, the frequency of system kernel calls can be reduced, improving the blocking of system kernel input / output paths, thereby reducing the occupation of system resources. Preliminary detection of the static feature data and behavioral feature data of the software under test based on malicious static feature sets and malicious behavioral feature sets can achieve rapid filtering and improve identification efficiency. Introducing a malicious identification model for secondary judgment of malicious software, based on an intelligent model, improves the reliability of software evaluation, reduces the probability of false positives and false negatives of malicious software, and can improve the efficiency of malicious software identification while reducing system resource occupation.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart of a malware identification method provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of another malware identification method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of another state machine structure provided in Embodiment 2 of the present invention; Figure 4 This is a flowchart of another malware identification method provided in Embodiment 3 of the present invention; Figure 5 This is an example diagram of a malware identification architecture provided in Embodiment 4 of the present invention; Figure 6 This is a flowchart illustrating a malware identification method according to Embodiment 4 of the present invention; Figure 7 This is a schematic diagram of another malware identification device provided in Embodiment 5 of the present invention; Figure 8 This is a schematic diagram of the structure of an electronic device that implements the malware identification method of this invention. Detailed Implementation

[0012] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0013] It should be noted that the terms "first," "second," etc., used in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] Example 1 Figure 1 This is a flowchart of a malware identification method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving the monitoring and identification of malware. The method can be executed by a malware identification device, which can be implemented in hardware and / or software. The malware identification device can be configured on a terminal device or server and can be set in the system user mode. Figure 1 As shown, the method includes: Step 110: Obtain event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information.

[0015] The system kernel can be the basic part of the device's operating system. It provides applications with secure access to the device's underlying hardware and manages system processes, memory, device drivers, files, and network systems. Event information can be related to events triggered by the software under test within the system kernel. This information may include the type and time of the events triggered by the software. Static feature data can reflect the file characteristics of the software under test in a static state, including text features and file fingerprints. Behavioral feature data can include various events triggered by the software under test within the system kernel during execution, the order in which these events are executed, their frequency, and their duration.

[0016] In this embodiment of the invention, events triggered by the software under test in the system kernel can be monitored when the software under test is in running and static states, respectively, so as to obtain the corresponding event information. By performing statistical analysis on the event information, static feature data of the static state of the software under test and behavioral feature data of the running state of the software under test can be obtained.

[0017] Furthermore, the system kernel in this embodiment of the invention can introduce kernel-mode fast memory pool (LookasideList) technology to pre-allocate fixed-size event data structures, avoiding frequent calls to general memory allocation functions on high-frequency I / O paths. Simultaneously, a ring buffer protected by a spin lock is used to cache events, achieving non-blocking or low-blocking data writing and minimizing I / O request latency.

[0018] Furthermore, the kernel and user modes can use independent dual communication channels to push event messages and send / receive control commands separately, avoiding mutual blocking between message reception and command transmission. The kernel can attach a checksum to the encapsulated event message and push it to the user mode via the communication port, setting a timeout for message push to prevent prolonged blocking of the kernel work queue in high-concurrency scenarios. The user mode can asynchronously receive event messages in batches and automatically reconnect in case of communication failure. Preferably, shared memory can also be used to cache event data. The kernel writes the event index or pointer to shared memory and triggers event object notification. Upon receiving the notification, the user mode directly reads the data in batches from shared memory, thereby reducing the number of data copies and context switching overhead between the kernel and user modes and enhancing the system communication efficiency between the kernel and user modes.

[0019] In some application embodiments, event information in the system kernel can be collected by a custom driver module under the Windows platform.

[0020] Step 120: Perform preliminary detection on the static feature data and behavioral feature data of the software to be detected based on the malicious static feature set and malicious behavioral feature set, respectively.

[0021] The malicious static feature set can be a pre-configured set of features, which may include various static features of malware, such as file fingerprints, types, Portable Executable (PE) file structure features, instruction sequence features, function features, entropy features, etc. The malicious behavior feature set, on the other hand, can be a set of features based on independent or continuous behaviors of various malware processes during operation. This set may include process and thread behaviors, file system behaviors, registry behaviors, or network communication behaviors.

[0022] In this embodiment of the invention, a malicious static feature set and a malicious behavioral feature set can be constructed by collecting static and behavioral features of existing malicious software. The static feature data extracted from the software to be detected can be preliminarily detected according to the pre-constructed malicious static feature set, and the behavioral feature data extracted from the software to be detected can be preliminarily detected according to the malicious behavioral feature set. If the static feature data of the software to be detected matches one or more malicious features in the malicious static feature set, and / or the behavioral feature data of the software to be detected matches one or more malicious features in the malicious behavioral feature set, then the software to be detected can be identified as malicious software. Otherwise, if neither the static feature data nor the behavioral feature data of the software to be detected matches the malicious static feature set or the malicious behavioral feature set, then the software to be detected passes the preliminary detection. The preliminary detection result of the software to be detected can be considered normal software, that is, the preliminary detection did not determine that the software to be detected is malicious software.

[0023] Step 130: If the initial detection fails to determine that the software to be detected is malicious software, generate the final judgment result of the software to be detected based on the malicious identification model.

[0024] Among them, the malicious identification model can be a pre-trained intelligent model that can identify malicious software. The malicious identification model can be implemented through gradient boosting trees, random forests, support vector machines, sample clustering models, large artificial intelligence models, etc.

[0025] In this embodiment of the invention, if the software to be detected is not determined to be malicious software after preliminary detection, in order to prevent malicious software from being missed, the software to be detected can also be identified by a pre-trained malicious identification model. The identification result of the malicious identification model for the software to be detected can be used as the final judgment result.

[0026] This invention, in its embodiments, acquires event information from the system kernel of the software to be detected to generate static feature data and behavioral feature data. Preliminary detection is performed on the static feature data and behavioral feature data based on malicious feature sets and malicious behavioral feature sets, respectively. If the preliminary detection fails to determine that the software to be detected is malicious, a malicious identification model is invoked to perform a final judgment on the software to be detected, thereby obtaining the final judgment result. By collecting event information from the system kernel, the frequency of system kernel calls can be reduced, improving the blocking situation of system kernel input / output paths. Preliminary detection of the static feature data and behavioral feature data of the software to be detected based on malicious static feature sets and malicious behavioral feature sets, respectively, enables rapid filtering and improves identification efficiency. The introduction of a malicious identification model for secondary judgment of malicious software enhances the reliability of software evaluation based on an intelligent model, reducing the false negative rate of malicious software. Multiple rounds of identification based on preliminary detection and the malicious identification model can prevent normal software from being falsely reported as malicious software, thus reducing the false positive probability of malicious software.

[0027] Based on the above application embodiments, the event information includes at least I / O request event information captured by the system kernel.

[0028] Specifically, I / O event information includes at least IRP (I / O Request Packet) request packets from the Windows kernel.

[0029] Example 2 Figure 2 This is a flowchart of another malware identification method provided in Embodiment 2 of the present invention. This embodiment is a concretization based on the above embodiments, illustrating the feature extraction and preliminary detection process of the software to be detected. See [link to documentation]. Figure 2 The method provided in this embodiment of the invention specifically includes the following steps: Step 210: Based on the system kernel detecting the first input event or the first output event of the software to be detected, the process image file of the software to be detected is read, and a file fingerprint is generated as static feature data based on at least part of the data in the process image file.

[0030] The first input or output event can be the first input or output event triggered by the software under test within the system kernel. This first input or output event can be determined by the process identifier of the software under test; for example, it can be the process identifier assigned to the software under test by the system kernel, and the first input or output event triggered by that process identifier. The process image file can be a file on disk where the software under test saves its code, data, stack, libraries, and environment variables according to its assigned process identifier. This process image file can include various information about the file under test. The file fingerprint can be a unique file identifier generated using a specific algorithm. This file fingerprint can be generated from the file content of the software under test and can be calculated using algorithms such as MD5, SHA-1, and SHA-256.

[0031] In this embodiment of the invention, when the system kernel detects the first input event or the first output event of the software to be tested, it can send an indication message to the system user. This indication message can indicate that the software to be tested is about to enter the running state. At this time, the process image file of the software to be tested can be loaded into memory. All or part of the data of the process image file can be processed to obtain the file fingerprint of the file to be tested. This file fingerprint can be used as the static feature data of the software to be tested.

[0032] Step 220: Obtain the file operation events reported by the system kernel for the software to be detected, and construct a behavior chain as behavior feature data according to the time information of each file operation event.

[0033] File operation events can be one or more events triggered by the software under test in the system kernel. These events can include system call events, I / O events, memory operation events, process / thread management events, synchronization events, registry / object access events, etc. The time information can be the time when the event was triggered in the system kernel, and can be in the form of a timestamp.

[0034] In this embodiment of the invention, the system kernel can periodically or irregularly report one or more file operation events triggered by the software to be detected. These file operation events can be obtained and arranged in order according to their corresponding time information. The sorted event set can be recorded as a behavior chain, and the behavior chain can be used as the behavior feature data of the software to be detected. That is, the behavior chain can reflect the dynamic behavior characteristics of the software to be detected over a period of time.

[0035] Furthermore, based on the above embodiments of the invention, a behavior chain is constructed as behavior feature data according to the time information of each file operation event, including: Obtain file operation events reported by the system kernel, and extract the process identifier, timestamp, full file path name, and operation type of the file operation events; When a file operation event is obtained, the byte frequency of the software to be tested is counted, and the file entropy value corresponding to the file operation event is determined according to the byte frequency. For each file operation event, the event information of each file operation event is arranged in order of timestamp as a behavior chain. The event information of each file operation event includes at least the process identifier, timestamp, full file path name, operation type and file entropy value.

[0036] Among these, the process identifier can be a unique identifier assigned to the software under test in the system kernel; the timestamp is the time when the event corresponding to the software under test was triggered; the full file path name can be the complete path string of the software under test as resolved by the system kernel, which can include the complete hierarchical path from the system root level to the target file and the full file name; the file entropy value is a quantitative indicator that measures the randomness or disorder of the file data of the software under test; the higher the file entropy value, the more random the data, and the lower the value, the more regular the data. Byte frequency can be the number of times or the probability of different single bytes appearing within a file.

[0037] In this embodiment of the invention, the system kernel can report one or more file operation events triggered by the software to be detected. This reporting method can include the system kernel copying the events to the system user via a message, or the system kernel writing the events to shared memory shared with the system user. The system user can automatically retrieve the file operation events from the shared memory, thereby avoiding communication overhead caused by message transmission and enhancing the system communication efficiency between the kernel mode and the user mode. After obtaining the file operation events, the byte frequency of the software to be detected can be statistically analyzed, and the file entropy value can be calculated based on the byte frequency. This calculation process can be implemented using the following formula: in, This can be the byte frequency of the i-th byte in the entire file of the software to be tested. It can represent the file entropy value.

[0038] Specifically, for each file operation event, the corresponding process identifier, timestamp, full file path name, operation type, and file entropy value can be extracted. The event information of one or more file operation events can be arranged in chronological order according to the timestamps within the file operation events to form a dataset. This dataset can be used as a behavior chain, that is, the behavior chain can include the event information of file operation events arranged in chronological order according to their respective timestamps.

[0039] Step 230: Obtain the Bloom filter constructed according to the malicious static feature set, and perform preliminary detection on the static feature data based on the Bloom filter.

[0040] A Bloom filter can consist of a fixed-length binary array and multiple independent hash functions. Bloom filters can quickly verify the existence of data. Multiple hash functions can be set in a Bloom filter. The binary array of the Bloom filter can store the processing results of malicious static features based on the hash functions. The existence of static feature data can be quickly detected through this Bloom filter.

[0041] In this embodiment of the invention, a Bloom filter can be constructed using the collected malicious static feature set. It is understood that the static features of various malicious software contained in this malicious static feature set can be updated in real time. Whenever a new malicious static feature set is obtained, the Bloom filter can be reset. The Bloom filter can include a counting Bloom filter, a cuckoo Bloom filter, and an adaptive Bloom filter, etc. The hash function configured in the Bloom filter can be called to hash the static feature data. The hash results can be compared with the corresponding positions in the binary array of the Bloom filter. If all hash results match the corresponding positions in the binary array of the Bloom filter, it can be determined that the static feature data belongs to the malicious static feature set, and the software to be detected corresponding to the static feature data has failed the preliminary detection and can be identified as malicious software. If some hash results of the static feature data do not match the corresponding positions in the binary array of the Bloom filter, it can be determined that the software to be detected corresponding to the static feature data has passed the preliminary detection of the static features, and subsequent step 240 can be executed to perform preliminary detection of the behavioral characteristics of the software to be detected.

[0042] Step 240: Obtain the rule decision-maker constructed according to the malicious behavior feature set, and perform preliminary detection on the behavior feature data according to the rule decision-maker.

[0043] Among them, the rule decision-maker can be a logical decision-making component based on preset conditions or prior expert knowledge. The rule decision-maker can judge behavioral feature data and determine whether the software to be detected is malicious software. The rule decision-maker can be implemented in the form of decision tree or state machine.

[0044] In this embodiment of the invention, a rule decision-maker can be constructed according to a malicious behavior feature set. The rule decision-maker may include preset conditions or prior expert knowledge for identifying malicious behavior features within the malicious behavior feature set. The rule decision-maker can be used to identify the behavior feature data of the software to be detected and determine whether the behavior data to be detected meets the discrimination conditions of malicious software within the rule decision-maker. If yes, it is determined that the software to be detected has failed the preliminary detection; otherwise, it is determined that the behavior feature identification of the software to be detected has passed the preliminary detection.

[0045] It is understood that in some embodiments, preliminary detection may be performed only through step 230, or preliminary detection may be performed only through step 240. In the embodiments of this application, when the software to be detected is identified as malicious software during the preliminary detection process, further identification of the software to be detected may be performed, or the software to be detected may be directly blocked, etc.

[0046] Step 250: If the initial detection fails to determine that the software to be detected is malicious, generate the final judgment result of the software to be detected based on the malicious identification model.

[0047] In this embodiment of the invention, when the system kernel detects the first input or first output event of the software under test, it reads the process mapping file of the software under test and processes a portion of the data in the process image file into a file fingerprint as static feature data. It collects file operation events reported by the system kernel for the software under test, constructs a behavior chain based on the time information of the file operation events as feature data, performs preliminary detection on the static feature data using a Bloom filter generated from a malicious static feature set, and performs preliminary detection on the behavior feature data using a rule decision-maker corresponding to the malicious behavior feature set. If the preliminary detection does not determine that the software under test is malicious, a final judgment result for the software under test is generated based on a malicious identification model. This embodiment of the invention can quickly detect the existence of malicious static features of the software under test using a Bloom filter, reducing the waiting time of the preliminary detection process and the initial detection waiting time of multi-level malicious software identification. The rule decision-maker judges the behavior features of the software under test, ensuring that the dynamic behavior of the software under test does not contain malicious behavior features, ensuring the accuracy of the initial detection, achieving rapid filtering, and improving identification efficiency. Furthermore, combined with the malicious identification model, a secondary judgment is made on the malicious software, improving the reliability of software evaluation based on an intelligent model, and reducing the probability of false positives and false negatives of malicious software.

[0048] Furthermore, based on the above embodiments of the invention (i.e., when the comprehensive risk score in the following text meets the suspicious detection threshold range), the rule decision-maker includes a state machine, which performs preliminary detection on the behavioral feature data according to the rule decision-maker, including: Obtain at least one state machine constructed according to a malicious behavior feature set, wherein the state machine includes at least one detection state and a state transition condition for the detection state; input a behavior chain consisting of at least one file operation event from the behavior feature data into the state machine in sequence, so as to judge the file operation event according to the state transition condition of the state machine; determine whether the behavior chain causes the software to be detected to reach the final state of the state machine. If so, the software to be detected is preliminarily determined to be malicious software. If not, the software to be detected passes the preliminary detection.

[0049] The state machine can consist of a finite number of states, input events, state transition conditions, and outputs. The states within the state machine can include various detection states divided according to the stage of identifying the software to be detected as malware. Each state can be configured with its corresponding state transition conditions, which can indicate the conditions for transitioning from the current state of the state machine to the next state. These state transition conditions can be composed of malware features corresponding to the type of software to be detected within the malicious behavior feature set.

[0050] In this embodiment of the invention, a state machine can be pre-constructed according to a malicious behavior feature set. This state machine can be divided into multiple stages according to the temporal relationship of each malicious behavior corresponding to the type of software to be detected (such as ransomware) within the malicious behavior feature set. Each stage can be regarded as a detection state, and the state transition conditions of the corresponding detection state can be set according to the correlation between malicious behaviors (a certain software only corresponds to a set of detection processes of its own type, rather than requiring coverage of all malicious behavior features). For example, when a specific behavior occurs, the current detection state is transitioned to the next detection state, etc. A constructed state machine can be used to discriminate behavioral feature data. It can obtain behavioral chains composed of file operation event information, where each node consists of different file operation event information. The state machine can be used to sequentially discriminate the event information of each file operation event in the behavioral chain. For example, it can be checked whether the event information of the current file operation event in the behavioral chain satisfies the state transition condition of the current detection state. If yes, the state machine enters the next detection state and uses the state transition condition of the next detection state to discriminate the event information of the next file operation event in the behavioral chain. If not, the state machine is used to discriminate the event information of the next file operation event in the behavioral chain (i.e., continuing to determine whether the next event satisfies the state transition condition of the current detection state). The state machine can be used to identify the behavioral chain of the software to be detected. If the behavioral chain of the software to be detected reaches the final state of the state machine, this final state indicates that the software to be detected is malicious software. If the behavioral chain of the software to be detected does not cause the state machine to reach the final state, it indicates that the software to be detected has passed the preliminary detection and has not been identified as malicious software during the preliminary detection process.

[0051] In some embodiments of the invention, the detection states of the state machine include an initial state, a scan state, a read state, an encryption state, a rename state, and a cleanup state, and the state transition conditions include at least one of the following: The state transition condition from the initial state to the scanning state is: the number of times the software under test enumerates files in the same directory exceeds a set threshold within a unit of time. State transition condition from scan state to read state: Continuous read operation by the software under test is detected; State transition conditions from read state to encrypted state: A write operation is detected in the software under test, the Shannon entropy of the written data block corresponding to the write operation is greater than the first threshold, and the read-write byte ratio of the software under test meets the second threshold range. State transition condition from encrypted state to renamed state: The detected software changes more than the third threshold in the proportion of file name suffix changes within the window time. The state transition condition from renaming state to cleanup state is: the original file of the software to be detected is deleted, and the number of deleted files is greater than the fourth threshold.

[0052] For details, see Figure 3The detection states of the state machine can include initial state, scan state, read state, encryption state, rename state, and cleanup state. State transition conditions can be set between adjacent detection states. In the initial state, the system can determine the number of times the software under test scans files in each directory based on the event information of each file operation event in the behavior chain. When the number of file enumerations in the same directory by the software under test within a unit of time is greater than a set threshold, it can be determined that the event information of that file operation event satisfies the state transition condition of the initial state of the state machine, and the state machine can transition from the initial state to the scan state. In the scan state, the system can statistically analyze the read operations of the software under test based on the event information of one or more file operation events in the behavior chain to determine whether the software under test has performed continuous read operations. If the event information of the file operation events determines that the software under test has performed continuous read operations, it can be determined that the software under test satisfies the state transition condition of the scan state, and the state machine can transition from the scan state to the read state. In the read state, the system can determine the data blocks to be written for write operations based on the event information of each file operation event in the behavior chain. The system uses the Shannon entropy and read / write byte ratio to determine whether a write operation has been detected in the software under test. If the Shannon entropy of the written data block is greater than the first threshold, and the read / write byte ratio of the software under test meets the second threshold, the software under test meets the state transition conditions for the encrypted state, and the state machine can transition from the read state to the encrypted state. In the encrypted state, the system can determine the change ratio of the file name suffix of the software under test through the event information of file operation events on the behavior chain of the software under test. If the change ratio meets the third threshold, the software under test meets the state transition conditions for the renaming state, and the state machine can switch to the renaming state. In the renaming state, the system can determine whether the original file of the software under test has been deleted through the event information of file operation events on the behavior chain of the software under test, and whether the number of deleted files is greater than the fourth threshold. If so, the software under test meets the state transition conditions for the cleanup state, and the software under test can be preliminarily identified as malicious software, meaning the software under test has failed the preliminary detection. If the state machine corresponding to the software under test has not reached the final cleanup state, the software under test has not been identified as malicious software.

[0053] Based on the above embodiments of the invention, before obtaining at least one state machine constructed according to the malicious behavior feature set (i.e., before the state machine discrimination described in step 240), the method further includes: Based on the process identifier and full file path name of each file operation event in the behavioral feature data, the target rules for matching the software to be detected are determined within the malicious behavior feature set. Determine the matching conditions of the target rules and the matching status of each file operation event in the behavioral feature data, and generate a comprehensive risk score for the software to be detected based on each matching status; If the overall risk score meets the malicious detection threshold, the software to be detected will be identified as malicious software and its execution will be blocked. If the overall risk score meets the suspicious detection threshold, the behavioral feature data will continue to be preliminarily detected according to the rule decision-maker. If the overall risk score meets the normal detection threshold range, the preliminary detection result of the software to be tested is determined to be normal software.

[0054] In this embodiment of the invention, before identifying the behavior chain of the software to be detected according to the state machine based on the malicious behavior feature set, the comprehensive risk score of the software to be detected is first determined, thereby achieving rapid risk detection based on the comprehensive risk score: if the comprehensive risk score meets the malicious detection threshold range, it is directly identified as malicious software and blocked (without entering the state machine); if it meets the suspicious detection threshold range, it continues to enter the state machine for behavior chain discrimination; if it meets the normal detection threshold range, the preliminary detection result is determined to be normal software. Thus, rapid traffic diversion is achieved through the comprehensive risk score, improving the efficiency of malicious software identification. Specifically, the process identifier and full file path name of the corresponding file operation events in the behavioral feature data of the software to be detected can be extracted. The system then searches for matching target rules within the malicious behavior feature set based on these process identifiers and full file path names. The behavioral feature data can be detected according to these target rules, and a risk score is generated based on the degree of matching between the target rules and the behavioral feature data. The weighted average or weighted sum of the risk scores for the target rules can be used as the comprehensive risk score of the software to be detected. If the comprehensive risk score meets the malicious detection threshold, the software to be detected is identified as malicious software, and its execution is blocked. If the comprehensive risk score meets the suspicious detection threshold, the behavioral feature data continues to be preliminarily detected according to the rule decision-maker. If the comprehensive risk score meets the normal detection threshold, the preliminary detection result of the software to be detected is determined to be normal software. The comprehensive risk score is used to classify and manage the software to be detected, further improving the efficiency of malicious software identification.

[0055] It is understandable that the comprehensive risk score and state machine discrimination are both two levels of discrimination within the preliminary detection: the comprehensive risk score is used for rapid traffic triage; software to be detected whose comprehensive risk score meets the malicious detection threshold is directly identified as malicious software and blocked, without needing to enter the state machine discrimination; only when the comprehensive risk score meets the suspicious detection threshold does it enter the state machine to discriminate the behavior chain. Regardless of whether it has undergone state machine discrimination, if the preliminary detection does not determine that the software to be detected is malicious software, the malicious identification model generates the final discrimination result in the manner described in step 130. That is, the comprehensive risk score and state machine discrimination are the preliminary detection level judgments, while the malicious identification model's judgment is the final discrimination level judgment; the two are judgments at different levels.

[0056] For example, the target rule can be the rule corresponding to "deleting backup files and then performing batch file writing". Its matching condition is that the deletion operation of backup files and the batch file writing operation occur successively within the time window. The weight and confidence of each target rule can be pre-configured according to prior expert knowledge. When file operation events that meet the matching condition occur successively in the behavioral feature data, it is determined that the target rule has been matched. The comprehensive risk score of the software to be tested can be generated according to the matching of each file operation event with the target rule.

[0057] Example 3 Figure 4 This is a flowchart of another malware identification method provided in Embodiment 3 of the present invention. This embodiment of the present invention describes the detection and updating process of the malware identification model. See [link to documentation]. Figure 4 The method provided in this embodiment of the invention specifically includes the following steps: Step 310: Determine static feature data and behavioral feature data based on the event information of the software to be detected within the system kernel.

[0058] Step 320: Perform preliminary detection on the static feature data and behavioral feature data of the software to be detected based on the malicious static feature set and malicious behavioral feature set, respectively.

[0059] Step 330: If the initial detection does not determine that the software to be detected is malicious, extract the target file operation events of the software to be detected within a preset time window, and statistically analyze the malicious detection characteristics of the software to be detected according to each target file operation event. The malicious detection characteristics include: file modification frequency per unit time, average file entropy change value, read / write byte ratio, number of unique file suffix increases, and application call sequence anomaly degree.

[0060] The preset time window can be a time window divided according to a fixed time length. The preset time window can ensure that the file operation event being processed is within a certain time limit, which can improve the reliability of malware identification.

[0061] In this embodiment of the invention, when the initial detection fails to determine that the software to be detected is malicious, target file operation events can be extracted through a preset time window. That is, the timestamps of the target file operation events can be located within the preset time window. Statistical analysis can be performed on the extracted target file operation events to determine malicious detection characteristics such as file modification frequency per unit time, average file entropy change value, read / write byte ratio, number of unique file extension additions, and application call sequence anomaly. The file modification frequency per unit time can be the ratio of the total number of file modification operations (such as creation, overwriting, editing, and attribute changes) performed on the files of the software to be detected within a fixed statistical time window to the length of the fixed statistical time window. This reflects the density of batch file tampering by the software to be detected within a short period and can be used to determine the batch encryption behavior of malicious software. The average file entropy change value can be the arithmetic mean of the differences between the original entropy value before the file write operation and the final entropy value after the file write operation, calculated separately for each file of the software to be detected. This average file entropy change value reflects the overall entropy change level of the software to be detected and can quantify the possibility that the software to be detected has been encrypted or compressed. The read byte ratio can be the ratio of the total number of bytes read and written to the total number of bytes written by the software under test within a preset time window. The number of newly added file extensions can be the total number of unique file extension types that have appeared in the files under test within the preset time window and have not appeared before. The application call sequence can be a chronological sequence of system calls, file API calls, registry calls, and process creation calls from the software under test; the degree of similarity between this sequence and that of normal software can be used as the anomaly score of the application call sequence.

[0062] Step 340: Based on the malicious detection features, call the pre-trained malicious identification model to generate a malicious probability score of the software to be detected, wherein the malicious identification model includes at least a gradient boosting decision tree model.

[0063] The Gradient Boosting Decision Tree (GBDT) model can be an iterative cluster learning model based on ensemble learning. It uses a single decision tree as a base learner, iteratively training it in a gradient boosting manner, and using it to determine prediction parameters with the decision tree from the previous iteration. Through multiple iterations, a model is generated that includes a weighted sum of multiple decision trees. The GBDT model can be trained based on both static and dynamic behavioral features of malware. It's important to note that the aforementioned malware detection features differ from the previously mentioned static and behavioral feature sets. The former are statistical features extracted from target file operation events for inference in the malware identification model, while the latter are a collection of known static and behavioral features of malware, used to construct Bloom filters and rule-based decision-makers in the initial detection process.

[0064] In this embodiment of the invention, a pre-trained malicious detection model can be invoked to analyze the software to be detected, thereby obtaining a malicious probability score for the corresponding software. For example, the static feature data and behavioral feature data of the software to be detected can be input into the malicious detection model. This malicious detection model includes at least a gradient boosting decision tree, which can output a probability value indicating that the software to be detected is malicious software. This probability value can be used as the malicious probability score. Specifically, a feature vector can be constructed according to the various malicious detection features obtained in step 330. The feature vector is then input into the malicious detection model as a whole, and the malicious detection model makes a judgment based on the values ​​of each feature dimension within the feature vector. That is, the aforementioned malicious detection features are statistically analyzed and input into the malicious detection model in the same inference process. Other statistical features can also be included in the feature vector as needed, but this embodiment of the invention does not limit this.

[0065] Step 350: When the malicious probability score is greater than the threshold, the final judgment result is determined to be malicious software.

[0066] Specifically, the malicious probability score of the software to be detected can be compared with a threshold. When the malicious probability score is greater than the threshold, the final judgment result of the software to be detected can be set as malicious software, that is, the software to be detected can be identified as malicious software. Furthermore, interception operations can be performed on the software to be detected that has been identified as malicious software.

[0067] This application may also update the training sample pool of the malicious detection model, and may include the following steps: Step 360: Obtain the normal software and malicious software identified within the threshold time period, set corresponding category labels for normal software and malicious software respectively, and save the normal software, malicious software and corresponding category labels to the model training sample pool.

[0068] In this embodiment of the invention, software identified as normal software and malicious software within a specified time interval is acquired at each threshold time interval. Corresponding category labels can be set for normal software and malicious software respectively. These category labels can identify normal software or malicious software; for example, a category label value of 1 indicates normal software, and a category label value of 0 indicates malicious software. The normal software, malicious software, and their respective category labels collected within the time interval corresponding to the threshold time interval can be saved as sample data to the model training sample pool. Furthermore, in some embodiments, the model training sample pool can also be updated; for example, sample data that has been stored for a long time can be cleared from the model training sample pool periodically or at regular intervals.

[0069] Step 370: Determine the incremental update of the model training sample pool, and update the malicious identification model according to the incremental data of the model training sample pool.

[0070] Specifically, when an incremental update is detected in the model training sample pool, that is, new sample data is added to the model training sample pool, the malicious identification model can be updated according to the incremental data in the model training sample pool, that is, the newly added normal software / or malicious software. This allows the malicious identification model to adjust its parameters according to the incremental data to adapt to the constantly changing malicious software.

[0071] In this embodiment of the invention, static and behavioral feature data of the software under test are determined by detecting event information of the software under test through the system kernel. Preliminary detection is performed on the static and behavioral feature data of the software under test based on malicious static feature sets and malicious behavioral feature sets, respectively. If the preliminary detection does not determine that the software under test is malicious, target file operation events of the software under test within a preset time window are extracted. Malicious detection features of the software under test are statistically analyzed according to each target file operation event. A pre-trained malicious identification model is called to generate a malicious probability score for the software under test. Whether the software under test is malicious is determined according to a threshold and the malicious probability score. Normal and malicious software identified within the threshold time are acquired, category labels are added, and the data is saved to the model training sample pool. The malicious identification model is updated according to the incremental data in the model training sample pool after incremental updates occur. This embodiment of the invention incrementally updates the malicious identification model based on incremental data, enabling adaptive parameter changes and self-correcting evolution of the system, improving the reliability of malicious software identification and enhancing the stability of system operation.

[0072] Furthermore, based on the above embodiments of the invention, the malicious identification model is updated according to the incremental data of the model training sample pool, including: training and generating an incremental decision tree for the malicious identification model according to the incremental data; pruning the current decision tree for the threshold number of the malicious identification model; and using the incremental decision tree and the pruned current decision tree as the updated malicious identification model.

[0073] Specifically, iterative training can be performed periodically or irregularly using incremental sample data from the model training sample pool. The model weights of the malicious identification model are adjusted based on the newly added behavioral features and their corresponding category labels from the incremental sample data. The newly added behavioral features can include malicious or non-malicious behavioral features, and the category labels can include labels for malicious software or normal software. An incremental decision tree adapted to the incremental sample data is generated. From the already trained malicious identification model, the current decision tree that is the oldest since the last generation is selected and pruned according to a threshold number. These selected current decision trees are then removed from the malicious identification model. The trained incremental decision trees and the pruned current decision trees can be merged and combined to form an updated malicious identification model.

[0074] In other embodiments of the invention, the method further includes: determining decision branches whose path depth within the malicious identification model is lower than a fifth threshold, processing the feature combinations and judgment conditions corresponding to the decision branches into a kernel detection rule table; and pushing the kernel detection rule table to the system kernel driver layer so that the system kernel driver layer can intercept malicious software according to the kernel detection rule table.

[0075] Here, path depth can be the node depth of the decision tree within the malicious detection model, and the kernel detection rule table can be a structured rule dataset maintained by the operating system kernel. The system kernel can quickly detect events triggered by the software to be detected based on the kernel detection rule table to determine whether they are malicious software. Specifically, the feature combinations and judgment conditions of the corresponding decision branches in the malicious detection model can be extracted into the kernel detection rule table, which can be integrated into the system kernel in the form of eBPF bytecode.

[0076] Specifically, the decision tree within the malicious detection model can be detected according to the fifth threshold to identify decision branches in the decision tree that are below the fifth threshold. The feature combinations and judgment conditions corresponding to the decision branches can be converted into a kernel detection rule table, and this kernel detection rule table can be pushed to the system kernel driver layer. The system kernel driver layer can then identify malicious software according to this kernel detection rule table, thereby achieving rapid interception of malicious software.

[0077] For example, the feature combination corresponding to a decision branch of the malicious identification model can be "the file modification frequency per unit time is greater than the threshold number, and the Shannon entropy of the written data block is greater than the first entropy threshold," with the judgment condition being that both of the above features are satisfied simultaneously. This feature combination and judgment condition can be converted into an interception rule in the kernel detection rule table. When the system kernel driver layer detects that the file operation event of the software to be detected simultaneously satisfies "the file modification frequency per unit time is greater than the threshold number" and "the Shannon entropy of the written data block is greater than the first entropy threshold," it directly intercepts the file operation of the software to be detected in the kernel state. Alternatively, the feature combination could also be "the number of unique file extension additions is greater than the threshold number, and the number of original file deletions is greater than the deletion threshold," etc., and this embodiment of the invention does not limit this.

[0078] Example 4 Figure 5 This is an example diagram of a malware identification architecture provided in Embodiment 4 of the present invention. See also... Figure 5 This invention provides a malware identification architecture that addresses the problems of low detection accuracy, high system resource consumption, and poor adaptability in existing malware identification technologies. In a preferred embodiment, the following description uses the Windows operating system platform as an example. This malware identification architecture may include a kernel driver acquisition layer, a user-mode intelligent analysis service layer, and an API interface interaction layer. Kernel driver acquisition layer: Deployed in the operating system kernel space, it is responsible for intercepting, filtering, and initially encapsulating low-level I / O requests. Its core is a custom driver framework, which includes a driver management module, an I / O interception module, a high-speed buffer queue module, and a shared memory communication module.

[0079] User-mode intelligent analysis service layer: Running in the operating system's user space, it serves as the system's intelligent detection brain. It includes an event reception and parsing module, a behavior sequence aggregation module, a tiered detection engine (static feature detection, feature rule base matching, dynamic behavior pattern analysis, machine learning prediction and evaluation), and an adaptive learning module.

[0080] API Interface Interaction Layer: Provided in the form of a dynamic link library (DLL), it is responsible for exposing standard interfaces such as registration callbacks, threat querying, and response handling to upper-layer applications, enabling rapid integration of detection capabilities.

[0081] Specifically, in this embodiment of the invention, the kernel driver layer can be implemented by functional modules such as a driver management model, an I / O interception module, a high-speed buffer queue module, a shared memory communication module, an event receiving and parsing module, a behavior sequence aggregation module, and a tiered detection engine. The following is a detailed description of the implementation of each functional module: Driver management module: Responsible for driver loading, initialization, and device object creation. During the initialization phase, it establishes a fast memory pool and a circular queue, maps shared memory regions, and registers file system callbacks.

[0082] The I / O interception module listens for IRPs (Input / Output Requests) in the Windows file system. When sensitive operations such as write, rename, or delete are detected, it extracts key metadata (process ID, file path, operation type, timestamp, file size) and calls kernel-level pre-detection logic to perform preliminary screening of system I / O operation characteristics. It filters the system process whitelist, matches the directory file blacklist for direct blocking, and reports the event information.

[0083] The high-speed buffer queue module uses a spinlock mechanism to push encapsulated event structures into a circular queue without blocking. If the queue is full, low-priority events are discarded according to a strategy to ensure system stability.

[0084] Shared memory communication module: Monitors the size of the circular queue. Once the threshold is reached or a timer is triggered, it wakes up the user-mode service through an event object and writes the data pointer to the shared memory.

[0085] The user-mode analysis service layer consists of the following modules: Event receiving and parsing module: listens for kernel event signals, reads raw data in batches from shared memory, parses it into a standard internal event format, and pushes it into a thread-safe work queue.

[0086] Behavior sequence aggregation module: Based on process ID and time window, it aggregates discrete I / O events into complete behavior sequences, providing context for subsequent analysis.

[0087] Tiered detection engine: This engine mainly consists of three logically connected layers: L1 static feature fast filtering layer, L2 heuristic operation chain dynamic analysis layer, and L3 machine learning intelligent judgment layer.

[0088] The L1 static feature fast filtering layer uses process file hash value (hereinafter referred to as "process fingerprint") and target file hash value (hereinafter referred to as "file fingerprint") for dual verification to achieve millisecond-level blocking of known threats; The L2 heuristic operation chain dynamic analysis layer identifies atomic operation sequences with typical ransomware characteristics based on expert database rule thresholds and complete behavioral operation chains. The L3 machine learning intelligent judgment layer uses multi-dimensional behavioral feature vectors and gradient boosting tree models to perform probabilistic scoring of unknown variants and covert attacks.

[0089] The tiered configuration of the aforementioned detection sub-engines means that an event will only flow to the next level when the previous level determines it to be "unknown" or "low risk," ultimately leading to the decision center executing blocking, isolation, or release operations. The technical solutions corresponding to the L1, L2, and L3 levels can form a tiered detection system, from rapid filtering of static features to dynamic analysis of behavioral chains and then to intelligent judgment using machine learning.

[0090] See Figure 5 The malware identification architecture provided in this embodiment of the invention will be described in detail for each layer of the detection sub-assembly. The malware identification method may include the following steps: Step 1: The main objective of the L1 static feature fast filtering layer is to intercept known threats with minimal resource consumption using a deterministic knowledge base. The algorithm employs a dual-path hash verification mechanism: first, it extracts the local hash value of the executable file (PE) of the process currently initiating the I / O operation and compares it against known ransomware family libraries; second, it extracts the overall or partial hash value of the file being operated on and compares it against known encrypted files or malicious sample libraries, which are also the malicious static feature set in this embodiment. The underlying data structure of this layer uses a Bloom filter for existence screening, improving resource utilization efficiency and initial screening accuracy. This L1 static feature fast filtering layer corresponds to the technical solution in this embodiment of the invention that uses a Bloom filter for preliminary detection of static feature data.

[0091] The extraction of process fingerprints and file fingerprints is achieved through the following steps: Step 1.1: Process Fingerprint Extraction. Intercept the process's first I / O event, and use a "three-part method" to read the first 4KB, last 4KB, and 1KB of data after the entry point of the process image file, and calculate the process SHA-256 hash value. ; Step 1.2: File fingerprint extraction. Based on the size of the intercepted operation file. Dynamically select the sampling strategy. If Read the entire file content; if The "three-part method" is used to read the first 4KB, the last 4KB, and the middle 4KB of data given a random offset, and then the SHA-256 hash value of the file is calculated. .

[0092] Step 1.3: Perform an initial existence screening of file fingerprints and process fingerprints using a Bloom filter. This specific step may include: Step 1.3.1: Initialize the filter data structure. Initialize a bit array B of length m bits, with all bits initialized to 0. The size of m is calculated based on the expected number of elements n and the allowable false positive rate p:

[0093] Step 1.3.2: Select k independent hash functions These functions map an input fingerprint x of arbitrary length to an index range of [0, m-1].

[0094] ,in, This describes the processing procedure for the i-th hash function of the Bloom filter. To form The hash function has two base hash functions, which can be different truncations of MD5 or SHA1, where i is the index of the i-th hash function. .

[0095] Step 1.3.3: Malicious fingerprint preloading.

[0096] A collection of fingerprints of known malicious processes and known malicious file fingerprint set Enter the Bloom filter. For each malicious fingerprint... Calculate k hash values: Set the position in bit array B corresponding to the hash result of each malicious fingerprint to 1: This involves constructing a Bloom filter using a set of malicious static signatures (a set of fingerprints of known malicious processes and a set of fingerprints of known malicious files).

[0097] Step 1.3.4: Perform initial screening using the filter.

[0098] When the L1 layer extracts the fingerprint of the current process and / or file When this happens, the following judgment logic is executed: (1) Multidimensional mapping computation: using k independent hash functions of Bloom filter Process fingerprints and / or file fingerprints Calculate using the hash result: .

[0099] (2) Bit state detection. Check the bit array B. hash result The setting of the corresponding position, if there exists any j such that That is, the hash result in the bit array If the corresponding bit is set to 0, the program is considered "absolutely safe," and the subsequent hash table exact match confirmation process is skipped, allowing the program to proceed immediately; if for all j, there is... That is, all hash results in the bit array. If the corresponding bit is set to 1, then It may be located in the malware database. Understandably, Bloom filters can produce false positives, that is... It may also be incorrectly identified as being located in a malicious database.

[0100] Step 1.4: Confirm precise match.

[0101] Because Bloom filters inherently possess false positive properties (potentially misclassifying normal fingerprints as malicious), in a preferred embodiment of the present invention, for suspected fingerprints initially screened by the Bloom filter... The suspected fingerprint can be found in the memory hash table that serves as the malware library. A second confirmation is performed. If the confirmation is successful, the software is immediately marked as "known malicious" and a blocking log is triggered. If the confirmation fails, the software is marked as "unknown" and the process is transferred to the L2 heuristic operation chain dynamic analysis layer, which can reduce the false alarm rate.

[0102] Step 2: The L2 heuristic operation chain dynamic analysis layer is a crucial link connecting the underlying feature matching with the upper-layer machine learning judgment. Its core function is to overcome the limitations of single static feature detection by constructing a "time-behavior" multi-dimensional correlation model to perform context-aware deep analysis of the file operation sequence of a process. This layer aims to accurately identify atomic operation combinations with typical ransomware characteristics (such as "scan -> read plaintext -> high-entropy write -> rename -> delete original file"), while effectively distinguishing normal high-frequency I / O services (such as database backup and file compression). The algorithm integrates two mechanisms: "feature rule base matching detection based on expert systems" and "dynamic behavior pattern analysis based on finite state machines (FSM)," forming a dual detection defense. This L2 heuristic operation chain dynamic analysis layer corresponds to the technical solution in this embodiment of the invention that uses a rule decision-maker (state machine) and comprehensive risk score to perform preliminary detection of behavioral feature data.

[0103] Step 2.1: Feature rule base matching detection based on expert system. Feature rule base matching detection is implemented by using a predefined expert rule base. It can quickly scan operation events in a single time window or a short time window to identify known malicious operation fingerprints, such as batch modification of specific suffixes, abnormal access to sensitive directories, etc.

[0104] The process of feature rule base matching and detection based on expert systems may include the following steps: Step 2.1.1: Rule base construction and loading.

[0105] When the system starts, the feature rule base is loaded synchronously from the local configuration file or the cloud. Each rule Defined as a triple , Represents matching conditions, supporting logical combinations (AND / OR / NOT). Matching conditions include file path regular expressions, file extension lists, operation type sets, entropy thresholds, etc. Represents the rule weight. Representation rules confidence level (0 < ≤1). This represents the triggering action, which can include "marking suspicious", "directly blocking", "escalating monitoring level", etc.

[0106] Step 2.1.2: Real-time event stream scanning.

[0107] Each file operation event reported by the kernel may include a process identifier (Pid), a timestamp, a full file path (Path), an operation type (OpType), and a file entropy value (Entropy). Furthermore, in some embodiments, the reported file operation event may not include the file entropy value; instead, the file entropy value is calculated in user space based on the file operation event. For example, a file operation event can be represented as: The following matching process can be executed for each file operation event: Step 2.1.2.1: Use a hash table to index the full file path name (Path) and operation type (OpType) to quickly filter out a subset of possible matching rules. ,in, , .

[0108] Step 2.1.2.2: Traversal The rules in the verification Whether it is true or false, i.e., file operation event. Does it meet the requirements? Rules in For example, if OpType==RENAME and the Path suffix belongs to one of the ransomware suffix sets, then the ransomware extension condition is met; if OpType==WRITE and Entropy≥7.8 (high entropy write event threshold), then the high entropy write condition is met.

[0109] Step 2.1.3: Weighted scoring and decision-making.

[0110] Calculate the overall risk score of the current event based on the conditions it meets. .

[0111]

[0112] in This is an indicator function; it is 1 if the condition is met, and 0 otherwise.

[0113] When making a decision, if Immediately trigger blocking and generate an alarm, among which, This can represent a high threshold, and its value can be 0.9, 0.95, or 0.875, etc.; if If it is marked as "suspicious," the event and its context are pushed into the dynamic behavior analysis queue for in-depth analysis using the dynamic behavior pattern analysis algorithm (i.e., preliminary detection of behavioral feature data according to the rule decision-maker); if If so, it is considered normal operation and the passage is allowed.

[0114] Step 2.2: The dynamic behavior pattern analysis algorithm maintains an independent finite state machine for each active process, tracking the transition path of its behavioral states. A high-risk determination is triggered only when a process has completely experienced a state transition chain, such as from "read" to "encrypt" to "delete," within a specific time window. This mechanism effectively filters out occasional abnormal operations, significantly reducing the false alarm rate. Detailed implementation steps are as follows: Step 2.2.1: Define the state machine model.

[0115] Instantiate an independent state machine for each active process P in the system: ;in Represents a set of states, containing Initial state; The scan state is characterized by a large number of CREATE / QUERY operations; The read state is characterized by continuous READ operations; The encrypted state is characterized by a high-entropy WRITE operation; The renaming state is characterized by batch SET_INFORMATION operations that modify filenames / suffixes; The cleanup state is characterized by batch DELETE operations on the original file; and the final... Malicious confirmation state. The malicious confirmation state is the terminated state of the state machine; that is, when the chain of actions causes the software to be detected to reach this malicious confirmation state, the software is determined to be malicious software. It represents the set of input events, which can be a standardized file operation event stream. This represents the state transition function, which defines the state transition logic and triggering conditions. Represents the set of terminating states, which is A subset, for example . It refers to the sliding window time.

[0116] Step 2.2.2: Define state transition conditions and time window constraints. The system maintains a sliding time window. (For example, 30 seconds). State transitions depend not only on the event type but also on the time interval. Operation frequency constraints. Define the transfer function. The core logic is as follows: :exist The number of file enumerations for the same directory within a given time period exceeds a set threshold.

[0117] :Enter Continuous read operations detected; enter Immediately following, a write operation occurs, and the Shannon entropy of the data block written is calculated. : ,in, This represents the probability of the j-th byte appearing; like Shannon entropy threshold It can be 7.8, and the read / write byte ratio is... If it is determined to be an encryption behavior, then proceed to... .

[0118] :Enter ,exist The percentage of filename extension changes within a given time period ,in, This refers to the number of changes made to filename suffixes. Number of file name extensions; Enter Subsequently, it was detected that the original file had been deleted, and the number of deleted files exceeded the set threshold.

[0119] Step 2.2.3: Determination and scoring of the integrity of the behavioral chain.

[0120] When the state machine transitions to Or When a state remains in a high-risk state for a given period of time, which may include an encrypted state, a cleanup state, etc., a behavioral chain integrity score is calculated. :

[0121] in, The weights represent the importance of each state in the state machine (encryption and cleanup states have the highest weights). Indicates the chain of behavior in The effective duration of stay. This represents the total duration of the behavior chain. This represents the number of files affected. This represents the threshold for the number of affected files. This represents the path penalty coefficient. If the state transition skips a critical intermediate state (e.g., directly from...),... Jump to ), Significantly reduces the risk of misjudgment.

[0122] The introduction of a behavior chain judgment threshold for further verification is a preferred embodiment of the present invention. The "reaching the final state constitutes malware" principle described in this embodiment is the basic discrimination logic, upon which the behavior chain judgment threshold is introduced. Further verification is needed to prevent software from being incorrectly identified as malware. For example, if a software's behavior chain integrity score is... ,Should If the process is under ransomware attack, its state is set to [state name missing]. If the behavior chain integrity score is less than the judgment threshold, the software to be detected is not considered malicious, but the monitoring records are retained as reference data for subsequent machine learning analysis; if the state machine is in Automatically reset after timeout If the behavior chain integrity score is greater than or equal to the judgment threshold, it is considered normal business fluctuation, and temporary counts such as the effective duration of the behavior chain in each state are cleared. In summary, when the behavior chain integrity score is greater than or equal to the judgment threshold, it is judged as malware and blocked; when the behavior chain integrity score is less than the judgment threshold, it is not judged as malware, but the state machine continues to monitor; when the state machine times out and resets, it is considered normal business fluctuation, and temporary data is cleared. This process balances the detection rate and false alarm rate through a multi-level judgment mechanism.

[0123] Step 2.2.4: Anomaly Branch Handling. If the ransomware employs a "slow encryption" or "jump operation" strategy, a backtracking mechanism is introduced: If discrete high-risk events (such as isolated high-entropy writes) are detected, even if a complete state chain is not triggered, but the cumulative number exceeds a threshold, the system will forcibly increase the "basic risk score" of the corresponding behavior chain integrity score of the process. For example, the behavior chain integrity score can be directly assigned to the basic risk score, and a higher weight coefficient can be given during the L3 machine learning intelligent judgment layer to ensure no false alarms are missed.

[0124] Step 3: The L3 machine learning intelligent judgment layer receives the deep features passed from the L1 and L2 layers, especially the statistical features of the operation chain, and uses the Gradient Boosting Decision Tree (GBDT) model to perform the final probability scoring. This L3 machine learning intelligent judgment layer corresponds to the technical solution in this embodiment of the invention for generating the final discrimination result of the software to be detected based on the malicious identification model.

[0125] Step 3.1: Feature extraction.

[0126] Aggregate the behavioral data of the process within the sliding window to construct a multidimensional feature vector. Key features included in the multidimensional feature vector can be: file modification frequency per unit time, average file entropy change, read / write byte ratio, number of unique file extension additions, and API call sequence anomaly degree, etc.

[0127] Step 3.2: Model Prediction. Using a pre-trained GBDT model. Output the probability score of malice:

[0128] in, P represents the transition probability P from the multidimensional feature vector x to the true label y=1 (marked as a malicious behavior sequence, thus confirming that the software to be detected is malicious software). For the k-th decision regression tree, This represents the weight of the k-th decision regression tree. Let be the Sigmoid activation function, used to map real numbers to the probability of (0,1). If If the threshold is dynamic, it is identified as malware (such as ransomware, Trojan horse, worm, spyware, etc.).

[0129] Furthermore, embodiments of the present invention may also include an adaptive learning module, which is used to achieve parameter adaptation and self-correcting evolution of the system. The adaptive learning module includes functions such as automatic whitelist expansion, incremental model update, and feedback correction mechanism.

[0130] 1) Automatic whitelist expansion: This tracks operational patterns that are flagged as "suspicious" by L2 / L3 layers but ultimately deemed safe by the user. If a certain behavioral pattern occurs frequently within the statistical period... Furthermore, there are no false alarm records, and its characteristics are automatically extracted and added to the local whitelist library.

[0131] 2) Incremental Model Update: The newly captured positive sample feature vectors that are indeed considered ransomware samples are updated. Its label y=1, and the negative sample feature vectors that are judged as high-risk for not exhibiting destructive behavior. The sample and its label y=0 are stored in the sample buffer pool. The additional sub-thread model weak learner learns the residuals of the new samples and fits a new decision tree. Then, the new decision regression tree is used for online model updates:

[0132] in, This is the predicted output of the current GBDT model. The global learning rate is used to prevent overfitting. The dynamic weights of the new tree can be determined using a line search algorithm on the new sample set to find the optimal solution.

[0133] Meanwhile, the incremental weak learner of this GBDT model also uses a sliding window to "prune" the earliest generated decision regression tree, that is, remove the earliest generated K trees to ensure that the model always focuses on recent threat features, while freeing up memory resources.

[0134] After each incremental update, the system automatically traverses the newly generated decision tree, identifying split nodes with the highest information gain and shallowest path depth (e.g., "WriteFile count > 100 and Entropy > 7.8"). These high-order logic rules are converted into eBPF bytecode executable by the kernel driver. Through a "shared memory + event object" communication mechanism deployed in the operating system kernel space, the converted rule table is asynchronously pushed to the kernel driver layer. This allows the ransomware signature to be intercepted directly in the kernel within milliseconds the next time it appears, while the event message is still reported to the user layer. In the kernel-user space communication process, the traditional message-by-message copying method is abandoned, and a large-capacity data buffer based on shared memory is designed. The kernel driver only needs to write the event index or pointer to shared memory and trigger notifications through event objects. Upon receiving the signal, the user-mode program directly reads data in batches from shared memory. This significantly reduces the number of data copies and context switching overhead between kernel and user spaces, improves throughput, and enhances the system communication efficiency between kernel and user spaces.

[0135] 3) Feedback Correction: If the system performs a blocking operation, and subsequently detects that the user manually restores or undoes the operation, the judgment threshold will be adjusted in reverse based on the user's handling result. Optimize detection sensitivity.

[0136] Furthermore, in this embodiment of the invention, the API interface interaction layer primarily provides standardized interfaces in the form of dynamic link libraries (DLLs), supporting rapid integration of detection capabilities by upper-layer applications. Its implementation mainly utilizes shared memory and asynchronous event notification mechanisms to communicate with the user-mode intelligent analysis service, ensuring low latency and high concurrency security of interface calls. The core interfaces are as follows: RegisterCallback(EventType, CallbackFunc): Registers a threat event callback function; QueryThreatInfo(ProcessId): Queries threat details and confidence level for the specified process; ExecuteAction(ActionType, TargetId): Performs actions such as blocking, isolating, and restoring. UpdatePolicy(PolicyJson): Dynamically distributes detection policies and rule configurations.

[0137] In one exemplary implementation, real-time detection and blocking of the location-based ransomware variant Ransom_X is taken as an example: Step 1: Kernel Interception and Preliminary Screening After “Ransom_X” starts, it attempts to traverse the user's document directory. A custom kernel driver intercepts its IRP_MJ_CREATE, IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION requests. Because this process is not on the system whitelist and the target of the operation contains a large number of .docx and .xlsx files, the driver encapsulates its metadata into an event structure, pushes it into a circular queue, and notifies the user-space service via shared memory.

[0138] Step 2: L1 layer filtering The user-space service receives the event and extracts the process fingerprint and target file fingerprint of "Ransom_X". After initial screening with a Bloom filter and exact matching with a hash table, no known features were found, so the data is classified as "unknown" and flows into the L2 layer.

[0139] Step 3: Dynamic Analysis of L2 Layer The behavior sequence aggregation module aggregates discrete events into a process behavior flow. The L2 state machine detects that this process behavior flow performs an operation chain of "scan -> read -> high-entropy write (H>7.9) -> rename to .encrypted suffix -> delete original file" on more than 50 files within a short period of time (T<5s). The behavior chain score can be calculated.

[0140] If the L2 layer behavior chain judgment threshold Set to 0.7 (below the direct blocking threshold of 0.85), at this time The threshold has been exceeded. However, if the blocking threshold is not reached, a high-risk alert can be triggered. But to ensure the accuracy of malware identification, the data continues to flow into the L3 layer machine learning intelligent judgment layer for final confirmation. It should be noted that 0.85 is the L2 layer direct blocking threshold (corresponding to the CRITICAL level), and 0.7 is the L2 layer alert threshold (corresponding to the HIGH level). The two constitute the two-level judgment mechanism of the L2 layer; while the L3 layer machine learning model has an independent ML probability threshold (such as 0.7 for CRITICAL, 0.5 for HIGH, and 0.3 for MEDIUM) for final judgment.

[0141] Step 4: L3 Layer Intelligent Analysis The L3 layer extracts feature vector x (i.e., malicious detection features), including extremely high file modification frequency, abnormal read-to-write ratio (writes far exceeding reads), and suffix mutations. After being input into the GBDT model, the output malicious probability Score = 0.98.

[0142] Step 5: Handling and Feedback.

[0143] Based on the combined results from both L2 and L3 layers, the decision center determined it to be a ransomware attack. The system immediately invoked a kernel interface to suspend the "Ransom_X" process, locked permissions on the encrypted files to prevent further spread, and displayed an alert window. Simultaneously, the adaptive learning module labeled the sample's features for subsequent incremental model updates.

[0144] In another embodiment, taking the handling of false alarms in normal business software under high load as an example, this embodiment of the invention describes how the system avoids misjudging normal database backup and log archiving operations as ransomware in a high-load database server operation scenario.

[0145] Scenario: A company's database management system (DBMS) performs a routine full backup in the early morning, involving the reading, compression (high-entropy writing), and temporary file cleanup of hundreds of GB of data, resulting in extremely high I / O throughput.

[0146] Step 1: Kernel interception and L1 layer filtering.

[0147] The kernel driver captures a large number of write operations. The L1 layer extracts the fingerprint of the DBMS process and finds that it is in the "trusted business software whitelist" (based on digital signature or historical reputation). It allows the process to proceed directly without going into deep analysis, which greatly reduces CPU usage.

[0148] Step 2: L2 layer deep verification (assuming the whitelist is invalid or not hit).

[0149] If the system enters layer L2, the state machine detects that although there is "high-entropy write" (caused by compression), the critical steps of "batch renaming to unfamiliar suffixes" and "deleting the original data files" are missing. The DBMS's operation mode is "read -> compress and write to a new backup file -> retain the original data file". The state machine cannot transition to the dangerous state F of "deleting the original file", and ,lead to Extremely low (e.g., 0.1), far below the threshold.

[0150] Step 3: L3 layer auxiliary confirmation.

[0151] Even if the data flows into layer L3, the feature vector shows that the "number of file extension changes" is 0 and the "original file deletion rate" is 0. The GBDT model outputs a malicious probability score of 0.02.

[0152] result: The system determined this to be normal business activity and did not intervene, ensuring the successful completion of the database backup task. Simultaneously, the adaptive module recorded the normal behavior pattern under this high load, optimizing the detection threshold for similar business scenarios to further improve future recognition accuracy.

[0153] In another exemplary embodiment, the incremental update process of the adaptive learning module is described.

[0154] In this embodiment of the invention, the adaptive learning module is deployed at the L3 layer of the user-mode analysis engine to capture the characteristics of new ransomware variants in real time during system operation and to fine-tune the machine learning model online. This process does not interrupt the main detection thread and employs an asynchronous sub-thread execution mechanism. The incremental update process of the model based on the gradient boosting model may include: Step 1: Dynamic Sample Pool Construction and Labeling In this embodiment of the invention, the system maintains a fixed-capacity circular buffer as a dynamic sample pool. The process of constructing and labeling this dynamic sample pool may include the following steps: Step 1.1: Data collection.

[0155] The adaptive learning module monitors the detection logs of L1 and L2 layers in real time. For example, when the L2 layer state machine completely matches a ransomware behavior chain (e.g., high-frequency reading → entropy surge → batch renaming → original file deletion) and is not blocked by the whitelist, the feature vector of that process is extracted. (Including API call sequence hash, I / O frequency, entropy changes, etc.), and label it with y=1 (malicious); when the L3 layer initially judges it as high risk, but it is confirmed as a benign operation (false alarm) after subsequent processing or manual confirmation, the feature vector is extracted. And mark it with the label y=0 (benign); Step 1.2: Pooling operation, adding the tuples Store in the dynamic sample pool.

[0156] Step 1.3: Trigger the update and monitor the number of new samples in the sample pool in real time. .like If the condition is met, then step two is triggered; otherwise, continue waiting for data collection. You can set the threshold number of records to trigger an update, for example, 50 records.

[0157] Step 2: Calculate the current negative gradient of the model, and load the current gradient boosting decision tree model in a background low-priority thread. (Composed of m-1 decision trees), calculate the negative gradient of the loss function for a new sample set in the dynamic sample pool.

[0158] Step 2.1: Predict the output.

[0159] Gradient boosting decision trees For new samples Make a prediction and obtain the predicted value. .

[0160] Step 2.2: Loss Calculation.

[0161] The prediction error is measured using the log-loss function: ,in, For new samples The true labels are y=1, which indicates that the new sample is malicious software, and y=0, which indicates that the new sample is benign software, consistent with the meaning of the label y mentioned earlier.

[0162] Step 2.3: Solve for the negative gradient.

[0163] Calculate the negative gradient of the logarithmic loss function with respect to the current predicted value, denoted as the pseudo residual. .

[0164]

[0165] in, This can represent the "correction direction" and "correction strength" of the current gradient boosting decision tree model on new samples.

[0166] Step 3: Fit the newly added weak learner.

[0167] Using the pseudo residuals calculated in step two As the new target variable, train a new regression tree. .

[0168] Step 3.1: Traverse all feature dimensions and find the best split point for the feature with high confidence, so as to minimize the sum of squared pseudo residuals of the child nodes after splitting.

[0169] Step 3.2: Time decay weighting.

[0170] Introducing a time decay factor ,in, The weights are determined by temporal distance; samples closer to the current time have higher weights. This makes the newly generated tree... It tends to fit the latest attack patterns (concept drift) rather than overfitting old samples; Step 3.3: Output the leaf nodes.

[0171] Calculate the output value for each leaf node Typically, the average of all sample spurious residuals within that leaf node or the value after regularization is taken.

[0172] Step 4: Model fusion and adaptive weight adjustment.

[0173] By generating the new tree Integrate into the existing model to form an updated model .

[0174] Step 4.1: Step Size Search. The optimal learning rate (step size) is calculated using the Line Search algorithm. To minimize the total loss on the new sample set:

[0175] Step 4.2: Model update.

[0176] based on The gradient boosting decision tree model is updated additively.

[0177] Step 4.3: Slide the window to "prune".

[0178] Check the total number M of trees in the model. If (Maximum number of trees, used to control memory) removes the earliest K generated trees to ensure the model always focuses on recent threat features.

[0179] Step 5: Feature rule extraction and kernel distribution. The specific steps are as follows: Step 5.1: Critical path extraction.

[0180] Analyze the newly generated tree The top K split nodes with the highest contribution (e.g., WriteFile count > 100 and Entropy > 7.2).

[0181] Step 5.2: Rule transformation.

[0182] The high-order feature combinations corresponding to the top K split nodes with the highest contribution are transformed into fast matching rules executable by the kernel driver (such as BPF filter instructions). BPF (Berkeley Packet Filter) is a lightweight bytecode filtering mechanism that can be executed in the operating system kernel space, characterized by low overhead and high efficiency. Here, the high-order feature combinations are compiled into BPF bytecode instructions, enabling the kernel driver to quickly filter and intercept file operation events of the software to be detected without switching to user space.

[0183] The updated fast matching rules are asynchronously copied to the kernel driver via a "shared memory + event object" communication mechanism for kernel-level filtering and interception. This "shared memory + event object communication mechanism" can be specifically defined as a large-capacity data buffer based on shared memory. The kernel driver only needs to write the event index or pointer to the shared memory and trigger a notification via an event object. Upon receiving the signal, the user-space program directly reads data in batches from the shared memory.

[0184] Example 5 Figure 7 This is a schematic diagram of another malware identification device provided in Embodiment 5 of the present invention, as shown below. Figure 7 As shown, the device includes: The data extraction module 410 is used to acquire event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information.

[0185] The preliminary detection module 420 is used to perform preliminary detection on the static feature data and the behavioral feature data of the software to be detected based on the malicious static feature set and the malicious behavioral feature set, respectively.

[0186] The final discrimination module 430 is used to generate a final discrimination result of the software to be detected based on a malicious identification model when the initial detection fails to determine that the software to be detected is malicious software.

[0187] In this embodiment of the invention, a data extraction module acquires event information of the software to be detected from the system kernel to generate static feature data and behavioral feature data. A preliminary detection module performs preliminary detection on the static feature data and behavioral feature data based on malicious feature sets and malicious behavior feature sets, respectively. If the preliminary detection fails to determine that the software to be detected is malicious, the final judgment module invokes a malicious identification model to perform a final judgment on the software to obtain the final judgment result. By collecting event information from the system kernel, the frequency of system kernel calls can be reduced, improving the blocking of system kernel input / output paths. Introducing a malicious identification model for secondary judgment of malicious software enhances the reliability of software evaluation based on an intelligent model, reducing the probability of false positives and false negatives of malicious software detection.

[0188] Furthermore, based on the above embodiments of the invention, the data extraction module 410 includes: A static feature unit is used to read the process image file of the software under test based on the system kernel detecting the first input event or the first output event of the software under test, and generate a file fingerprint as the static feature data based on at least part of the data of the process image file. The behavior feature unit is used to acquire file operation events reported by the system kernel for the software to be detected, and construct a behavior chain according to the time information of each file operation event as the behavior feature data.

[0189] In some embodiments of the invention, the behavior feature unit constructs a behavior chain as the behavior feature data according to the time information of each file operation event, including: Extract the process identifier, timestamp, full file path name, and operation type of the file operation event; The byte frequency of the software to be tested is counted, and the file entropy value corresponding to the file operation event is determined according to the byte frequency. For each file operation event, the event information of each file operation event is arranged sequentially according to the timestamp as the behavior chain, wherein the event information of the file operation event includes at least the process identifier, the timestamp, the full path name of the file, the operation type, and the file entropy value.

[0190] In some embodiments of the invention, the preliminary detection module 420 includes: The first detection unit is used to obtain a Bloom filter constructed according to the malicious static feature set, and to perform the preliminary detection on the static feature data based on the Bloom filter.

[0191] The second detection unit is used to acquire a rule decision-maker constructed according to the malicious behavior feature set, and to perform the preliminary detection on the behavior feature data according to the rule decision-maker.

[0192] Based on the above embodiments of the invention, the rule decision maker includes a state machine, and the second detection unit is specifically used to: acquire at least one state machine constructed according to the malicious behavior feature set, wherein the state machine includes at least one detection state and the state transition conditions of the detection state; The behavior chain consisting of at least one file operation event in the behavior feature data is sequentially input into the state machine to determine the file operation event according to the state transition conditions of the state machine; Determine whether the behavior chain causes the software to be tested to reach the final state of the state machine. If yes, the software to be tested is preliminarily determined to be malicious software. If no, the software to be tested passes the preliminary detection.

[0193] Based on the above embodiments of the invention, the detection states of the state machine include an initial state, a scan state, a read state, an encryption state, a rename state, and a cleanup state, and the state transition conditions include at least one of the following: The state transition condition from the initial state to the scanning state is: the number of times the software under test enumerates files in the same directory exceeds a set threshold within a unit of time. State transition condition from scan state to read state: Continuous read operation by the software under test is detected; State transition conditions from read state to encrypted state: A write operation is detected in the software under test, the Shannon entropy of the written data block corresponding to the write operation is greater than the first threshold, and the read-write byte ratio of the software under test meets the second threshold range. State transition condition from encrypted state to renamed state: The detected software changes more than the third threshold in the proportion of file name suffix changes within the window time. The state transition condition from renaming state to cleanup state is: the original file of the software to be detected is deleted, and the number of deleted files is greater than the fourth threshold.

[0194] Based on the above embodiments of the invention, the second detection unit further includes: a rule matching unit, used to determine the target rule to be matched by the software to be detected in the malicious behavior feature set according to the process identifier and full file path name of each file operation event in the behavioral feature data; Determine the matching conditions of the target rule with the matching situation of each file operation event in the behavioral feature data, and generate a comprehensive risk score of the software to be detected based on each matching situation; If the comprehensive risk score meets the malicious detection threshold range, the software to be detected is identified as malicious software, and the execution of the software to be detected is blocked. If the comprehensive risk score meets the suspicious detection threshold range, then the preliminary detection of the behavioral feature data continues according to the rule decision-maker; If the comprehensive risk score meets the normal detection threshold range, then the preliminary detection result of the software to be tested is determined to be normal software.

[0195] In some embodiments of the invention, the final discrimination module 430 includes: The window extraction unit is used to extract target file operation events of the software to be detected within a preset time window, and to statistically analyze the malicious detection features of the software to be detected according to each target file operation event. The malicious detection features include: file modification frequency per unit time, average file entropy change value, read / write byte ratio, number of unique file suffix increases, and application call sequence anomaly degree.

[0196] A probability generation unit is used to generate a malicious probability score of the software to be detected by calling the pre-trained malicious identification model based on the malicious detection features, wherein the malicious identification model includes at least a gradient boosting decision tree model.

[0197] The software determination unit is used to determine the final determination result as malicious software when the malicious probability score is greater than a threshold.

[0198] Based on the above embodiments, the invention further includes: an incremental update module, used to acquire normal software and malicious software identified within a threshold time period, set corresponding category labels for the normal software and the malicious software respectively, and save the normal software, the malicious software and the corresponding category labels to the model training sample pool; determine the incremental update of the model training sample pool, and update the malicious identification model according to the incremental data of the model training sample pool.

[0199] Based on the above embodiments of the invention, the malicious identification model is updated according to the incremental data of the model training sample pool, including: training and generating an incremental decision tree of the malicious identification model according to the incremental data; pruning the current decision tree of the threshold number in the malicious identification model; and using the incremental decision tree and the pruned current decision tree as the updated malicious identification model.

[0200] In some embodiments of the invention, the system further includes: a rule update unit, configured to determine decision branches in the malicious identification model whose path depth is lower than a fifth threshold, process the feature combination and judgment conditions corresponding to the decision branches into a kernel detection rule table; and push the kernel detection rule table to the system kernel driver layer so that the system kernel driver layer can intercept the malicious software to be detected according to the kernel detection rule table.

[0201] The malware identification device provided in this embodiment of the invention can execute the malware identification method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0202] Example 6 Figure 8 This is a schematic diagram of the structure of an electronic device implementing the malware identification method of this invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0203] like Figure 8As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0204] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0205] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as malware identification methods.

[0206] In some embodiments, the malware identification method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the malware identification method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the malware identification method by any other suitable means (e.g., by means of firmware).

[0207] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0208] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0209] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0210] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0211] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0212] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0213] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0214] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for identifying malicious software, characterized in that, The method includes: Obtain event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information; Preliminary detection is performed on the static feature data and the behavioral feature data of the software to be detected based on the malicious static feature set and the malicious behavioral feature set, respectively. If the initial detection fails to determine that the software to be detected is malicious, a final judgment result for the software to be detected is generated based on a malicious detection model.

2. The method according to claim 1, characterized in that, The step of extracting static feature data and behavioral feature data of the software to be detected based on the event information includes: Based on the system kernel detecting the first input event or the first output event of the software to be detected, the process image file of the software to be detected is read, and a file fingerprint is generated as the static feature data based on at least a portion of the data in the process image file. The system kernel obtains file operation events reported by the system kernel for the software to be detected, and constructs a behavior chain based on the time information of each file operation event as the behavior feature data.

3. The method according to claim 2, characterized in that, The step of constructing a behavior chain based on the time information of each file operation event as the behavior feature data includes: Extract the process identifier, timestamp, full file path name, and operation type of the file operation event; The byte frequency of the software to be tested is counted, and the file entropy value corresponding to the file operation event is determined according to the byte frequency. For each file operation event, the event information of each file operation event is arranged sequentially according to the timestamp as the behavior chain, wherein the event information of the file operation event includes at least the process identifier, the timestamp, the full path name of the file, the operation type, and the file entropy value.

4. The method according to claim 1, characterized in that, The preliminary detection of the static feature data and behavioral feature data of the software to be detected based on the malicious static feature set and malicious behavioral feature set respectively includes: Obtain a Bloom filter constructed according to the malicious static feature set, and perform the preliminary detection on the static feature data based on the Bloom filter; Obtain a rule decision-maker constructed according to the malicious behavior feature set, and perform the preliminary detection on the behavior feature data according to the rule decision-maker.

5. The method according to claim 4, characterized in that, The rule decision-maker includes a state machine, and the preliminary detection of the behavioral feature data according to the rule decision-maker includes: Obtain at least one state machine constructed according to the malicious behavior feature set, wherein the state machine includes at least a detection state and a state transition condition for the detection state; The behavior chain consisting of at least one file operation event in the behavior feature data is sequentially input into the state machine to determine the file operation event according to the state transition conditions of the state machine; Determine whether the behavior chain causes the software to be tested to reach the final state of the state machine. If yes, the software to be tested is preliminarily determined to be malicious software. If no, the software to be tested passes the preliminary detection.

6. The method according to claim 5, characterized in that, The detection states of the state machine include an initial state, a scan state, a read state, an encryption state, a rename state, and a cleanup state. The state transition conditions include at least one of the following: The state transition condition from the initial state to the scanning state is: the number of times the software under test enumerates files in the same directory exceeds a set threshold within a unit of time. State transition condition from scan state to read state: Continuous read operation by the software under test is detected; State transition conditions from read state to encrypted state: A write operation is detected in the software under test, the Shannon entropy of the written data block corresponding to the write operation is greater than the first threshold, and the read-write byte ratio of the software under test meets the second threshold range. State transition condition from encrypted state to renamed state: The detected software changes more than the third threshold in the proportion of file name suffix changes within the window time. The state transition condition from renaming state to cleanup state is: the original file corresponding to the software to be detected is deleted, and the number of deleted files is greater than the fourth threshold.

7. The method according to claim 5, characterized in that, Before obtaining at least one state machine constructed according to the malicious behavior feature set, the method further includes: Based on the process identifier and full file path name of each file operation event in the behavioral feature data, the target rule for matching the software to be detected is determined within the malicious behavior feature set; Determine the matching conditions of the target rule with the matching situation of each file operation event in the behavioral feature data, and generate a comprehensive risk score of the software to be detected based on each matching situation; If the comprehensive risk score meets the malicious detection threshold range, the software to be detected is identified as malicious software, and the execution of the software to be detected is blocked. If the comprehensive risk score meets the suspicious detection threshold range, then the preliminary detection of the behavioral feature data continues according to the rule decision-maker; If the comprehensive risk score meets the normal detection threshold range, then the preliminary detection result of the software to be tested is determined to be normal software.

8. The method according to claim 1, characterized in that, The generation of the final judgment result of the software to be detected based on the malicious identification model includes: Extract the target file operation events of the software to be detected within a preset time window, and statistically analyze the malicious detection features of the software to be detected according to each target file operation event. The malicious detection features include: file modification frequency per unit time, average file entropy change value, read / write byte ratio, number of unique file suffix increases, and application call sequence anomaly degree. Based on the malicious detection features, the pre-trained malicious identification model is invoked to generate a malicious probability score for the software to be detected, wherein the malicious identification model includes at least a gradient boosting decision tree model; When the malicious probability score is greater than the threshold, the final judgment result is determined to be malicious software.

9. The method according to claim 1, characterized in that, Also includes: Obtain normal software and malicious software identified within a threshold time period, set corresponding category labels for the normal software and the malicious software respectively, and save the normal software, the malicious software and the corresponding category labels to the model training sample pool; Determine the incremental update of the model training sample pool, and update the malicious identification model according to the incremental data of the model training sample pool.

10. The method according to claim 9, characterized in that, The step of updating the malicious identification model according to the incremental data of the model training sample pool includes: The incremental decision tree of the malicious identification model is generated by training the incremental data. Prune the current decision tree for the threshold number in the malicious identification model; The incremental decision tree and the pruned current decision tree are used as the updated malicious identification model.

11. The method according to claim 9, characterized in that, Also includes: Determine the decision branches whose path depth is lower than the fifth threshold within the malicious identification model, and process the feature combinations and judgment conditions corresponding to the decision branches into a kernel detection rule table; The kernel detection rule table is pushed to the system kernel driver layer so that the system kernel driver layer can intercept the malware to be detected according to the kernel detection rule table.

12. A malware identification device, characterized in that, The device includes: The data extraction module is used to acquire event information generated by the software under test in the system kernel, and extract static feature data and behavioral feature data of the software under test based on the event information. The preliminary detection module is used to perform preliminary detection on the static feature data and the behavioral feature data of the software to be detected based on the malicious static feature set and the malicious behavioral feature set, respectively. The final discrimination module is used to generate a final discrimination result for the software under test based on a malicious identification model when the initial detection fails to determine that the software under test is malicious software.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the malware identification method according to any one of claims 1-11.

14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the malware identification method according to any one of claims 1-11.