Ransomware detection method and device, electronic equipment and storage medium
By recording and analyzing process information, file operations and network connection information in the operating system kernel, building a process tree, and marking suspicious processes, the problem of misjudgment and omission caused by a single detection dimension in the existing technology is solved, and a more reliable and comprehensive system is achieved. Ransomware detection.
Patent Information
- Application Number
- CN202410869692.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-30
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-30
AI Technical Summary
Existing ransomware virus detection technology has a single detection dimension, leading to misjudgments and omissions, and cannot effectively detect evolved ransomware viruses.
By presetting the detection program in the operating system kernel, the process information, file operation information and network connection operation information of each process are recorded, and probe instrumentation is used to obtain detailed information, build a process tree, mark suspicious processes and associated processes, and comprehensively Check whether it is a ransomware virus.
It improves the reliability and comprehensiveness of ransomware detection, reduces misjudgments and omissions, and can effectively identify multi-dimensional ransomware behaviors.
Smart Images

Figure CN118690364A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ransomware detection, and in particular to a ransomware detection method, device, electronic device and storage medium. Background Art
[0002] Ransomware is one of the main threats to network security in recent years. The main behavior of this virus is to encrypt files, destroy data and lock the system. Specifically, it usually uses various means (such as infecting executable files or databases) to encrypt infected files, making it impossible for users to access or modify these files.
[0003] In the related technologies, the detection and defense technologies for ransomware usually have the defect of a single detection dimension. With the continuous evolution of ransomware technology, it has added a lot of processing to bypass security mechanisms, which can easily lead to more misjudgments or omissions in a single detection solution, and thus fail to effectively detect ransomware. Summary of the invention
[0004] The purpose of the present invention is to provide a ransomware virus detection method, device, electronic device and storage medium, which can comprehensively detect whether a suspicious process belongs to a ransomware virus based on the suspicious process and all file operations and network connection operations generated by associated processes associated with the suspicious process, thereby improving the reliability and comprehensiveness of ransomware virus detection.
[0005] In order to solve the above technical problems, the present invention provides a ransomware virus detection method, comprising:
[0006] Using a detection program preset in the operating system kernel, the process information of each process appearing in the operating system, the file operation information generated when the process calls a file operation, and the network connection operation information generated when the process calls a network connection operation are recorded; wherein the process information includes the association relationship between the process and its parent process;
[0007] When a suspicious process that calls the file operation on the preset bait file in the storage space is detected, the suspicious process and the processes associated with the suspicious process are marked as processes to be detected according to the process information;
[0008] According to all file operation information and all network connection operation information corresponding to all the processes to be detected, detect whether the suspicious process is a ransomware process.
[0009] Optionally, before using a detection program preset in the operating system kernel to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, the method further includes:
[0010] Using a first probe to insert a stub in a process operation function, using a second probe to insert a stub in the file operation function, and using a third probe to insert a stub in the network connection operation function; wherein the process operation function includes a process execution function and a process derivative function;
[0011] Mounting the detection program at the insertion position of the first probe, the insertion position of the second probe, and the insertion position of the third probe;
[0012] The detection program preset in the operating system kernel is used to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, including:
[0013] Determine whether the process operation function is called by using the detection program through the first probe, and obtain the process information from the parameters of the process function when it is determined that the process operation function is called;
[0014] Determine whether the file operation function is called by using the detection program through the second probe, and obtain file operation information from the parameters of the file operation function when it is determined that the file operation function is called;
[0015] The detection program is used to determine whether the network connection operation function is called through the third probe, and when it is determined that the network connection operation function is called, the network connection operation information is obtained from the parameters of the network connection operation function.
[0016] Optionally, after detecting and recording the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, the method further includes:
[0017] The process information, the file operation information and the network connection operation information transmitted from the kernel state to the user state by the detection program are obtained through the hash map.
[0018] Optionally, after detecting and recording the process information of each process appearing in the operating system by using a preset detection program in the operating system kernel, the method further includes:
[0019] Constructing a process tree according to the association relationship between each process and its parent process;
[0020] The step of marking the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information includes:
[0021] A process tree where the suspicious process is located is determined, and all processes in the process tree are set as the processes to be detected.
[0022] Optionally, the process information further includes a process entity file path, the file operation information includes a file path of an operated file, and the network connection operation information includes a network connection operation type, and the network connection operation type is an inbound type or an outbound type;
[0023] The detecting whether the suspicious process is a ransomware process according to all file operation information and all network connection operation information corresponding to all the processes to be detected includes:
[0024] According to the file operation information, all file paths operated by the process to be detected are added to a suspicious file set;
[0025] According to the file operation information and the process entity file path of each process to be detected, all processes that operate the files corresponding to the process entity file path are added to the suspicious process set;
[0026] According to the network connection operation information, adding the process that performs the inbound type of network connection operation in the suspicious process set to the suspicious inbound process set, and adding the process that performs the outbound type of network connection operation in the suspicious process set to the suspicious outbound process set;
[0027] Determine a ransomware virus assessment value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set;
[0028] When it is determined that the ransomware evaluation value is greater than a preset threshold, the suspicious process is determined to be a ransomware process.
[0029] Optionally, determining the ransomware virus assessment value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set includes:
[0030] According to each file path in the suspicious file set, determine the preset file types that have been operated by the process to be detected and the number of file paths covered by the process to be detected in each preset file type; wherein each preset file type corresponds to multiple file paths, and each preset file type corresponds to a different file type weight;
[0031] When the suspicious inbound process set is empty, the preset inbound identification value is set to a first value, or when the suspicious inbound process set is not empty, the preset inbound identification value is set to a second value;
[0032] When the suspicious outbound process set is empty, the preset outbound identification value is set to the first value, or when the suspicious inbound process set is not empty, the preset outbound identification value is set to the second value;
[0033] The ransomware virus assessment value is determined according to the preset file types that have been operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value.
[0034] Optionally, determining the ransomware virus assessment value according to the preset file types operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value includes:
[0035] The ransomware virus assessment value is determined according to the following formula based on the preset file types that the process to be detected has operated, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value:
[0036]
[0037] Where S represents the ransomware virus evaluation value, k represents the total number of preset file types, T n Indicates the total number of file paths corresponding to the nth preset file type, h n represents the number of file paths covered by the process to be detected corresponding to the nth preset file type, W n represents the file type weight of the nth preset file type, i represents the preset inbound identification value, o represents the preset outbound identification value, α and β represent the weights of the preset inbound identification value and the preset outbound identification value respectively.
[0038] Optionally, after determining that the suspicious process is a ransomware process, the method further includes:
[0039] Setting the process information of each process in the suspicious process set as the process information to be disabled;
[0040] The process corresponding to each process information to be disabled is blocked.
[0041] The present invention also provides a ransomware virus detection device, comprising:
[0042] A kernel detection module, used to record, by using a detection program preset in the kernel of the operating system, the process information of each process appearing in the operating system, the file operation information generated when the process calls a file operation, and the network connection operation information generated when the process calls a network connection operation; wherein the process information includes the association relationship between the process and its parent process;
[0043] A process marking module to be detected is used to mark the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information when a suspicious process that calls the file operation on the bait file preset in the storage space is detected;
[0044] The ransomware process detection module is used to detect whether the suspicious process is a ransomware process based on all file operation information and all network connection operation information corresponding to all the processes to be detected.
[0045] The present invention also provides an electronic device, comprising:
[0046] Memory for storing computer programs;
[0047] A processor is used to implement the ransomware virus detection method as described above when executing the computer program.
[0048] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the ransomware virus detection method as described above is implemented.
[0049] The present invention provides a ransomware virus detection method, comprising: using a detection program preset in an operating system kernel to record process information of each process appearing in the operating system, file operation information generated when the process calls a file operation, and network connection operation information generated when the process calls a network connection operation; wherein the process information includes an association relationship between the process and its parent process; when a suspicious process that calls the file operation on a bait file preset in a storage space is detected, the suspicious process and processes associated with the suspicious process are marked as processes to be detected according to the process information; and according to all file operation information and all network connection operation information corresponding to all the processes to be detected, detecting whether the suspicious process is a ransomware virus process.
[0050] It can be seen that the present invention can first preset a detection program in the operating system kernel, and can use the detection program to normalize the process information of each process appearing in the operating system, the file operation information generated by the process when calling a file operation, and the network connection operation information generated by the process when calling a network connection operation. Among them, the process information includes the association between the process and its parent process. In other words, the detection program can comprehensively record each process itself, the association between the process and its parent process, and the file operations and network connection operations performed by the process. In addition, the present invention can also preset bait files in the storage space. Furthermore, when a suspicious process that calls the file operation on the preset bait file in the storage space is detected based on the record of the detection program, the suspicious process and the processes associated with the suspicious process can be marked as processes to be detected according to the process information, and the suspicious process can be detected whether it is a ransomware process according to all the file operation information and all the network connection operation information corresponding to all the processes to be detected, that is, the file operation and network connection operation performed by the suspicious process and the file operation and network connection operation performed by all the processes associated with the suspicious process can be comprehensively determined to determine whether the suspicious process is a ransomware process, thereby improving the reliability of ransomware detection. The present invention also provides a ransomware detection device, an electronic device, and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0052] Figure 1 A flowchart of a ransomware virus detection method provided by an embodiment of the present invention;
[0053] Figure 2 A structural block diagram of a ransomware detection system provided by an embodiment of the present invention;
[0054] Figure 3 A flowchart of another ransomware detection method provided by an embodiment of the present invention;
[0055] Figure 4 A structural block diagram of a ransomware detection device provided by an embodiment of the present invention;
[0056] Figure 5 The present invention provides a structural block diagram of an electronic device. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Ransomware is one of the main threats to network security in recent years. The main behavior of this virus is to encrypt files, destroy data and lock the system. Specifically, it usually uses various means (such as infecting executable files or databases) to encrypt infected files, making it impossible for users to access or modify these files.
[0059] In the related art, the detection and defense technology for ransomware usually has the defect of a single detection dimension. For example, the related art can usually set a bait file in the file path that the ransomware may operate, and can detect whether there is a process operating the bait file. When a process operating the bait file is detected, the related art can compare the process information of the process with the security policy, and perform corresponding operations on the process according to the security policy. However, this method is prone to produce more false positives, for example, normal processes in the operating system may also operate on the bait file; in addition, with the continuous evolution of ransomware technology, ransomware has added a lot of processing to bypass security mechanisms, which can easily lead to more misjudgments or omissions in the solutions in the related art, and thus the ransomware cannot be effectively detected. In view of this, the present invention can provide a ransomware detection method, which can comprehensively detect whether the suspicious process belongs to the ransomware based on the suspicious process, all file operations generated by the associated processes associated with the suspicious process, and network connection operations, thereby improving the reliability and comprehensiveness of ransomware detection.
[0060] For easier understanding, please refer to Figure 1 , Figure 1 A flowchart of a ransomware detection method provided by an embodiment of the present invention, the method may include:
[0061] S101. Use a detection program preset in the operating system kernel to record the process information of each process appearing in the operating system, the file operation information generated when the process calls a file operation, and the network connection operation information generated when the process calls a network connection operation; wherein the process information includes the association relationship between the process and its parent process.
[0062] This step is an important step to improve the detection effect of ransomware. Specifically, the detection program preset in the operating system kernel can be used to obtain and record the process information of each process appearing in the operating system, the file operation information generated when the process calls the file operation, and the network connection operation information generated when the process calls the network connection operation. By collecting the above information, when a suspicious process is detected, it can be determined from multiple angles whether the suspicious process is a ransomware process based on the collected information, thereby improving the comprehensiveness of detection. The above information will be introduced below.
[0063] Process information is the information of the process itself. In order to facilitate understanding of the relationship between processes, the process information needs to include the relationship between each process and its parent process. In one possible case, the process information can be composed of a process identifier (PID), a user identifier (UID), a parent process identifier, and a process entity file path. Among them, the process identifier is used to uniquely mark the process. The user identifier is used to uniquely mark the user currently logged into the operating system. The process identifier and the user identifier are combined to uniquely identify each process that appears in each user state. The parent process identifier is used to uniquely mark the parent process of this process. The process identifier and the parent process identifier combine to determine the relationship between the process and its parent process. The process entity file path is the file path of the program file corresponding to the process in the storage space.
[0064] The file operation information is information generated each time a process calls a file operation. The file operation is a system operation to be performed on a file, such as read, write, delete, etc. To facilitate the determination of each file operated by a process, the file operation information may include information about the file operated by the process. In a possible scenario, the file operation information may consist of a process identifier, a user identifier, and a file path, wherein the file path is the file path of the file operated by the process in the storage space.
[0065] The network connection operation information is the information generated each time the process calls the network connection operation. The network connection operation is the system operation to be performed to connect to the network. According to the data flow direction, the network connection operation can be divided into inbound operation and outbound operation. The inbound operation is to receive the data transmitted by the external device and save it to the local device, and the outbound operation is to send the local data of the device to the external device. In a possible situation, the network connection operation information can be composed of the process identifier, the user identifier and the network connection operation type, where the network connection operation type can be an inbound type and an outbound type.
[0066] It can be seen that by collecting the above process information, file operation information and network connection operation information, the embodiment of the present invention can determine each process appearing in the operating system, and can determine the association relationship between each process and other processes, and can also determine each file operated by the process and each network connection operation performed by the process. The reason for collecting the above information is that with the continuous development of ransomware technology, the ransomware program may not be executed by a single process, but by multiple processes with an associated relationship, such as these multiple processes are associated with the same parent process. In addition, each process of the ransomware can execute different contents, such as some processes are dedicated to performing file operations such as encryption and tampering on files, while another part of the process is dedicated to receiving encryption programs transmitted from external devices, sending user privacy data to external devices, etc. Therefore, by collecting the process information, file operation information and network connection operation information appearing in the operating system in advance, the present invention can comprehensively analyze all file operations and network connection operations performed by suspicious processes and other associated processes associated with the suspicious processes, so as to more effectively detect ransomware and all processes that execute ransomware programs, and effectively ensure the effectiveness of ransomware detection.
[0067] It should be noted that the embodiments of the present invention do not limit the specific implementation of the detection program, as long as it can be set in the kernel state of the operating system. For example, the detection program can be an eBPF program (Extended Berkeley Packet Filter). In addition, the embodiments of the present invention do not limit how the detection program obtains process information, file operation information and network connection operation information. For example, a hook function, a probe, etc. can be used to insert a stake in the system operation function, and the detection program can be mounted at the insertion position, so that the detection program can detect the call of the system operation function through the hook function or the probe, and when the system operation function is called, the required process information, file operation information or network connection operation information is obtained from the system operation function.
[0068] It should be noted that the embodiments of the present invention do not limit which system operation functions need to be inserted. For example, for process information collection, insertion can be performed in process operation functions such as process execution function (exec) and process derivative function (fork); for file operation information collection, insertion can be performed in file operation functions (such as read and write); for network connection operation information collection, insertion can be performed in network connection operation functions (such as SSH operation function (SSH, Secure Shell, secure shell), socket operation function (socket, socket), etc.). The present invention also does not limit which probes or hook functions are used for insertion. For example, for process operation functions, tracepoint probes can be used for insertion; for file operation functions, kprobe and kretprobe probes (both are return probes) can be used for insertion; for network connection operation functions, kprobe probes can be used for insertion.
[0069] Based on this, before using the detection program preset in the operating system kernel to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, it also includes:
[0070] Step 11: Use the first probe to insert a stub in the process operation function, use the second probe to insert a stub in the file operation function, and use the third probe to insert a stub in the network connection operation function; wherein the process operation function includes a process execution function and a process derivative function.
[0071] The first probe may be a tracepoint probe, the second probe may be a kprobe and a kretprobe probe, and the third probe may be a kprobe probe.
[0072] Step 12: Mount the detection program on the insertion position of the first probe, the insertion position of the second probe, and the insertion position of the third probe.
[0073] Accordingly, the detection and recording of the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called may include:
[0074] Step 21: Using the detection program to determine whether the process operation function is called through the first probe, and obtaining the process information from the parameters of the process function when it is determined that the process operation function is called.
[0075] Step 22: Using the detection program to determine whether the file operation function is called through the second probe, and obtaining file operation information from the parameters of the file operation function when it is determined that the file operation function is called.
[0076] Step 23: Using the detection program to determine whether the network connection operation function is called through the third probe, and obtaining network connection operation information from the parameters of the network connection operation function when it is determined that the network connection operation function is called.
[0077] It should be noted that the embodiment of the present invention does not limit how to obtain the required information from the parameters of each system operation function, and reference may be made to the relevant technology of the operating system.
[0078] Furthermore, since kernel programs such as eBPF programs set in the kernel state of the operating system cannot have too large a size, the detection program in the embodiment of the present invention may only have a simple information acquisition capability, and the virus detection program for ransomware virus detection (i.e., the execution program of steps S102 and S103) may be set in the user state. In the actual working process, the detection program in the kernel state can send the collected process information, file operation information, and network connection operation information to the virus detection program in the user state through a preset data transmission channel, wherein the data transmission channel is used to exchange data between the kernel state and the user state. The embodiment of the present invention does not limit the specific data transmission channel. For example, for the eBPF program, it can be a hash map.
[0079] Based on this, after using the detection program preset in the operating system kernel to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, it may also include:
[0080] Step 31: Obtain the process information, the file operation information and the network connection operation information transmitted from the kernel state to the user state by the detection program through the hash map.
[0081] Furthermore, in order to facilitate the search for all associated processes associated with a suspicious process, after collecting the process information, the embodiment of the present invention can also construct a process tree based on the association relationship between each process and its parent process. Each node in the process tree corresponds to a process, and the parent node of the node corresponds to the parent process of the process. In this way, after the suspicious process is detected later, it is only necessary to determine the process tree where the suspicious process is located, and determine the associated process in the process tree. It is understandable that there can be multiple process trees.
[0082] S102: When a suspicious process that calls the file operation on the preset bait file in the storage space is detected, the suspicious process and processes associated with the suspicious process are marked as processes to be detected according to the process information.
[0083] In an embodiment of the present invention, a bait file can also be preset in the device storage space, and it can be determined whether there is a process operating the bait file based on the file operation information fed back by the detection program. When a process operating the bait file is detected, this embodiment can mark it as a suspicious process, and then mark the suspicious process and the process associated with the suspicious process as processes to be detected based on the recorded process information, so as to perform ransomware detection based on all file operations and network connection operations performed by all processes to be detected. It should be pointed out that whether it is directly associated with the suspicious process (such as the parent process) or indirectly associated with the suspicious process (such as the parent process of the parent process), it can be identified as an associated process associated with the suspicious process. In this way, the embodiment of the present invention can improve the detection coverage of the ransomware process, thereby improving the detection effect.
[0084] It should be noted that the embodiment of the present invention does not limit the setting position and setting quantity of the preset bait file, which can be set according to actual application requirements.
[0085] Furthermore, since a process tree can be constructed in advance according to process information, when determining the process to be detected, the process tree where the suspicious process is located can be determined, and then all processes in the process tree are set as the process to be detected.
[0086] Based on this, marking the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information includes:
[0087] Step 41: Determine the process tree where the suspicious process is located, and set all processes in the process tree as the process to be detected.
[0088] S103: Detect whether the suspicious process is a ransomware process according to all file operation information and all network connection operation information corresponding to all the processes to be detected.
[0089] After obtaining all the processes to be detected, the embodiment of the present invention will detect whether the suspicious process is a ransomware process based on all the file operation information and all the network connection operation information corresponding to all the processes to be detected. The embodiment of the present invention does not limit the specific detection method. For example, it can be determined whether these processes to be detected are ransomware processes based on the number of files operated by all the processes to be detected and the number of various types of network connection operations performed. In addition, it can be further combined with the execution frequency of file operations and / or network connection operations for detection. In addition, since different types of files in the operating system have different importance to users and device operations, it can be further combined with the file types operated by all processes to be detected for detection. In addition, since external attackers can usually carry out ransomware attacks based on several botnet devices (i.e., attack devices that have been hacked by attackers), it can be further combined with the number of IPs connected to various network connection operations for detection. In addition, the number of files, number of network connection operations, frequency of file operations, frequency of network connection operations, type of files operated, number of connected IPs and other information can also be calculated by weighting to obtain a ransomware assessment value, and the overall risk level of the above-mentioned process to be detected can be determined based on whether the ransomware assessment value is greater than a preset threshold, thereby determining whether the suspicious process is a ransomware process. It should be pointed out that the above detection methods can be used arbitrarily and in any combination, and can be selected according to actual application requirements.
[0090] Based on the above embodiments, the present invention can first preset a detection program in the operating system kernel, and can use the detection program to normalize the process information of each process appearing in the operating system, the file operation information generated by the process when calling a file operation, and the network connection operation information generated by the process when calling a network connection operation. Among them, the process information includes the association between the process and its parent process. In other words, the detection program can comprehensively record each process itself, the association between the process and its parent process, and the file operations and network connection operations performed by each process. In addition, the present invention can also preset bait files in the storage space. Furthermore, when a suspicious process that calls the file operation on the preset bait file in the storage space is detected based on the record of the detection program, the suspicious process and the processes associated with the suspicious process can be marked as processes to be detected according to the process information, and based on all file operation information and all network connection operation information corresponding to all the processes to be detected, it is detected whether the suspicious process is a ransomware process. That is, the file operations and network connection operations performed by the suspicious process and the file operations and network connection operations performed by all processes associated with the suspicious process can be comprehensively combined to determine whether the suspicious process is a ransomware process, thereby improving the reliability of ransomware detection.
[0091] Based on the above embodiment, the detection process of the above ransomware virus will be described in detail below in combination with specific process information, file operation information and network connection operation information. In one possible scenario, the process information also includes the process entity file path, the file operation information includes the file path of the operated file, and the network connection operation information includes the network connection operation type, and the network connection operation type is an inbound type or an outbound type. Furthermore, the detection of whether the suspicious process is a ransomware virus process based on all the file operation information and all the network connection operation information corresponding to all the processes to be detected may include:
[0092] S201. According to the file operation information, add all file paths operated by the process to be detected to a suspicious file set.
[0093] In this step, since the file operation information includes the file path operated by the process, all the file paths operated by the process to be detected can be filtered out from the file operation information and added to the suspicious file set.
[0094] S202: According to the file operation information and the process entity file path of each process to be detected, add all processes that operate the files corresponding to the process entity file path to a suspicious process set.
[0095] The purpose of this step is to add the process most relevant to the suspected ransomware program to the suspicious process set, wherein the suspected ransomware program is the program corresponding to the suspicious process. This is because some system processes are also included in the process to be detected, and it is not meaningful to detect these system processes, so the system processes can be screened out, and only the processes most relevant to the ransomware program are retained. To achieve this effect, the present invention can add all processes that operate the files corresponding to the process entity file path to the suspicious process set according to the file operation information and the process entity file path of each process to be detected. This is because the process is the basic execution entity of the program, so the process can form a file operation relationship with its program file, that is, the process performs file operations on its corresponding program file. Therefore, the present invention searches for the process that operates the file corresponding to the process entity file path in the file operation information according to the process entity file path of each process to be detected, and can quickly screen out the processes most relevant to the suspected ransomware program, and can exclude system processes, thereby improving the detection efficiency.
[0096] S203. According to the network connection operation information, add the process in the suspicious process set that performs the inbound type of network connection operation to the suspicious inbound process set, and add the process in the suspicious process set that performs the outbound type of network connection operation to the suspicious outbound process set.
[0097] In this step, in the suspicious process set, processes that have performed inbound type network connection operations can be filtered out and added to the suspicious inbound process set, and processes that have performed outbound type network connection operations can be filtered out and added to the suspicious outbound process set to determine whether suspected ransomware programs perform suspicious inbound and outbound operations.
[0098] S204. Determine a ransomware virus assessment value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set.
[0099] In this step, the ransomware evaluation value can be determined according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set. The embodiment of the present invention does not limit the specific determination method of the ransomware evaluation value, which can be set according to actual application requirements. A possible method for determining the ransomware evaluation value is introduced below.
[0100] First, for users and operating systems, the risk level caused by the operation of different types of files by the ransomware virus is different. Therefore, the embodiment of the present invention can set a plurality of preset file types, and set a corresponding file type weight for each preset file type. In addition, since files of the same file type are usually stored in the same path, the embodiment of the present invention can also set a corresponding file path for each preset file type. In this way, as long as each file path in the suspicious file set is matched with the file path corresponding to the preset file type, it can be determined which preset file types have been operated by the process to be detected. It should be pointed out that each preset file type can correspond to one or more file paths. Further, since the more files operated by the process to be detected, the higher the possibility that it belongs to the ransomware virus process, the embodiment of the present invention can determine the number of file path coverages corresponding to the process to be detected in each preset file type in addition to determining the preset file type operated by the process to be detected. For example, if a preset file type corresponds to three file paths, and the process to be detected operates two of the paths, the number of file path coverages corresponding to the process to be detected in the preset file type is 2. Furthermore, the preset file types operated by the process to be detected and the corresponding file path coverage quantity in each preset file type can be weighted to obtain partial values that constitute the ransomware virus assessment value.
[0101] Further, for inbound type and outbound type network connection operations, corresponding identification values can be set. When the suspicious inbound process set is empty, the preset inbound identification value is set to the first value, or when the suspicious inbound process set is not empty, the preset inbound identification value is set to the second value. When the suspicious outbound process set is empty, the preset outbound identification value is set to the first value, or when the suspicious inbound process set is not empty, the preset outbound identification value is set to the second value. The first value can be 0, and the second value can be 1. Furthermore, the preset inbound identification value and the preset outbound identification value can be used as other partial values of the ransomware virus evaluation value.
[0102] Based on this, determining the ransomware virus evaluation value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set may include:
[0103] Step 51: According to each file path in the suspicious file set, determine the preset file types that have been operated by the process to be detected and the number of file paths covered by the process to be detected in each preset file type; wherein each preset file type corresponds to multiple file paths, and each preset file type corresponds to a different file type weight;
[0104] Step 52: When the suspicious inbound process set is empty, the preset inbound identification value is set to a first value, or when the suspicious inbound process set is not empty, the preset inbound identification value is set to a second value;
[0105] Step 53: when the suspicious outbound process set is empty, setting the preset outbound identification value to the first value, or when the suspicious inbound process set is not empty, setting the preset outbound identification value to the second value;
[0106] Step 54: Determine the ransomware virus assessment value according to the preset file types that the process to be detected has operated, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value.
[0107] In one possible scenario, the ransomware virus assessment value may be determined according to the following formula based on the preset file types that have been operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value:
[0108]
[0109] Where S represents the ransomware virus evaluation value, k represents the total number of preset file types, T nIndicates the total number of file paths corresponding to the nth preset file type, h n represents the number of file paths covered by the process to be detected corresponding to the nth preset file type, W n represents the file type weight of the nth preset file type, i represents the preset inbound identification value, o represents the preset outbound identification value, α and β represent the weights of the preset inbound identification value and the preset outbound identification value respectively.
[0110] It can be seen that the embodiments of the present invention can determine the ransomware evaluation value from the aspects of file operation and network connection operation, and when examining the file operation, can further consider the risk level of the ransomware operation of different types of files, thereby ensuring the reliability of the ransomware evaluation value.
[0111] S205: When it is determined that the ransomware evaluation value is greater than a preset threshold, determine that the suspicious process is a ransomware process.
[0112] After obtaining the ransomware evaluation value, it can be determined whether it is greater than a preset threshold. If it is greater, the suspicious process can be determined to be a ransomware process, otherwise it can be determined that the suspicious process is not a ransomware process, thereby effectively reducing misjudgments and improving the reliability of ransomware detection.
[0113] It should be noted that the embodiment of the present invention does not limit the specific value of the preset threshold, which can be set according to actual application requirements.
[0114] Furthermore, after determining that the suspicious process is a ransomware process, in order to prevent it from continuing to attack the user device, the process information of each process in the suspicious process set can be set as process information to be disabled, and the process corresponding to each process information to be disabled can be blocked to eliminate malicious attacks.
[0115] Based on this, after determining that the suspicious process is a ransomware process, the following steps may also be performed:
[0116] Step 61: setting the process information of each process in the suspicious process set as the process information to be disabled;
[0117] Step 62: Block the process corresponding to each process information to be disabled.
[0118] Based on the above embodiments, the above ransomware detection method is fully introduced below with specific examples. The present invention provides a multi-dimensional ransomware detection method based on eBPF, including a process collection device, a file operation collection device, a network connection collection device, a ransomware bait monitoring device, a process behavior profile extraction device, and a ransomware behavior evaluation device. The schematic diagram is as shown in the attached Figure 2 As shown, Figure 2This is a structural block diagram of a ransomware detection system provided by an embodiment of the present invention. The specific implementation process is as follows:
[0119] 1) Process collection device:
[0120] a) Mount the eBPF program of the tracepoint type at the system functions sched_process_exec (process execution function) and sched_process_fork (process fork function), obtain the process PID (process ID), parent process PID (parent process ID), user UID (user ID), and process entity path. Upload to the process behavior profile extraction device through the ring buffer (data transmission channel). Form a ProcessInfoMap (process information collection). The data is stored in the Hash Map (hash map) with the following structure:
[0121] Table 1 Process information set hash map
[0122]
[0123] 2) File operation collection device:
[0124] a) Mount the kprobe type eBPF program at the system call __x64_sys_open (open function), __x64_sys_openat (open function), and __x64_sys_unlinks (delete function), file path, process PID that operates the file, and user UID that operates the file, and upload the information to the process behavior profile extraction logic through the ring buffer. Two sets of file operations are formed: FilePathMap (file path set) and FilePIDMap (file operation process set). The data is stored in the Hash Map structure as follows:
[0125] Table 2 File path collection
[0126] Key Value File Path PID of the process operating the file
[0127] Table 3 File operation process collection
[0128] Key Value PID of the process operating the file File Path
[0129] 3) Network relationship collection device:
[0130] a) Mount the eBPF program of type krpobe at the system call __x64_sys_connect, and obtain the current process PID through the bpf auxiliary function. Upload it to the process behavior profile extraction device through the ring buffer. Form the inbound process PID set InProcessSet (inbound process set).
[0131] b) Mount the eBPF program of type krpobe at the system call __x64_sys_accept, and obtain the current process PID through the bpf auxiliary function. Upload it to the process behavior profile extraction device through the ring buffer to form the outbound process PID set OutProcessSet.
[0132] 4) Ransomware bait monitoring device:
[0133] Bait is sprayed at key locations of the system, and the eBPF program is mounted at the file operating system call based on eBPF technology. When the process operates the bait file, the eBPF program captures the current process PID and user UID, and uploads the information to the process behavior profile extraction logic through the ringbuffer. This process is suspected to be a ransomware process.
[0134] 5) Process behavior profile extraction device:
[0135] a) Using the suspected ransomware process PID + user UID as the key, traverse ProcessInfoMap (process information collection) to obtain the parent process PID and process entity path. Then use the parent process PID + user UID as the key, loop through ProcessInfoMap (process information collection), and finally obtain all process information ProcessChainMap (process chain collection) related to the suspected ransomware process. The data structure is as follows:
[0136] Table 4 Process chain collection
[0137]
[0138]
[0139] b) Traverse the key information of ProcessChainMap (process chain set), obtain all file information of suspected ransomware process chain process operation from FilePIDMap (file operation process set), and form a set SuspiciousFileSet (suspicious file set);
[0140] c) Traverse the Value information of ProcessChainMap (process chain set), obtain all process PIDs that operate the entity files of the suspected ransomware process chain from FilePathMap (file path set), and form a set SuspiciousProcessSet (suspicious process set);
[0141] d) Take the intersection of SuspiciousProcessSet (suspicious process set) and InProcessSet (inbound process set) to obtain the set SuspiciousInProcessSet (suspicious inbound process set);
[0142] e) Take the intersection of the Key set of ProcessChainMap (process chain set) and OutProcessSet (outbound process set) to obtain the set SuspiciousOutProcessSet (suspicious outbound process set).
[0143] 6) Ransomware behavior assessment device
[0144] Preliminary note: The weights in the following set are examples and can be set flexibly according to actual conditions.
[0145] a) Key file set A1:
[0146] A collection of key files related to system operation, with a weight of 5% (to ensure the normal operation of the system in order to achieve the purpose of ransomware, this part is usually not encrypted and has a lower weight).
[0147] Table 5 Key file collection
[0148] File Path File Description / boot Grub configuration and kernel image files / etc / pam.d Login authentication configuration file / etc / host.conf Domain name resolution file / etc / ssh SSH Configuration File / etc / audit Logging and Auditing Configuration Files
[0149] b) Bait file set A2:
[0150] The collection of files sprayed with bait has a weight of 25% (files that are usually encrypted by ransomware have a higher weight).
[0151] Table 6 Bait file collection
[0152]
[0153]
[0154] c) Scheduled task file set A3:
[0155] The system sets a set of configuration files for scheduled tasks, with a weight of 10% (ransomware usually makes encryption operations persistent and executes them at regular intervals to avoid being blocked by antivirus software).
[0156] Table 7 Scheduled task file collection
[0157] File Path File Description / etc / cron* Scheduled task configuration file / var / spool / cron Scheduled task configuration file / etc / anacrontab Scheduled task configuration file
[0158] d) System random startup configuration file A4:
[0159] System random startup configuration file set, weighted 10% (ransomware usually adds encryption operations to random startup tasks for automated execution).
[0160] Table 8 System random startup configuration file
[0161] File Path File Description / etc / rc*.d Random startup configuration file / etc / rc.local Random startup configuration file / etc / init.d Random startup configuration file / etc / systemd Random startup configuration file / usr / lib / system / system Random startup configuration file / lib / systemd / system Random startup configuration file
[0162] e) Dynamic library configuration set A5:
[0163] Dynamic library configuration file collection, weighted 5% (ransomware usually tampers with this file to hide itself and evade antivirus software).
[0164] Table 9 Dynamic library configuration set
[0165] File Path File Description / etc / ld.so.preload Dynamic library configuration file
[0166] f) System log file collection A6:
[0167] System log collection, weighted 5% (ransomware usually deletes system logs to hide their tracks).
[0168] Table 10 System log file collection
[0169] File Path File Description / var / log / messages* Information and error logs after system startup / var / log / btmp* Record login failure information / var / log / wtmp* Record user login times and login times / var / log / cron Record the running log of the task plan
[0170] g) Suspicious inbound process set SuspiciousInProcessSet:
[0171] The weight of the suspicious inbound set is 20% (most ransomware viruses are transmitted to the host through the network).
[0172] h) Suspicious Outbound Process Set SuspiciousOutProcessSet:
[0173] The weight of the suspicious outbound set is 20% (most ransomware will spread horizontally through the network).
[0174] i) Ransomware behavior evaluation formula:
[0175] SuspiciousFileSet intersects with A1-A6 sets, the total number of each set is T, the number of intersections with each set is h, and the weight is W. Suspicious inbound set i (1 when the set exists, 0 when it does not exist), suspicious outbound set o (1 when the set exists, 0 when it does not exist), the evaluation score is S, and when the score is higher than the threshold, it is judged as a ransomware virus (n is currently limited to 6, and this value will change with the development of technology).
[0176]
[0177] For further understanding, please refer to Figure 3 , Figure 3 This is a flowchart of another ransomware virus detection method provided by an embodiment of the present invention, which fully shows the entire process of ransomware virus detection.
[0178] The following is an introduction to a ransomware detection device, an electronic device, a computer program product, and a computer-readable storage medium provided in an embodiment of the present invention. The ransomware detection device, the electronic device, the computer program product, and the computer-readable storage medium described below can correspond to the ransomware detection method described above.
[0179] Please refer to Figure 4 , Figure 4 A structural block diagram of a ransomware detection device provided by an embodiment of the present invention, the device may include:
[0180] The kernel detection module 401 is used to record the process information of each process appearing in the operating system, the file operation information generated when the process calls the file operation, and the network connection operation information generated when the process calls the network connection operation by using the detection program preset in the operating system kernel; wherein the process information includes the association relationship between the process and its parent process;
[0181] The process marking module 402 to be detected is used to mark the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information when a suspicious process that calls the file operation on the bait file preset in the storage space is detected;
[0182] The ransomware process detection module 403 is used to detect whether the suspicious process is a ransomware process based on all file operation information and all network connection operation information corresponding to all the processes to be detected.
[0183] Optionally, the device may further include:
[0184] The plugging module is used to plug a pile in the process operation function using a first probe, plug a pile in the file operation function using a second probe, and plug a pile in the network connection operation function using a third probe; wherein the process operation function includes a process execution function and a process derivative function;
[0185] A mounting module, used for mounting the detection program at the insertion position of the first probe, the insertion position of the second probe and the insertion position of the third probe;
[0186] The kernel detection module 401 may include:
[0187] a process collection submodule, configured to use the detection program to determine whether the process operation function is called through the first probe, and to obtain the process information from the parameters of the process function when it is determined that the process operation function is called;
[0188] A file operation collection submodule, used to use the detection program to determine whether the file operation function is called through the second probe, and obtain file operation information from the parameters of the file operation function when it is determined that the file operation function is called;
[0189] The network connection operation collection submodule is used to use the detection program to determine whether the network connection operation function is called through the third probe, and obtain network connection operation information from the parameters of the network connection operation function when it is determined that the network connection operation function is called.
[0190] Optionally, the device may further include:
[0191] The data receiving module is used to obtain the process information, the file operation information and the network connection operation information transmitted from the kernel state to the user state by the detection program through a hash map.
[0192] Optionally, the device may further include:
[0193] A process tree creation module, used to construct a process tree according to the association relationship between each process and its parent process;
[0194] The to-be-detected process marking module 402 may include:
[0195] The to-be-detected process marking submodule is used to determine the process tree where the suspicious process is located, and set all processes in the process tree as the to-be-detected processes.
[0196] Optionally, the process information further includes a process entity file path, the file operation information includes a file path of an operated file, and the network connection operation information includes a network connection operation type, and the network connection operation type is an inbound type or an outbound type;
[0197] The ransomware process detection module 403 includes:
[0198] A suspicious file set adding submodule, used for adding all file paths operated by the process to be detected to the suspicious file set according to the file operation information;
[0199] A suspicious process set adding submodule is used to add all processes that operate files corresponding to the process entity file path to the suspicious process set according to the file operation information and the process entity file path of each process to be detected;
[0200] An inbound and outbound process set adding submodule, used for adding the processes in the suspicious process set that perform the inbound type of network connection operation to the suspicious inbound process set, and adding the processes in the suspicious process set that perform the outbound type of network connection operation to the suspicious outbound process set according to the network connection operation information;
[0201] An evaluation value determination submodule, used to determine a ransomware virus evaluation value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set;
[0202] The determination submodule is used to determine that the suspicious process is a ransomware process when it is determined that the ransomware evaluation value is greater than a preset threshold.
[0203] Optionally, the evaluation value determination submodule may include:
[0204] A file operation comparison unit, for determining, based on each file path in the suspicious file set, the preset file types that have been operated by the process to be detected and the number of file paths covered by the process to be detected in each preset file type; wherein each preset file type corresponds to multiple file paths, and each preset file type corresponds to a different file type weight;
[0205] an inbound identification value setting unit, configured to set a preset inbound identification value to a first value when the suspicious inbound process set is empty, or to set the preset inbound identification value to a second value when the suspicious inbound process set is not empty;
[0206] an outbound identification value setting unit, configured to set the preset outbound identification value to the first value when the suspicious outbound process set is empty, or to set the preset outbound identification value to the second value when the suspicious inbound process set is not empty;
[0207] The evaluation value determination unit is used to determine the ransomware evaluation value according to the preset file types operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value and the preset outbound identification value.
[0208] Optionally, the evaluation value determination unit may be used to:
[0209] The ransomware virus assessment value is determined according to the following formula based on the preset file types that the process to be detected has operated, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value:
[0210]
[0211] Where S represents the ransomware virus evaluation value, k represents the total number of preset file types, T n Indicates the total number of file paths corresponding to the nth preset file type, h n represents the number of file paths covered by the process to be detected corresponding to the nth preset file type, W n represents the file type weight of the nth preset file type, i represents the preset inbound identification value, o represents the preset outbound identification value, α and β represent the weights of the preset inbound identification value and the preset outbound identification value respectively.
[0212] Optionally, the ransomware process detection module 403 may include:
[0213] A to-be-disabled process information setting submodule, used for setting the process information of each process in the suspicious process set as the to-be-disabled process information;
[0214] The process disabling submodule is used to block the process corresponding to each process information to be disabled.
[0215] Please refer to Figure 5 , Figure 5 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. An embodiment of the present invention provides an electronic device 50, including a processor 51 and a memory 52; wherein the memory 52 is used to store a computer program; and the processor 51 is used to execute the ransomware virus detection method provided by the aforementioned embodiment when executing the computer program.
[0216] For the specific process of the above-mentioned ransomware virus detection method, reference may be made to the corresponding content provided in the aforementioned embodiments, which will not be repeated here.
[0217] Furthermore, the memory 52 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0218] In addition, the electronic device 50 also includes a power supply 53, a communication interface 54, an input / output interface 55 and a communication bus 56; wherein the power supply 53 is used to provide working voltage for each hardware device on the electronic device 50; the communication interface 54 can create a data transmission channel between the electronic device 50 and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 55 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0219] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the ransomware virus detection method described in the above embodiment.
[0220] Since the embodiments of the computer program product part correspond to the embodiments of the ransomware virus detection method part, please refer to the description of the embodiments of the ransomware virus detection method part for the embodiments of the computer program product part, and will not be repeated here.
[0221] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the ransomware virus detection method described in the above embodiment is implemented.
[0222] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the ransomware virus detection method part, please refer to the description of the embodiments of the ransomware virus detection method part for the embodiments of the storage medium part, which will not be repeated here.
[0223] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0224] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0225] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0226] The above is a detailed introduction to a ransomware virus detection method, device, electronic device and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A method for detecting ransomware, characterized in that: include: Using a detection program preset in the operating system kernel, the process information of each process appearing in the operating system, the file operation information generated when the process calls a file operation, and the network connection operation information generated when the process calls a network connection operation are recorded; wherein the process information includes the association relationship between the process and its parent process; When a suspicious process that calls the file operation on the preset bait file in the storage space is detected, the suspicious process and the processes associated with the suspicious process are marked as processes to be detected according to the process information; According to all file operation information and all network connection operation information corresponding to all the processes to be detected, detect whether the suspicious process is a ransomware process.
2. The ransomware virus detection method according to claim 1, characterized in that: Before using a detection program preset in the operating system kernel to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, the method further includes: Using a first probe to insert a stub in a process operation function, using a second probe to insert a stub in the file operation function, and using a third probe to insert a stub in the network connection operation function; wherein the process operation function includes a process execution function and a process derivative function; Mounting the detection program at the insertion position of the first probe, the insertion position of the second probe, and the insertion position of the third probe; The detection program preset in the operating system kernel is used to detect and record the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, including: Determine whether the process operation function is called by using the detection program through the first probe, and obtain the process information from the parameters of the process function when it is determined that the process operation function is called; Determine whether the file operation function is called by using the detection program through the second probe, and obtain file operation information from the parameters of the file operation function when it is determined that the file operation function is called; The detection program is used to determine whether the network connection operation function is called through the third probe, and when it is determined that the network connection operation function is called, the network connection operation information is obtained from the parameters of the network connection operation function.
3. The ransomware virus detection method according to claim 2, characterized in that: After detecting and recording the process information of each process appearing in the operating system, the file operation information generated by the process each time a file operation is called, and the network connection operation information generated by the process each time a network connection operation is called, the method further includes: The process information, the file operation information and the network connection operation information transmitted from the kernel state to the user state by the detection program are obtained through the hash map.
4. The ransomware virus detection method according to claim 1, characterized in that: After detecting and recording the process information of each process appearing in the operating system by using the preset detection program in the operating system kernel, the method further includes: Constructing a process tree according to the association relationship between each process and its parent process; The step of marking the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information includes: A process tree where the suspicious process is located is determined, and all processes in the process tree are set as the processes to be detected.
5. The ransomware virus detection method according to any one of claims 1 to 4, characterized in that: The process information further includes a process entity file path, the file operation information includes a file path of an operated file, and the network connection operation information includes a network connection operation type, and the network connection operation type is an inbound type or an outbound type; The detecting whether the suspicious process is a ransomware process according to all file operation information and all network connection operation information corresponding to all the processes to be detected includes: According to the file operation information, all file paths operated by the process to be detected are added to a suspicious file set; According to the file operation information and the process entity file path of each process to be detected, all processes that operate the files corresponding to the process entity file path are added to the suspicious process set; According to the network connection operation information, adding the process that performs the inbound type of network connection operation in the suspicious process set to the suspicious inbound process set, and adding the process that performs the outbound type of network connection operation in the suspicious process set to the suspicious outbound process set; Determine a ransomware virus assessment value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set; When it is determined that the ransomware evaluation value is greater than a preset threshold, the suspicious process is determined to be a ransomware process.
6. The ransomware virus detection method according to claim 5, characterized in that: The determining of the ransomware virus evaluation value according to the suspicious file set, the suspicious inbound process set, and the suspicious outbound process set includes: According to each file path in the suspicious file set, determine the preset file types that have been operated by the process to be detected and the number of file paths covered by the process to be detected in each preset file type; wherein each preset file type corresponds to multiple file paths, and each preset file type corresponds to a different file type weight; When the suspicious inbound process set is empty, the preset inbound identification value is set to a first value, or when the suspicious inbound process set is not empty, the preset inbound identification value is set to a second value; When the suspicious outbound process set is empty, the preset outbound identification value is set to the first value, or when the suspicious inbound process set is not empty, the preset outbound identification value is set to the second value; The ransomware virus assessment value is determined according to the preset file types that have been operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value.
7. The ransomware virus detection method according to claim 6, characterized in that: The method of determining the ransomware virus evaluation value according to the preset file types operated by the process to be detected, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value includes: The ransomware virus assessment value is determined according to the following formula based on the preset file types that the process to be detected has operated, the number of file paths covered by the process to be detected in each preset file type, the file type weight of each preset file type, the preset inbound identification value, and the preset outbound identification value: Where S represents the ransomware virus evaluation value, k represents the total number of preset file types, T n Indicates the total number of file paths corresponding to the nth preset file type, h n represents the number of file paths covered by the process to be detected corresponding to the nth preset file type, W n represents the file type weight of the nth preset file type, i represents the preset inbound identification value, o represents the preset outbound identification value, α and β represent the weights of the preset inbound identification value and the preset outbound identification value respectively.
8. A ransomware virus detection device, characterized in that: include: A kernel detection module, used to record, by using a detection program preset in the kernel of the operating system, the process information of each process appearing in the operating system, the file operation information generated when the process calls a file operation, and the network connection operation information generated when the process calls a network connection operation; wherein the process information includes the association relationship between the process and its parent process; A process marking module to be detected is used to mark the suspicious process and processes associated with the suspicious process as processes to be detected according to the process information when a suspicious process that calls the file operation on the bait file preset in the storage space is detected; The ransomware process detection module is used to detect whether the suspicious process is a ransomware process based on all file operation information and all network connection operation information corresponding to all the processes to be detected.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the ransomware virus detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the ransomware virus detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ransomware detection method and device, computer equipment and storage medium
CN114254318A
Segmented data acquisition method, storage medium and electronic equipment
CN116405331A
Terminal security detection method and device, electronic equipment and storage medium
CN116708033A
Virus protection method and device, electronic equipment and storage medium
CN117220942A
System and method for strategic Anti-malware monitoring
US20140013434A1
Cited By
File operation tracking method and device, computer equipment and storage medium
CN119862167A
File operation tracking method, device, computer equipment and storage medium
CN119862167B
