Malicious process detection method and device and medium
By acquiring and analyzing the characteristics of process images, and using the isolated forest anomaly detection model to identify abnormal processes, the problem of low efficiency of malicious process detection in the existing technology is solved, and fast and efficient malicious process detection is achieved.
Patent Information
- Application Number
- CN202410725556.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-24
AI Technical Summary
Existing malicious process detection methods need to analyze a large amount of log data related to process running, and complex encoding processing results in low efficiency, making it difficult to efficiently detect abnormal processes.
By obtaining the process image of the system, extracting image features and inputting them into the anomaly detection model, the isolated forest anomaly detection model is used to compare the normal image features, identify abnormal process images, reduce the amount of analysis data, and only conduct in-depth analysis of abnormal process images.
It achieves fast and efficient malicious process detection, reduces the amount of analysis data, avoids complex data processing and encoding processes, and improves detection speed and accuracy.
Smart Images

Figure CN118690353A
Abstract
Description
Technical Field
[0001] The present disclosure at least relates to the field of computer security technology, and in particular to a malicious process detection method, a malicious process detection device, and a computer-readable storage medium. Background Art
[0002] Existing malicious process detection usually analyzes process logs and learns the rules of normal processes in existing systems to comprehensively analyze whether abnormal processes appear. However, this analysis method requires analyzing and processing a large amount of process operation-related log data, and requires complex coding to complete the analysis of process logs. Summary of the invention
[0003] The technical problem to be solved by the present disclosure is to provide a malicious process detection method, a malicious process detection device and a computer-readable storage medium in view of the above-mentioned shortcomings, so as to solve the problem of how to reduce the amount of analysis data for abnormal process detection.
[0004] In a first aspect, the present disclosure provides a malicious process detection method, the method comprising:
[0005] Obtaining a process image of the system, which includes process running information;
[0006] Extracting image features of process images;
[0007] Inputting the image features into the anomaly detection model so that the anomaly detection model detects the abnormal process image based on the image features of the plurality of process images;
[0008] Get the abnormal process in the abnormal process image.
[0009] Furthermore, the process image is specifically a screenshot of the system process information viewed using a process visualization tool, and the process running information includes information on the use of the system central processing unit CPU and memory resources during the process running.
[0010] Furthermore, the method specifically comprises:
[0011] Obtain the current process image of the system at the current moment, which includes the process running information of each process;
[0012] Extracting current image features of the current process image;
[0013] Inputting the current image features into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images that are closest to the current moment;
[0014] In response to the current process image being an abnormal process image, an abnormal process in the current process image is acquired.
[0015] Furthermore, the current process image of the system at the current moment is obtained. The current process image includes the process running information of each process, specifically including:
[0016] In the Linux operating system, use the process visualization tool TOP or HTOP to view the system process information and take screenshots according to the preset collection cycle to obtain the current process image of the system at the current moment;
[0017] The current process image includes a global information block and a local information block. The global information block includes information about the usage of the system CPU and memory resources, and the local information block includes information about the use of the system CPU and memory resources by each process.
[0018] Furthermore, the current image features of the current process image are extracted, specifically including:
[0019] Use the opencv tool to extract the scale invariant feature transform SIFT feature and the directional gradient histogram HOG feature of the current process image as the first current image feature of the current process image;
[0020] The current process image is converted into a current image vector, and the current image vector is input into the AE autoencoder so that the AE autoencoder outputs a second current image feature of the current process image.
[0021] Furthermore, the current image features are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images that are closest to the current moment, specifically including:
[0022] The first current image feature and the second current image feature are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model can detect whether the current process image is different from the majority of normal process images in the historical process images by comparing the first historical image feature and the second historical image feature of the historical process images collected according to a preset collection period within a preset time period before the current moment.
[0023] Further, in response to the current process image being an abnormal process image, obtaining the abnormal process in the current process image specifically includes:
[0024] In response to the current process image being different from most normal process images in the historical process images, obtaining processes ranked in the top N in the current process image as suspected abnormal processes;
[0025] Obtain process parameters of the suspected abnormal process, and determine whether the suspected abnormal process is an abnormal process based on the process parameters.
[0026] Further, obtaining process parameters of the suspected abnormal process and determining whether the suspected abnormal process is an abnormal process according to the process parameters specifically includes:
[0027] Use OpenCV to extract the process name, source file directory, suspicious commands, and system CPU and / or memory resource usage information of the suspected abnormal process in the process image;
[0028] Determine whether the process name of the suspected abnormal process meets the process name specification, and if so, assign a first score; if not, assign a second score;
[0029] Determine whether the directory where the source file of the suspected abnormal process is located meets the process source file directory specification. If yes, assign the third score; if no, assign the fourth score;
[0030] Determine whether the system has more than a preset number of suspicious commands during the period when the suspected abnormal process occurs. If not, assign a fifth score; if yes, assign a sixth score;
[0031] Determine whether the system CPU and / or memory resource usage fluctuates beyond a preset range during the period of time when the suspected abnormal process occurs. If not, assign a seventh score; if yes, assign an eighth score;
[0032] The above assigned scores are summed to obtain a total score, and in response to the total score being greater than the ninth score, the suspected abnormal process is determined to be an abnormal process.
[0033] In a second aspect, the present disclosure provides a malicious process detection device, the device comprising:
[0034] An image acquisition module is used to acquire a process image of the system, wherein the process image includes process operation information;
[0035] A feature extraction module, connected to the image acquisition module, is used to extract image features of the process image;
[0036] The model detection module is connected to the feature extraction module and is used to input the image features into the anomaly detection model so that the anomaly detection model detects the abnormal process image according to the image features of the plurality of process images;
[0037] The abnormal analysis module is connected with the model detection module and is used to obtain the abnormal process in the abnormal process image.
[0038] In a third aspect, the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the malicious process detection method as described above is implemented.
[0039] The present disclosure provides a malicious process detection method, a malicious process detection device and a computer-readable storage medium. By acquiring a process image of a system, image features of multiple process images are detected to obtain abnormal process images therein, and whether there are abnormal processes in the abnormal process images is analyzed to achieve abnormal process detection, thereby reducing the amount of analysis data for abnormal process detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of a malicious process detection method according to an embodiment of the present disclosure;
[0041] Figure 2 is a flow chart of another malicious process detection method according to an embodiment of the present disclosure;
[0042] Figure 3 is an example diagram of a process image according to an embodiment of the present disclosure;
[0043] Figure 4 It is a structural diagram of a malicious process detection device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0045] It should be understood that the specific embodiments and drawings described herein are only used to explain the present disclosure rather than to limit the present disclosure.
[0046] It can be understood that, in the absence of conflict, the various embodiments of the present disclosure and the various features in the embodiments can be combined with each other.
[0047] It can be understood that, for the convenience of description, the drawings of the present disclosure only show parts related to the present disclosure, while parts irrelevant to the present disclosure are not shown in the drawings.
[0048] It can be understood that each unit and module involved in the embodiments of the present disclosure may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0049] It will be understood that, in the absence of conflict, the functions and steps marked in the flowcharts and block diagrams of the present disclosure may occur in an order different from that marked in the drawings.
[0050] It is understood that the flowcharts and block diagrams of the present disclosure illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present disclosure. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0051] It can be understood that the units and modules involved in the embodiments of the present disclosure can be implemented by software or hardware, for example, the units and modules can be located in a processor.
[0052] In order to facilitate the understanding of the present disclosure, the main inventive concept of the present disclosure is first introduced in conjunction with a specific scenario.
[0053] The Linux operating system is very stable and has fewer vulnerabilities than Windows (another operating system). Therefore, Linux is generally considered to be more secure and stable than Windows, and more suitable as an operating system for website servers. However, with the rapid spread of Trojan virus programs and fraudulent networks, the security of Linux servers has been seriously threatened. If Linux system server users fail to take good protection measures, they will suffer huge losses from various attacks and vulnerabilities. In particular, the popularity of fileless attacks, ransomware, Trojan viruses, Webshell (an ASP or PHP Trojan backdoor) and other attacks in recent years has made network attacks more and more hidden, posing a great challenge to security operation and maintenance personnel in troubleshooting problems.
[0054] Linux systems usually generate process logs to record process operation information during system operation. This widely available process log is used as the main data source for system anomaly detection. Existing abnormal process detection methods all directly analyze the data in the process log and learn the rules of normal processes in the existing system from the data to comprehensively analyze whether anomalies occur. However, this analysis method requires analyzing, processing and learning a large amount of process operation-related log data, and requires complex coding to complete the analysis of process logs.
[0055] For example, to track the logs generated by the nginx (a high-performance HTTP and reverse proxy server) process, existing log collection can use the strace (a program debugging tool in the Linux environment) command to collect the underlying API (Application Programming Interface) call sequence of the data. It is necessary to collect massive logs of all processes and perform complex correlation analysis on the API sequence logs. The existing technology is mainly too complex and inefficient. It needs to collect massive underlying system logs, and the underlying system logs are complex and diverse, requiring a large amount of data processing and cleaning operations. After completing the data cleaning, a series of log correlation operations are required to extract features and train models. The entire process requires very complex data processing, feature extraction and other processes.
[0056] Therefore, a method for detecting Linux malicious processes efficiently is needed. When any malicious behavior is running, a process will be generated. With the help of process visualization analysis tools top (a Linux tool for monitoring processes and Linux overall performance) or htop (an interactive process viewer that can display the resource usage of the system in a graphical manner), all process information under the Linux system can be viewed. The user group to which each process belongs, CPU (Central Processing Unit) occupancy, memory occupancy, running time, process running parameters, etc. can be viewed. After a period of normal process operation, there is little change and a certain rule will be formed. Based on the above information, it is possible to detect whether it is a malicious process by analyzing the process image. The rule here can be understood as a fixed pattern. By summarizing and analyzing continuous pictures, it will be found that a large number of picture rules are the same because each process has its own running rule. The original normal process running rule of the acquisition system is assumed to be one day. If a malicious process is added, the process picture will show different. This is the detection idea of the present invention. Screenshots are taken of the running status of each process displayed by the system HTOP command. Detection is performed based on image recognition technology. Complex data processing, cleaning and other processes are not required. Neural networks are used to automatically extract features, and complex coding is not required.
[0057] Specific optional testing forms include:
[0058] Signature-Based Detection: This method uses known characteristics or patterns of malicious behavior to match network traffic or files to identify malicious activity. This method usually uses virus definitions or known attack signatures for detection.
[0059] Network-Based Detection: This method monitors network traffic to detect malicious activity, such as intrusion detection systems (IDS) and intrusion prevention systems (IPS);
[0060] Anomaly Detection: This method focuses on identifying abnormal behaviors that do not conform to normal behavior patterns and can be used to detect unknown threats.
[0061] Embodiment 1:
[0062] like Figure 1 As shown, the present disclosure provides a malicious process detection method, the method comprising:
[0063] S1. Obtain a process image of the system, where the process image includes process running information;
[0064] S2, extracting image features of the process image;
[0065] S3, inputting the image features into an anomaly detection model, so that the anomaly detection model detects an abnormal process image according to the image features of the plurality of process images;
[0066] S4. Obtain the abnormal process in the abnormal process image.
[0067] In this embodiment, a malicious process detection method based on image recognition is provided, the purpose of which is to solve the problems of the existing methods of detecting abnormal processes being complex, time-consuming and labor-intensive. By acquiring the process image of the system, the image features of multiple process images are detected to obtain the abnormal process image therein, and the abnormal process image is analyzed to determine whether there is an abnormal process in the abnormal process image, so as to achieve abnormal process detection, thereby reducing the amount of analysis data for abnormal process detection. By first identifying the abnormal process image, when analyzing the abnormal process, only the abnormal process in the abnormal process image needs to be analyzed, such as first locating the suspected abnormal process in the abnormal process image, and then analyzing the parameters of the suspected abnormal process to determine whether the suspected abnormal process is indeed abnormal. There is no need to perform correlation analysis on the operating parameters of all processes, thereby reducing the amount of data for analyzing process abnormalities.
[0068] In one implementation, the process image is specifically a screenshot of system process information viewed using a process visualization tool, and the process running information includes information on the use of the system central processing unit CPU and memory resources during process running.
[0069] In this embodiment, a Linux malicious process detection method based on image recognition is proposed. By collecting process log image information of the Linux system and learning the internal pattern of normal process images, unknown malicious processes can be identified and the detection speed is fast. The method for obtaining process images can be obtained by taking screenshots, and the screenshots need to contain information reflecting the running status of the process. Different from the prior art that requires massive underlying system logs, complex data cleaning, time-consuming data association, and complex feature extraction, this embodiment only needs to use HTOP to view the process status and take screenshots, without too much data processing, data association, and feature extraction.
[0070] In one embodiment, the method specifically comprises:
[0071] Obtain the current process image of the system at the current moment, which includes the process running information of each process;
[0072] Extracting current image features of the current process image;
[0073] Inputting the current image features into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images that are closest to the current moment;
[0074] In response to the current process image being an abnormal process image, an abnormal process in the current process image is acquired.
[0075] In this embodiment, the system process is mainly monitored in real time, so the current process image is collected, and the current process image is compared with multiple normal process images to detect whether there is an abnormality. The model for comparing image abnormalities specifically adopts the isolation forest anomaly detection model, but the present disclosure does not exclude the use of other machine learning models. The present disclosure aims to first identify abnormal images, and then identify abnormal processes based on abnormal images, so as to narrow the data range of abnormal process analysis. Since the system has fewer abnormal processes than normal ones, there is no need to specially screen multiple normal process images. The present disclosure can collect normal process images and abnormal process images, and then add labels to train the abnormal recognition model. "Normal image features of multiple normal process images" can be placed in the abnormal detection model in the model training stage, and only the process image to be detected needs to be input to the model in the detection stage; multiple process images can also be input to the model for comparison in the detection stage. In the case where there are more normal process images among the multiple process images, the abnormal process image is different from the majority of images. This difference mainly presents different change rules, so it is necessary to extract image features for detection, that is, the abnormal detection model detects abnormal process images according to the change rules reflected by the image features of multiple process images. Normal images reflect normal rules, and abnormal images do not conform to this rule.
[0076] In one embodiment, a current process image of the system at the current moment is obtained, and the current process image includes process running information of each process, specifically including:
[0077] In the Linux operating system, use the process visualization tool TOP or HTOP to view the system process information and take screenshots according to the preset collection cycle to obtain the current process image of the system at the current moment;
[0078] The current process image includes a global information block and a local information block. The global information block includes information about the usage of the system CPU and memory resources, and the local information block includes information about the use of the system CPU and memory resources by each process.
[0079] A more specific example, such as Figure 2 As shown, the specific technical solution includes:
[0080] The first part collects process data, specifically the Linux system process log image data (an image containing process running information, not necessarily the underlying log), such as using the HTOP command to view the system process, take screenshots, and generate Linux process image data. The data is collected continuously for 30 days, once per second, and 2,592,000 normal process image data are obtained.
[0081] Process image data such as Figure 3 As shown, the data in the graph are as follows: The graph includes the global information block above and the local information block below. The global information block includes all CPU, memory and other usage information, and the local information block includes the CPU and memory resource information used by each process. In the local information block, the processes are arranged by CPU usage by default. If a system collects HTOP process running screenshots once a second for one month, and analyzes the 2,592,000 data obtained, for a normal operating system, there will be some rules when the specific processes in it run, and there will be certain rules for global information and local information. These rules will be automatically captured using convolutional neural networks later.
[0082] Characteristics of malicious processes include: Figure 3 The global information block above the middle graph will be abnormal, for example, all 0-7 CPUs are occupied by about 99%, or the system 32g memory below is completely full, and the local information below the image, the CPU occupancy rate of the top process is 100% or the memory occupancy is large, and the process may be an unknown process. The features of this part will be extracted for subsequent abnormality detection, including shallow and deep features that are invisible to the human eye.
[0083] In one embodiment, extracting the current image features of the current process image specifically includes:
[0084] Use the opencv tool to extract the scale invariant feature transform SIFT feature and the directional gradient histogram HOG feature of the current process image as the first current image feature of the current process image;
[0085] The current process image is converted into a current image vector, and the current image vector is input into the AE autoencoder so that the AE autoencoder outputs a second current image feature of the current process image.
[0086] A more specific example, such as Figure 2 As shown, the specific technical solution includes:
[0087] The second part is image processing. Opencv (a cross-platform computer vision library) is used to hide some information in the screenshot, obtain the absolute position of the area in the screenshot named PID, PR, NI, TIME+, etc., and set all the data areas under the corresponding columns to empty pixels. The columns PID, PR, NI, and TIME+ here are irrelevant to the analysis of whether it is a malicious process, so they are deleted to avoid these useless information from interfering with subsequent detection.
[0088] This part is to prepare for feature extraction. Figure 3 The meaning of each part is explained as follows. This information may be used in the research and analysis part:
[0089] PID (Process ID): The unique identifier of a process, used to distinguish different processes in the system;
[0090] USER: The user who started the process, displays the user name that started the process;
[0091] PR (Priority): The priority of the process. A smaller value indicates a higher priority.
[0092] NI (Nice value): The "Nice" value of the process, which is a value used to adjust the process priority. A larger "Nice" value indicates a lower priority.
[0093] VIRT: The virtual memory size used by the process;
[0094] RES: The size of physical memory currently being used by the process (non-swapped memory);
[0095] SHR: the memory size shared by the process,
[0096] S: The state of the process. Possible states include R (running), S (sleeping), D (uninterruptible sleep), Z (zombie), T (stopped), etc.
[0097] CPU%: The CPU usage currently occupied by the process;
[0098] MEM%: The memory usage currently occupied by the process;
[0099] TIME+: The total amount of CPU time used since the process was started;
[0100] Command: The full command line that started the process.
[0101] The third part is to extract the shallow features of the image. Opencv tools are used to extract SIFT (Scale-Invariant Feature Transform) features and HOG (Histogram of Oriented Gradient) features. These two features are used to represent process change information. For example, for a Linux system, the system process information will always change, so Figure 3 The top 10 process information in the local information below the middle image will also change, but there will be a change pattern, and these two features can be used to characterize the change pattern. The HOG feature characterizes the important information of the image block or the entire image. SIFT is used to detect significant and stable feature points in the image, and then generates multi-dimensional features based on the local neighborhood of the detected pixel points. The multi-dimensional features represent the description of the current feature point.
[0102] The fourth part is to extract deep features of the image. For example, based on the 2,592,000 image data obtained, the image is converted into a 512*512 vector, and the AE (autoencoder) autoencoder training model is used. This model can efficiently extract implicit information from the image. The implicit information here is the deep implicit rules of the normal process, that is, the parts that appear repeatedly in the 2,592,000 images. The AE autoencoder model itself is a model used to extract implicit information, which can automatically complete the extraction of implicit features.
[0103] In one embodiment, the current image feature is input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images with the closest interval to the current moment, specifically including:
[0104] The first current image feature and the second current image feature are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model can detect whether the current process image is different from the majority of normal process images in the historical process images by comparing the first historical image feature and the second historical image feature of the historical process images collected according to a preset collection period within a preset time period before the current moment.
[0105] A more specific example, such as Figure 2 As shown, the specific technical solution includes:
[0106] The fifth part is to train the anomaly detection model. Based on the shallow features of the image + the deep features of the image obtained above, the isolation forest anomaly detection model is trained. The isolation forest is a classic anomaly detection algorithm. It believes that compared with normal samples, the number of abnormal samples is small, the difference in eigenvalues is relatively large, and they are easy to be isolated. It is suitable for the abnormal process image detection disclosed in this invention.
[0107] The sixth part is to apply the detection model for anomaly detection, including: data collection in the detection phase, collecting Linux system process logs once a minute, using the HTOP command to view the system process, taking screenshots, generating Linux process image data, converting the image into a 512*512 vector, and using the third and fourth parts to extract the shallow features and deep features of the image; in the anomaly detection phase, use the obtained shallow features and deep features of the image to bring them into the anomaly detection model in the fifth part for detection.
[0108] It is understandable that, as a process of continuously monitoring the system process, the current process image collected periodically becomes the historical process image data at the next moment.
[0109] In one implementation, in response to the current process image being an abnormal process image, obtaining the abnormal process in the current process image specifically includes:
[0110] In response to the current process image being different from most normal process images in the historical process images, obtaining processes ranked in the top N in the current process image as suspected abnormal processes;
[0111] Obtain process parameters of the suspected abnormal process, and determine whether the suspected abnormal process is an abnormal process based on the process parameters.
[0112] A more specific example, such as Figure 2 As shown, the specific technical solution includes:
[0113] The seventh part is the research and analysis stage. Based on the detected abnormal process image, the relevant information of the top 1 process is extracted for comprehensive analysis. For example, the abnormal Linux process image data obtained in the seventh part is accepted, and the relevant information of the top-ranked process, including the process name, process parameters, etc., is extracted using opencv for comprehensive analysis. Since most malicious processes are Trojan processes, etc., these malicious processes will occupy a lot of system resources and will automatically be ranked first. Therefore, the TOP 1 process is generally analyzed, but the TOP N processes can also be analyzed.
[0114] In one implementation, obtaining process parameters of a suspected abnormal process and determining whether the suspected abnormal process is an abnormal process according to the process parameters specifically includes:
[0115] Use OpenCV to extract the process name, source file directory, suspicious commands, and system CPU and / or memory resource usage information of the suspected abnormal process in the process image;
[0116] Determine whether the process name of the suspected abnormal process meets the process name specification, and if so, assign a first score; if not, assign a second score;
[0117] Determine whether the directory where the source file of the suspected abnormal process is located meets the process source file directory specification. If yes, assign the third score; if no, assign the fourth score;
[0118] Determine whether the system has more than a preset number of suspicious commands during the period when the suspected abnormal process occurs. If not, assign a fifth score; if yes, assign a sixth score;
[0119] Determine whether the system CPU and / or memory resource usage fluctuates beyond a preset range during the period of time when the suspected abnormal process occurs. If not, assign a seventh score; if yes, assign an eighth score;
[0120] The above assigned scores are summed to obtain a total score, and in response to the total score being greater than the ninth score, the suspected abnormal process is determined to be an abnormal process.
[0121] In this embodiment, the abnormal process can be comprehensively analyzed in combination with the following situations:
[0122] a. Determine whether the process name is standardized. Usually malicious processes will use random letters in their names. If it is a random letter, add +3 to the suspicious value. If it is a normal English word, add +1 to the suspicious value.
[0123] b. Determine the location of the source file of the process and find the directory where the source file of the process is located. Usually malicious processes use temporary directories and folders named with random letters. Determine whether the temporary directory is named with random letters. If it is suspicious, add +3, otherwise add +1;
[0124] c. Check whether there are any suspicious commands in the history system commands. Suspicious commands include but are not limited to commands related to viewing operating system information such as curl / wget / ipconfig / . If there are more than 5 suspicious commands, the suspicious command is increased by 3, otherwise it is increased by 1. For example, if some operating systems detect malicious processes, it is usually because the operating system has been invaded. After the invasion, many illegal commands will be executed on it. You can check whether there are more than 5 malicious commands in the latest 100 history results;
[0125] d. Determine whether the change of the process exceeds the baseline range continuously within 1 minute. If so, it is suspicious +3, otherwise it is suspicious +1. You can check the changes in the CPU part. The CPU usage of a normal process should be a small fluctuation. Compare it with the CPU usage rate one minute ago to determine whether the change rate is greater than a threshold. For example, the CPU usage at a certain moment is: 90%, and the CPU usage in the previous minute is: 30%. The change rate at this moment: (90-30) / 90=0.67>threshold 0.5, then it is considered suspicious. The change can also be memory. You can analyze the information in the global information block or the information in the local information block;
[0126] Add up the scores of the above four items. If the final suspicious score is >6, it is considered abnormal.
[0127] Embodiment 2:
[0128] like Figure 4 As shown, the present disclosure provides a malicious process detection device, the device comprising:
[0129] The image acquisition module 1 is used to acquire the process image of the system, and the process image includes the process running information;
[0130] The feature extraction module 2 is connected to the image acquisition module 1 and is used to extract image features of the process image;
[0131] The model detection module 3 is connected to the feature extraction module 2 and is used to input the image features into the anomaly detection model so that the anomaly detection model detects the abnormal process image according to the image features of the plurality of process images;
[0132] The abnormal analysis module 4 is connected to the model detection module 3 and is used to obtain the abnormal process in the abnormal process image.
[0133] In one implementation, the process image is specifically a screenshot of system process information viewed using a process visualization tool, and the process running information includes information on the use of the system central processing unit CPU and memory resources during process running.
[0134] In one embodiment, each module in the device is specifically used for:
[0135] Image acquisition module 1, used to acquire the current process image of the system at the current moment, the current process image including the process running information of each process;
[0136] Feature extraction module 2, used to extract current image features of the current process image;
[0137] Model detection module 3, used for inputting the current image features into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images with the closest interval to the current moment;
[0138] The abnormality analysis module 4 is used for obtaining the abnormal process in the current process image in response to the current process image being an abnormal process image.
[0139] In one embodiment, the image acquisition module 1 specifically includes a real-time process screenshot unit, which is used to:
[0140] In the Linux operating system, use the process visualization tool TOP or HTOP to view the system process information and take screenshots according to the preset collection cycle to obtain the current process image of the system at the current moment;
[0141] The current process image includes a global information block and a local information block. The global information block includes information about the usage of the system CPU and memory resources, and the local information block includes information about the use of the system CPU and memory resources by each process.
[0142] In one embodiment, the feature extraction module 2 specifically includes:
[0143] A first feature extraction unit is used to extract a scale invariant feature transform SIFT feature and a histogram of oriented gradients HOG feature of the current process image using an opencv tool as a first current image feature of the current process image;
[0144] The second feature extraction unit is used to convert the current process image into a current image vector, and input the current image vector into the AE autoencoder so that the AE autoencoder outputs a second current image feature of the current process image.
[0145] In one embodiment, the model detection module 3 specifically includes an isolation forest detection unit, which is used to:
[0146] The first current image feature and the second current image feature are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model can detect whether the current process image is different from the majority of normal process images in the historical process images by comparing the first historical image feature and the second historical image feature of the historical process images collected according to a preset collection period within a preset time period before the current moment.
[0147] In one embodiment, the abnormality analysis module 4 specifically includes:
[0148] a process locating unit, for, in response to the current process image being different from most normal process images in the historical process images, obtaining processes ranked in the top N in the current process image as suspected abnormal processes;
[0149] The process analysis unit is connected to the process positioning unit and is used to obtain process parameters of the suspected abnormal process and determine whether the suspected abnormal process is an abnormal process according to the process parameters.
[0150] In one implementation, the process analysis unit specifically includes:
[0151] A parameter acquisition unit is used to extract the process name, the directory where the source file is located, the suspicious command, and the system CPU and / or memory resource usage information of the suspected abnormal process in the process image using opencv;
[0152] A first judgment unit, connected to the parameter acquisition unit, is used to judge whether the process name of the suspected abnormal process meets the process name specification, and if so, assign a first score, and if not, assign a second score;
[0153] A second judgment unit, connected to the parameter acquisition unit, is used to judge whether the directory where the source file of the suspected abnormal process is located meets the process source file directory specification, and if so, assign a third score, and if not, assign a fourth score;
[0154] A third judgment unit, connected to the parameter acquisition unit, is used to judge whether the system has more than a preset number of suspicious commands during the period of time when the suspected abnormal process occurs, and if not, assign a fifth score, and if yes, assign a sixth score;
[0155] A fourth judgment unit, connected to the parameter acquisition unit, is used to judge whether the system CPU and / or memory resource usage fluctuates beyond a preset range during the period of time when the suspected abnormal process occurs, and if not, assign a seventh score, and if yes, assign an eighth score;
[0156] The total score unit is connected to the above judgment units and is used to sum the above assigned scores to obtain a total score. In response to the total score being greater than the ninth score, the suspected abnormal process is determined to be an abnormal process.
[0157] Embodiment 3:
[0158] Embodiment 3 of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the malicious process detection method described in Embodiment 1 or the malicious process detection device described in Embodiment 2 is implemented.
[0159] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0160] In addition, the present disclosure may also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the malicious process detection method described in Example 1. The computer device may be the malicious process detection device described in Example 2.
[0161] The memory is connected to the processor, the memory may be a flash memory or a read-only memory or other memory, and the processor may be a central processing unit or a single-chip microcomputer.
[0162] Embodiments 1-3 of the present disclosure provide a malicious process detection method, a malicious process detection device, and a computer-readable storage medium. By acquiring a process image of the system, image features of multiple process images are detected to obtain abnormal process images therein, and whether there are abnormal processes in the abnormal process images is analyzed to implement abnormal process detection, thereby reducing the amount of analysis data for abnormal process detection.
[0163] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A malicious process detection method, characterized in that: The method comprises: Obtaining a process image of the system, which includes process running information; Extracting image features of process images; Inputting the image features into the anomaly detection model so that the anomaly detection model detects the abnormal process image based on the image features of the plurality of process images; Get the abnormal process in the abnormal process image.
2. The method according to claim 1, characterized in that The process image is specifically a screenshot of the system process information viewed using a process visualization tool. The process running information includes information about the use of the system central processing unit CPU and memory resources during process running.
3. The method according to claim 1 or 2, characterized in that: The method specifically comprises: Obtain the current process image of the system at the current moment, which includes the process running information of each process; Extracting current image features of the current process image; Inputting the current image features into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images that are closest to the current moment; In response to the current process image being an abnormal process image, an abnormal process in the current process image is acquired.
4. The method according to claim 3, characterized in that Get the current process image of the system at the current moment. The current process image includes the process running information of each process, including: In the Linux operating system, use the process visualization tool TOP or HTOP to view the system process information and take screenshots according to the preset collection cycle to obtain the current process image of the system at the current moment; The current process image includes a global information block and a local information block. The global information block includes information about the usage of the system CPU and memory resources, and the local information block includes information about the use of the system CPU and memory resources by each process.
5. The method according to claim 4, characterized in that Extract the current image features of the current process image, including: Use the opencv tool to extract the scale invariant feature transform SIFT feature and the directional gradient histogram HOG feature of the current process image as the first current image feature of the current process image; The current process image is converted into a current image vector, and the current image vector is input into the AE autoencoder so that the AE autoencoder outputs a second current image feature of the current process image.
6. The method according to claim 5, characterized in that The current image features are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model detects whether the current process image is an abnormal process image by comparing the normal image features of multiple normal process images that are closest to the current moment, specifically including: The first current image feature and the second current image feature are input into the isolation forest anomaly detection model, so that the isolation forest anomaly detection model can detect whether the current process image is different from the majority of normal process images in the historical process images by comparing the first historical image feature and the second historical image feature of the historical process images collected according to a preset collection period within a preset time period before the current moment.
7. The method according to claim 6, characterized in that In response to the current process image being an abnormal process image, obtaining the abnormal process in the current process image specifically includes: In response to the current process image being different from most normal process images in the historical process images, obtaining processes ranked in the top N in the current process image as suspected abnormal processes; Obtain process parameters of the suspected abnormal process, and determine whether the suspected abnormal process is an abnormal process based on the process parameters.
8. The method according to claim 7, characterized in that Obtain the process parameters of the suspected abnormal process and determine whether the suspected abnormal process is an abnormal process based on the process parameters, including: Use OpenCV to extract the process name, source file directory, suspicious commands, and system CPU and / or memory resource usage information of the suspected abnormal process in the process image; Determine whether the process name of the suspected abnormal process meets the process name specification, and if so, assign a first score; if not, assign a second score; Determine whether the directory where the source file of the suspected abnormal process is located meets the process source file directory specification. If yes, assign the third score; if no, assign the fourth score; Determine whether the system has more than a preset number of suspicious commands during the period when the suspected abnormal process occurs. If not, assign a fifth score; if yes, assign a sixth score; Determine whether the system CPU and / or memory resource usage fluctuates beyond a preset range during the period of time when the suspected abnormal process occurs. If not, assign a seventh score; if yes, assign an eighth score; The above assigned scores are summed to obtain a total score, and in response to the total score being greater than the ninth score, the suspected abnormal process is determined to be an abnormal process.
9. A malicious process detection device, characterized in that: The device comprises: An image acquisition module is used to acquire a process image of the system, wherein the process image includes process operation information; A feature extraction module, connected to the image acquisition module, is used to extract image features of the process image; The model detection module is connected to the feature extraction module and is used to input the image features into the anomaly detection model so that the anomaly detection model detects the abnormal process image according to the image features of the plurality of process images; The abnormal analysis module is connected with the model detection module and is used to obtain the abnormal process in the abnormal process image.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the malicious process detection method according to any one of claims 1 to 8 is implemented.
