Computer security management method and device

By identifying and reporting logs of malicious applications in computer security management, and using Bayesian filters or classification models to determine log types, the problem of inefficient identification in the prior art is solved and the efficiency of computer security management is improved.

CN110750691BActive Publication Date: 2024-11-12TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN201910960483.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-10
Publication Date
2024-11-12
Estimated Expiration
2040-10-12

AI Technical Summary

Technical Problem

In existing computer security management, identifying the logs generated by malicious applications is inefficient and requires a lot of manpower, resulting in low management efficiency.

Method used

By obtaining the logs to be identified, determining the target strings in the preset string set it contains, and determining the log type using Bayesian filters or classification models based on the frequency of these strings appearing in different types of logs, automatically Identify and report relevant content.

Benefits of technology

It realizes automatic identification and reporting of logs, saves manpower and improves the efficiency of computer security management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110750691B_ABST
    Figure CN110750691B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for computer security management, which belongs to the field of computer technology. The method includes: obtaining a log to be identified; determining at least one target string contained in the log to be identified that belongs to a preset string set; determining the frequency of each target string appearing in different types of logs in the log sample set based on the correspondence between each string in the stored preset string set and the frequency of each string appearing in different types of logs in the log sample set; determining the log type of the log to be identified according to the frequency of each target string appearing in different types of logs in the log sample set; when the log to be identified is a target type log, determining the content to be reported in the log to be identified, and reporting the content to be reported to the security management server. Through this application, the efficiency of log identification in the process of computer security management can be improved, thereby improving the efficiency of computer security management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for computer security management. Background Art

[0002] With the rapid development of computer technology, people have also begun to pay attention to computer security issues. Some computer attackers can install malicious applications in computers through various channels. When these malicious applications are running in the computer, they will pose a certain threat to computer security. Regardless of whether they are non-malicious applications or malicious applications, they will generate corresponding logs when they are running in the computer. These logs record the relevant information of events that occurred during the operation of the application. When performing computer security management, it is necessary to identify the logs generated by malicious applications from a large number of logs and extract the content that needs to be analyzed from these logs. After that, the technicians will analyze the extracted content and develop defense methods against malicious applications to ensure computer security.

[0003] Currently, when technicians want to identify the logs generated by the operation of malicious applications from a large number of logs, they mostly analyze and screen the collected logs one by one manually to identify the logs generated during the operation of malicious applications.

[0004] Obviously, the above-mentioned method of manually identifying logs generated by malicious applications in the process of computer security management requires a lot of manpower and has low identification efficiency, resulting in low efficiency of computer security management. Summary of the invention

[0005] The embodiment of the present application provides a method and device for computer security management, which can solve the problem of low efficiency of current computer security management. The technical solution is as follows:

[0006] In a first aspect, a method for computer security management is provided, the method comprising:

[0007] Get the log to be identified;

[0008] Determining at least one target character string contained in the log to be identified and belonging to a preset character string set;

[0009] Determine the frequency of occurrence of each target string in different types of logs in the log sample set based on the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set;

[0010] Determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set;

[0011] When the log to be identified is a target type log, the content to be reported in the log to be identified is determined, and the content to be reported is reported to the security management server.

[0012] Optionally, determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set includes:

[0013] Inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a target type log;

[0014] When the probability that the log to be identified is a target type log meets a preset condition, the log to be identified is determined to be a target type log.

[0015] Optionally, inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a target type log includes:

[0016] For each target string, the frequency of occurrence of the target string in different types of logs in the log sample set is input into the Bayesian filter to obtain a target probability corresponding to the target string, wherein the target probability is the probability that the log to be identified is a log of the target type when the target string appears in the log to be identified;

[0017] Among the target probabilities corresponding to all target character strings, determine the largest N target probabilities, and determine the joint probability of the N target probabilities, where N is a preset value;

[0018] The joint probability is determined as the probability that the log to be identified is a target type log.

[0019] Optionally, the Bayesian filter is:

[0020] Wherein, L is the target type log, N is the non-target type log, S is the target string, P(L|S) is the probability that the log to be identified is a target type log under the condition that the target string S appears in the log to be identified, P(S|N) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a non-target type log, and P(S|L) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a target type log.

[0021] Optionally, the target type log is a junk log, which is a log generated when a non-malicious application is running, and when the probability meets a preset condition, determining the log to be identified as a target type log includes:

[0022] When the probability is less than a preset threshold, the log to be identified is determined as a target type log.

[0023] Optionally, determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set includes:

[0024] The frequency of occurrence of each target character string in different types of logs in the log sample set is input into a pre-trained classification model to determine the log type of the log to be identified.

[0025] Optionally, the determining at least one target character string that is contained in the log to be identified and belongs to a preset character string set includes:

[0026] The log to be identified is input into a first AC automaton established based on the preset character string set, and at least one target character string belonging to the preset character string set contained in the log to be identified is determined.

[0027] Optionally, the method further includes:

[0028] Obtaining the same number of logs of each type to form the log sample set;

[0029] Determine the frequency of occurrence of each character string in the preset character string set in different types of logs in the log sample set;

[0030] A corresponding relationship between each character string in the preset character string set and the frequency at which each character string appears in different types of logs in the log sample set is established, and the corresponding relationship is stored.

[0031] Optionally, the determining the log type of the log to be identified further includes:

[0032] Adding the log to be identified to the log sample set;

[0033] The frequencies of occurrence of each character string in the preset character string set in different types of logs in the log sample set are re-determined, and the corresponding relationship between each character string in the preset character string set and the frequencies of occurrence of each character string in different types of logs in the log sample set is updated.

[0034] Optionally, the determining the content to be reported in the log to be identified includes:

[0035] Inputting the log to be identified into a second AC automaton established based on a preset virus string set, and determining whether the log to be identified contains at least one string belonging to the preset virus string set;

[0036] When the log to be identified contains at least one character string belonging to the preset virus character string set, the log to be identified is determined as content to be reported.

[0037] Optionally, the determining the content to be reported in the log to be identified includes:

[0038] Determining whether the log to be identified includes a command string of a preset event;

[0039] When it is determined that the log to be identified includes a command string of a preset event, determining whether an event information string corresponding to the command string is in the preset string set;

[0040] When the event information character string is not in the preset character string set, the execution time of the preset event and the name of the thread executing the preset event are determined as the content to be reported in the log to be identified.

[0041] In a second aspect, a computer security management device is provided, the device comprising:

[0042] An acquisition module, used to acquire the logs to be identified;

[0043] A determination module, configured to determine at least one target string that belongs to a preset string set and is contained in the log to be identified; based on the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, determine the frequency of occurrence of each target string in different types of logs in the log sample set;

[0044] An identification module, used to determine the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set;

[0045] The reporting module is used to determine the content to be reported in the log to be identified when the log to be identified is a target type log, and report the content to be reported to the security management server.

[0046] Optionally, the identification module is used to:

[0047] Inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a target type log;

[0048] When the probability that the log to be identified is a target type log meets a preset condition, the log to be identified is determined to be a target type log.

[0049] Optionally, the identification module is used to:

[0050] For each target string, the frequency of occurrence of the target string in different types of logs in the log sample set is input into the Bayesian filter to obtain a target probability corresponding to the target string, wherein the target probability is the probability that the log to be identified is a log of the target type when the target string appears in the log to be identified;

[0051] Among the target probabilities corresponding to all target character strings, determine the largest N target probabilities, and determine the joint probability of the N target probabilities, where N is a preset value;

[0052] The joint probability is determined as the probability that the log to be identified is a target type log.

[0053] Optionally, the Bayesian filter is:

[0054] Wherein, L is the target type log, N is the non-target type log, S is the target string, P(L|S) is the probability that the log to be identified is a target type log under the condition that the target string S appears in the log to be identified, P(S|N) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a non-target type log, and P(S|L) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a target type log.

[0055] Optionally, the target type log is a junk log, which is a log generated when a non-malicious application is running. The identification module is used to:

[0056] When the probability is less than a preset threshold, the log to be identified is determined as a target type log.

[0057] Optionally, the identification module is used to:

[0058] The frequency of occurrence of each target character string in different types of logs in the log sample set is input into a pre-trained classification model to determine the log type of the log to be identified.

[0059] Optionally, the determining module is used to:

[0060] The log to be identified is input into a first AC automaton established based on the preset character string set, and at least one target character string belonging to the preset character string set contained in the log to be identified is determined.

[0061] Optionally, the device further comprises:

[0062] A module is established, which is used to obtain the same number of logs of each type to form the log sample set; determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set; establish a corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, and store the corresponding relationship.

[0063] Optionally, the device further comprises:

[0064] An updating module is used to add the log to be identified to the log sample set; re-determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set, and update the corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set.

[0065] Optionally, the reporting module is used to:

[0066] Inputting the log to be identified into a second AC automaton established based on a preset virus string set, and determining whether the log to be identified contains at least one string belonging to the preset virus string set;

[0067] When the log to be identified contains at least one character string belonging to the preset virus character string set, the log to be identified is determined as content to be reported.

[0068] Optionally, the reporting module is used to:

[0069] Determining whether the log to be identified includes a command string of a preset event;

[0070] When it is determined that the log to be identified includes a command string of a preset event, determining whether an event information string corresponding to the command string is in the preset string set;

[0071] When the event information character string is not in the preset character string set, the execution time of the preset event and the name of the thread executing the preset event are determined as the content to be reported in the log to be identified.

[0072] In a third aspect, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the computer security management method as described in the first aspect above.

[0073] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the operations performed by the computer security management method as described in the first aspect above.

[0074] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0075] In the process of computer security management, the embodiment of the present application can obtain the log to be identified, identify the target string of the log to be identified, and determine at least one target string that belongs to the preset string set. Then, according to the corresponding relationship between each string in the stored string set and the frequency of each string appearing in different types of logs, the frequency of the target string appearing in different types of logs can be determined. Then, according to the above frequency, the log type of the log to be identified can be determined. When the log to be identified is a target type log, the content to be reported in the log to be identified is determined, and the content to be reported is reported to the security management server. When the above target type log is a log generated by a malicious application, through the technical solution provided by the embodiment of the present application, the collection of logs, the identification of logs generated by malicious applications, and the extraction and reporting of the content to be reported can be automatically completed without manual execution, which can save a lot of manpower, thereby making computer security management more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0077] Figure 1It is a flow chart of a method for computer security management provided by an embodiment of the present application;

[0078] Figure 2 It is a flow chart of a method for computer security management provided by an embodiment of the present application;

[0079] Figure 3 It is a schematic diagram of the structure of a computer security management device provided in an embodiment of the present application;

[0080] Figure 4 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0081] Figure 5 This is a flow chart of a method for obtaining a log to be identified provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0083] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0084] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0085] The solution provided in the embodiments of the present application involves machine learning technology of artificial intelligence. For example, the classification model in the embodiments of the present application is a machine learning model, which can be implemented using artificial neural networks, etc.

[0086] The embodiment of the present application provides a method of security management, which can be implemented by a computer device. Wherein, the computer device can be a portable computer, a desktop computer, a server, etc. An operating system and various applications can be installed in the computer device, and corresponding logs will be generated when the application is running. Wherein, logs generated by the operation of malicious applications may be included, and these logs have higher analysis value for technicians. Through these logs, technicians can analyze the functions of corresponding malicious applications, etc. For the newly generated logs in the computer device, the log processing method provided by the embodiment of the present application can be used for processing, and the logs of malicious applications can be screened out for experimental analysis by technicians.

[0087] Figure 1 This is a flowchart of a computer security management method provided by an embodiment of the present application, comprising the following steps:

[0088] Step 101: Obtain the log to be identified.

[0089] In practice, when an application is running in an operating system, corresponding logs will be generated, and these logs can be saved in a fixed folder. Therefore, the folder used to save the logs can be monitored in real time. When a log is generated, the newly generated log can be obtained from it as the log to be identified. Of course, all folders of the operating system can also be scanned periodically to obtain the newly generated logs as the logs to be identified. In addition, the technician can also specify logs as logs to be identified.

[0090] For log acquisition in Windows honeypot system, such as Figure 5 The following processing steps may be shown.

[0091] Step 1011: Install a virtual machine on a computer device, install a Windows system in the virtual machine, and deploy a honeypot system in the Windows system.

[0092] Among them, the honeypot system is used to lure attackers to attack computer devices through various vulnerabilities. During the attack, attackers can implant malicious applications into computer devices and run malicious applications through remote thread injection and other methods. Malicious applications will generate logs when running. At the same time, other applications running in the honeypot system will also generate logs when running.

[0093] Step 1012: Find whether there is a folder for storing logs in the Windows system. If not, create a folder for storing logs.

[0094] Step 1013: load the monitoring module, monitor the folder for storing logs in real time, determine whether any logs are generated, and use the newly generated logs as logs to be identified.

[0095] In a possible implementation, the monitoring module may also periodically scan all folders in the Windows system to obtain newly generated logs as logs to be identified.

[0096] Step 1014: Receive an identification instruction for a specified log.

[0097] The designated log may be a historical log existing in the Windows system, and an identification instruction for the designated log may be input into the Windows system by a technician. After receiving the identification instruction for the designated log, the designated log is determined as a log to be identified.

[0098] Step 102: Determine at least one target character string that is contained in the log to be identified and belongs to a preset character string set.

[0099] The preset string set may be a string set established by technicians by collecting a large number of logs generated when various non-malicious applications are running. The preset string set may include strings contained in the logs generated when a large number of non-malicious applications are running. The preset string set may also be generally referred to as a whitelist.

[0100] In implementation, after the log to be identified is obtained, the log can be converted into a CSV (Comma-Separated Value) file to identify the string in the log. String matching is performed on the CSV file corresponding to the log to be identified, and each string in the CSV file is traversed and compared with each string in the preset string set to determine the target string contained in the log to be identified that belongs to the preset string set.

[0101] In one possible implementation, a multi-mode matching algorithm may be used to identify a target string belonging to a preset string set in a log to be identified. Accordingly, the processing may be as follows: the log to be identified is input into a first AC automaton established based on the preset string set, and at least one target string belonging to the preset string set contained in the log to be identified is determined.

[0102] In implementation, a technician may pre-establish a first AC (Aho-Corasick) automaton. When establishing the first AC automaton, each character string in a preset character string set is used as a recognizable pattern string to establish the first AC automaton. In this way, after the CSV file corresponding to the log to be identified is input into the first AC automaton, the first AC automaton may output a target character string that belongs to the preset character string set and is contained in the log to be identified.

[0103] Step 103 : Based on the correspondence between each character string in the stored preset character string set and the frequency of occurrence of each character string in different types of logs in the log sample set, determine the frequency of occurrence of each target character string in different types of logs in the log sample set.

[0104] The different types of logs are logs generated when different types of applications are running. For example, logs generated when a non-malicious application is running and logs generated when a malicious application is running are two different types of logs.

[0105] In implementation, the technicians may pre-establish the corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set. The establishment process may be as follows:

[0106] After the technician installs the operating system on the computer device, he saves the system snapshot for restoring the system. Then, a virtual machine is installed in the operating system, a non-malicious application and a malicious application are installed in the virtual machine, and a folder for saving the logs generated when the non-malicious application is running and a folder for saving the logs generated when the malicious application is running are respectively specified. The monitoring module is loaded to monitor the folders established above. In addition, the monitoring time can also be set, and a shortcut key for terminating monitoring is provided. That is, when the monitoring time is reached, or when it is detected that the shortcut key for terminating monitoring is triggered, the monitoring is stopped, and the logs generated when the non-malicious application is running and the logs generated when the malicious application is running during this period are respectively obtained, and the obtained logs can form a log sample set. After obtaining the log sample set, the operating system can be restored through the saved system snapshot. Here, the same number of two types of logs can be obtained. Then, the frequency of each string in the preset string set appearing in different types of logs in the log sample set can be calculated. The following example is given to illustrate the frequency of each string in the preset string set appearing in different types of logs in the log sample set.

[0107] For example, in the log sample set, there are 5,000 first-type logs and 5,000 second-type logs, where the first-type logs can be logs generated when non-malicious applications are running, and the second-type logs can be logs generated when malicious applications are running. For string 1, string 1 appears in 200 of the 5,000 first-type logs, so the frequency of string 1 appearing in the first-type logs is 4%, and string 1 appears in 2 of the 5,000 second-type logs, so the frequency of string 1 appearing in the second-type logs is 0.04%; for string 2, string 2 appears in 2,500 of the 5,000 first-type logs, so the frequency of string 2 appearing in the first-type logs is 50%, and string 2 appears in 0 of the 5,000 second-type logs, so the frequency of string 2 appearing in the second-type logs is 0, and so on, the frequency of each string in the preset string set appearing in different types of logs in the log sample set can be obtained.

[0108] Then, according to the calculated frequency of occurrence of each string in the preset string set in different types of logs in the log sample set, a correspondence relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set can be established and stored. The correspondence relationship can be stored in the form of a correspondence relationship table, as shown in Table 1 below.

[0109] Table 1

[0110] String Frequency of occurrence of the first type of log Frequency of the second type of logs String 1 4% 0.04% String 1 50% 0 …… …… ……

[0111] In this way, after the target character strings contained in the log to be identified and belonging to the preset character string set are determined in the above step 102, the frequency of occurrence of each target character string in different types of logs can be queried in the above established corresponding relationship.

[0112] Step 104: Determine the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set.

[0113] In implementation, after obtaining the frequency of occurrence of each target string included in the log to be identified in different types of logs in the log sample set, the log type of the log to be identified can be determined based on these frequencies. There are many specific methods, two of which are listed below for illustration.

[0114] Method 1: Input the frequency of each target string in different types of logs in the log sample set into the Bayesian filter to determine the probability that the log to be identified is a target type log. When the probability that the log to be identified is a target type log meets the preset conditions, the log to be identified is determined to be a target type log.

[0115] In implementation, for each target string, the frequency of occurrence of the target string in different types of logs in the log sample set determined above is input into the Bayesian filter to obtain the target probability corresponding to the target string. The target probability represents the probability that the log to be identified is a target type log when the target string appears in the log to be identified. Among the target probabilities corresponding to each target string, the largest N target probabilities are calculated, and the joint probability of the N target probabilities is determined, where N is a preset value, such as N=30. The joint probability is determined as the probability that the log to be identified is a target type log. The following is an example in which the target type probability is a first type log and the non-target type log is a second type log.

[0116] The above Bayesian filter can be formulated as follows:

[0117]

[0118] Wherein, L is the first type of log, S is the target string, and N is the second type of log. P(L|S) is the probability that the log is the first type of log when the target string S appears in the log. P(S|L) is the probability that the target string S appears in the log when the log is the first type of log. This value can be obtained by querying the correspondence between each string in the above-mentioned preset string set and the frequency of each string appearing in different types of logs in the log sample set. P(S|N) is the probability that the target string S appears in the log when the log is the second type of log. This value can also be obtained by querying the correspondence between each string in the above-mentioned preset string set and the frequency of each string appearing in different types of logs in the log sample set. P(L) is the probability that the log is the first type of log, which can be defaulted to 50%, and P(N) is the probability that the log is the second type of log, which can be defaulted to 50%.

[0119] The following is an example of calculating the probability that the log to be identified is a log of the first type when a character string 1 appears in the log to be identified.

[0120] In the above formula, P(S|L) can be expressed by the frequency of string 1 appearing in the first type of log. By querying the correspondence between each string in the above preset string set and the frequency of each string appearing in different types of logs in the log sample, the frequency can be obtained to be 4%. P(S|N) can be expressed by the frequency of string 1 appearing in the second type of log. By querying the correspondence between each string in the above preset string set and the frequency of each string appearing in different types of logs in the log sample set, the frequency can be obtained to be 0.04%. P(S)=P(N)=50%. Substituting the obtained values ​​into the above formula, P(L|S)=99%. This value is the target probability corresponding to string 1.

[0121] For each target string that belongs to the preset string set contained in the log to be identified, the corresponding target probability can be calculated. The largest N target probabilities are taken, and the N target probabilities are multiplied to obtain the joint probability, which is the probability that the log to be identified is the first type of log.

[0122] Method 2: Input the frequency of each target string appearing in different types of logs in the log sample set into a pre-trained classification model to determine the log type of the log to be identified.

[0123] In implementation, a technician can establish a classification model and collect a large number of training samples to train the classification model. When collecting training samples, the technician can obtain a large number of different types of logs in advance and calculate the frequency of each target string in different types of logs. The different logs obtained should include possible combinations of various target strings as much as possible. Then, the frequency of occurrence of various combinations of target strings in different types of logs and the corresponding log types are used as samples to train the classification model. When in use, the log to be identified is input into the trained classification model to obtain the log type of the log to be identified.

[0124] In a possible implementation, the correspondence between each string in the stored preset string set and the frequency of occurrence of each string in different types of logs in the log set can be updated according to each newly acquired log, so as to make log identification more accurate. Accordingly, the processing can be as follows: adding the log to be identified to the log sample set; re-determining the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set, and updating the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set.

[0125] The preset threshold may be 90%.

[0126] In implementation, when the probability that the log to be identified is a target type log is greater than a preset threshold, the log to be identified can be added to the log sample set as a target type log. Then, the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set is recalculated, and the corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set is updated. An example is given below to illustrate this.

[0127] For example: if the probability of determining that the log to be identified is a log of the first type is 99%, which is greater than a preset threshold of 90%, the log to be identified is added to the log sample set as a log of the first type. Before the log to be identified is added to the log sample set, there are 5000 logs of the first type and 5000 logs of the second type. After the log to be identified is added, there are 5001 logs of the first type and 5000 logs of the second type in the log sample set. Correspondingly, the frequency of each string in the preset string set appearing in different types of logs in the log sample set will also change, and the frequency of each string in the preset string set appearing in different types of logs in the log sample set can be recalculated, and the above-mentioned corresponding relationship is updated.

[0128] Step 105: When the log to be identified is a target type log, determine the content to be reported in the log to be identified, and report the content to be reported to the security management server.

[0129] In implementation, after determining that the log to be identified is a target log type log, all or part of the content in the log to be identified can be reported to the security management server as content to be reported. When determining the content to be reported in the log to be identified, multiple processing methods can be used, and several methods are listed below for illustration.

[0130] Processing 1: Determine whether the log to be identified includes a command string of a preset event. When it is determined that the log to be identified includes a command string of a preset event, determine whether the event information string corresponding to the command string is in the preset string set. When the event information string is not in the preset string set, determine the execution time of the preset event and the name of the thread that executes the preset event as the content to be reported in the log to be identified.

[0131] In implementation, the above-mentioned target type log is a garbage log, and a garbage log is a log generated when a non-malicious application is running. When the probability that the log to be identified is a garbage log is greater than a preset threshold, the log can be considered to be a garbage log. Correspondingly, when the probability that the log to be identified is a garbage log is less than the preset threshold, the log can be considered not to be a garbage log, but a log generated when a malicious application is running, that is, a log that the technician needs to analyze. After determining that the log to be identified is a log generated when a malicious application is running, it can be analyzed and processed, and the following processing can be performed on the log content. In the following processing, the preset events include process creation events, file creation events, file deletion events, file renaming events, registry creation events, registry modification events, registry deletion events, UDP and TCP sending and receiving events, etc.

[0132] Determine whether there is a process creation event in the CSV file of the log. The determination method can be to find whether there is a command string of the process creation event, such as: Create Process: Example.EXE. If yes, then determine whether the event information string related to the process creation event is in the whitelist, which is the preset string set mentioned above. If not, then record the process creation time, process name, PID (Process Identification, process identification), etc.

[0133] Determine whether there is a file creation event in the CSV file of the log. The determination method can be to find whether there is a command string for the file creation event, such as: Create File. If yes, then determine whether the event information string related to the file creation event is in the whitelist. If not, calculate the hash value of the created file. Determine whether the hash value is in the hash value whitelist. If not, submit the created file and the hash value of the file to the VT (VirusTotal, virus statistics) platform. The VT platform will process and identify the file according to the YARA rules to determine whether it is a virus file, and can return the identification result. After receiving the return result, record the file creation time, the file path of the created file, the file size, the process name, the PID, the identification result returned by the VT platform, etc. Among them, the hash value whitelist can be the hash values ​​of the files created by the technicians when the non-malicious applications are running.

[0134] Determine whether there is a file deletion event in the CSV file of the log. The determination method can be to find whether there is a command string for the file deletion event, such as: Delete File. If yes, then determine whether the event information string related to the file deletion event is in the whitelist. If not, record the file deletion time, deleted file name, process name, PID, etc.

[0135] Determine whether there is a file rename event in the CSV file of the log. The determination method can be to find whether there is a command string for the file rename event, such as: Rename File. If yes, then determine whether the event information string related to the file rename event is in the whitelist. If not, record the rename time, renamed file name, process name, PID, etc.

[0136] Determine whether there is a registry creation event in the CSV file of the log. The determination method can be to find whether there is a command string for the registry creation event, such as: Create Reg. If yes, then determine whether the event information string related to the registry creation event is in the whitelist. If not, record the registry creation time, the created registry key value, the process name, the PID, etc.

[0137] Determine whether there is a registry modification event in the CSV file of the log. The determination method can be to find whether there is a command string of the registry modification event, such as: Mod Reg. If there is, then determine whether the event information string related to the registry modification event is in the whitelist. If not, record the registry modification time, modified registry key value, process name, PID, etc.

[0138] Determine whether there is a registry deletion event in the CSV file of the log. The determination method can be to find whether there is a command string for the registry deletion event, such as: Delete Reg. If there is, then determine whether the event information string related to the registry deletion event is in the whitelist. If not, record the registry deletion time, deleted registry key value, process name, PID, etc.

[0139] Determine whether there are UDP and TCP send and receive events in the CSV file of the log. The determination method can be to find whether there are command strings for UDP and TCP send and receive events, such as: UDP and TCP. If yes, then determine whether the event information string related to the send and receive events is in the whitelist. If not, record the send and receive event time, network IP, communication type, send and receive type, data packet length, process name, PID, etc.

[0140] The information recorded in the above analysis is used as the content to be reported in the log to be identified, and a report is generated and reported to the security management server.

[0141] Processing 2: Input the log to be identified into the second AC automaton established based on the preset virus string set, and determine whether the log to be identified contains at least one string belonging to the preset virus string set; when the log to be identified contains at least one string belonging to the preset virus string set, determine the log to be identified as the content to be reported, and report it to the security management server.

[0142] In implementation, a technician can obtain a virus string from an existing virus string library, and use the virus string as a specified pattern string to establish a second AC automaton. Then, by passing the CSV file of the log that meets the preset conditions through the second AC automaton, it can be determined whether there is a virus string in the log. If so, the log can be uploaded to the security management server as content to be reported. In a possible implementation, the log and the information recorded in the above-mentioned process one can also be reported to the security management server as content to be reported. The security management server can count these contents and issue an alarm to notify the technician to obtain the reported content in a timely manner, and formulate a plan to deal with the malicious application based on these contents.

[0143] All possible implementations described above may be arbitrarily combined to form optional embodiments of the present application, and will not be described in detail here.

[0144] In the process of computer security management, the embodiment of the present application obtains the log to be identified, identifies the target string of the log to be identified, and determines at least one target string that belongs to the preset string set. Then, according to the corresponding relationship between each string in the stored string set and the frequency of each string appearing in different types of logs, the frequency of the target string appearing in different types of logs is determined. Then, the log type of the log to be identified can be determined based on the above frequency. When the log to be identified is a target type log, the content to be reported in the log to be identified is determined, and the content to be reported is reported to the security management server. When the above target type log is a log generated by a malicious application, through the technical solution provided by the embodiment of the present application, the collection of logs, the identification of logs generated by malicious applications, and the extraction and reporting of the content to be reported can be automatically completed without manual execution, which can save a lot of manpower, thereby making computer security management more efficient.

[0145] Figure 2 This is a flowchart of a computer security management method provided by an embodiment of the present application, comprising the following steps:

[0146] Step 201: Obtain the same number of logs of various types to form a log sample set.

[0147] Step 202: determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set; establish a correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, and store the correspondence.

[0148] Step 203: Obtain the log to be identified.

[0149] Step 204: Determine at least one target character string that is contained in the log to be identified and belongs to a preset character string set.

[0150] Step 205 : Determine the frequency of occurrence of each target string in different types of logs based on the correspondence between each string in the stored preset string set and the frequency of occurrence of each string in different types of logs in the log sample set.

[0151] Step 206: Input the frequency of occurrence of each target character string in different types of logs in the log sample set into the Bayesian filter to determine the probability that the log to be identified is a log of the target type.

[0152] Step 207: When the probability that the log to be identified is a target type log meets a preset condition, the log to be identified is determined as a target type log and added to the log sample set.

[0153] Step 208: re-determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set, and update the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set.

[0154] Step 209: When the probability that the log to be identified is a target type log meets a preset condition, determine the content to be reported in the log to be identified, and report the content to be reported to the security management server.

[0155] It should be noted that the specific implementation of steps 201 to 209 is similar to the specific implementation of steps 101 to 105, and will not be described in detail. In addition, step 209 can also be performed before step 207, and the embodiment of the present application does not limit the execution order thereof.

[0156] In the process of computer security management, the embodiment of the present application obtains the log to be identified, identifies the target string of the log to be identified, and determines at least one target string that belongs to the preset string set. Then, according to the corresponding relationship between each string in the stored string set and the frequency of each string appearing in different types of logs, the frequency of the target string appearing in different types of logs is determined. Then, the log type of the log to be identified can be determined based on the above frequency. When the log to be identified is a target type log, the content to be reported in the log to be identified is determined, and the content to be reported is reported to the security management server. When the above target type log is a log generated by a malicious application, through the technical solution provided by the embodiment of the present application, the collection of logs, the identification of logs generated by malicious applications, and the extraction and reporting of the content to be reported can be automatically completed without manual execution, which can save a lot of manpower, thereby making computer security management more efficient.

[0157] Based on the same technical concept, the embodiment of the present application also provides a computer security management device, such as Figure 3 As shown, the device includes: an acquisition module 310, a determination module 320, an identification module 330 and a reporting module 340.

[0158] An acquisition module 310 is used to acquire the log to be identified;

[0159] The determination module 320 is used to determine at least one target string that belongs to a preset string set and is contained in the log to be identified; based on the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, determine the frequency of occurrence of each target string in different types of logs in the log sample set;

[0160] An identification module 330, configured to determine the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set;

[0161] The reporting module 340 is used to determine the content to be reported in the log to be identified when the log to be identified is a target type log, and report the content to be reported to the security management server.

[0162] Optionally, the identification module 330 is used to:

[0163] Inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a target type log;

[0164] When the probability that the log to be identified is a target type log meets a preset condition, the log to be identified is determined to be a target type log.

[0165] Optionally, the identification module 330 is used to:

[0166] For each target string, the frequency of occurrence of the target string in different types of logs in the log sample set is input into the Bayesian filter to obtain a target probability corresponding to the target string, wherein the target probability is the probability that the log to be identified is a log of the target type when the target string appears in the log to be identified;

[0167] Among the target probabilities corresponding to all target character strings, determine the largest N target probabilities, and determine the joint probability of the N target probabilities, where N is a preset value;

[0168] The joint probability is determined as the probability that the log to be identified is a target type log.

[0169] Optionally, the Bayesian filter is:

[0170] Wherein, L is the target type log, N is the non-target type log, S is the target string, P(L|S) is the probability that the log to be identified is a target type log under the condition that the target string S appears in the log to be identified, P(S|N) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a non-target type log, and P(S|L) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a target type log.

[0171] Optionally, the target type log is a garbage log, which is a log generated when a non-malicious application is running. The identification module 330 is used to:

[0172] When the probability is less than a preset threshold, the log to be identified is determined as a target type log.

[0173] Optionally, the identification module 330 is used to:

[0174] The frequency of occurrence of each target character string in different types of logs in the log sample set is input into a pre-trained classification model to determine the log type of the log to be identified.

[0175] Optionally, the determining module 320 is used to:

[0176] The log to be identified is input into a first AC automaton established based on the preset character string set, and at least one target character string belonging to the preset character string set contained in the log to be identified is determined.

[0177] Optionally, the device further comprises:

[0178] A module is established, which is used to obtain the same number of logs of each type to form the log sample set; determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set; establish a corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, and store the corresponding relationship.

[0179] Optionally, the device further comprises:

[0180] An updating module is used to add the log to be identified to the log sample set; re-determine the frequency of occurrence of each string in the preset string set in different types of logs in the log sample set, and update the corresponding relationship between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set.

[0181] Optionally, the reporting module 340 is used to:

[0182] Inputting the log to be identified into a second AC automaton established based on a preset virus string set, and determining whether the log to be identified contains at least one string belonging to the preset virus string set;

[0183] When the log to be identified contains at least one character string belonging to the preset virus character string set, the log to be identified is determined as content to be reported.

[0184] Optionally, the reporting module 340 is used to:

[0185] Determining whether the log to be identified includes a command string of a preset event;

[0186] When it is determined that the log to be identified includes a command string of a preset event, determining whether an event information string corresponding to the command string is in the preset string set;

[0187] When the event information character string is not in the preset character string set, the execution time of the preset event and the name of the thread executing the preset event are determined as the content to be reported in the log to be identified.

[0188] It should be noted that: the computer security management device provided in the above embodiment only uses the division of the above functional modules as an example when performing computer security management. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the computer security management device provided in the above embodiment and the computer security management method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0189] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present application. The computer device 400 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 401 and one or more memories 402, wherein the memory 402 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 401 to implement the computer security management method provided by the above-mentioned various method embodiments. Of course, the computer device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The computer device may include other components for implementing device functions, which will not be repeated here.

[0190] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a computer device to complete the computer security management method in the following embodiment. For example, the computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0191] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0192] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for computer security management, characterized in that: The method comprises: Get the log to be identified; Determining at least one target character string contained in the log to be identified and belonging to a preset character string set; Determine the frequency of occurrence of each target string in different types of logs in the log sample set based on the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set; Determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set; When the log to be identified is a target type log, the log to be identified is input into a second AC automaton established based on a preset virus string set to determine whether the log to be identified contains at least one string belonging to the preset virus string set; when the log to be identified contains at least one string belonging to the preset virus string set, the log to be identified is determined as the content to be reported in the log to be identified; and, whether the log to be identified includes a command string of a preset event; when it is determined that the log to be identified includes a command string of the preset event, it is determined whether the event information string corresponding to the command string is in the preset string set; when the event information string is not in the preset string set, the execution time of the preset event and the name of the thread that executes the preset event are determined as the content to be reported in the log to be identified; Report the content to be reported to the security management server.

2. The method according to claim 1, characterized in that The step of determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set includes: Inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a log of the target type; When the probability that the log to be identified is the target type log meets a preset condition, the log to be identified is determined to be the target type log.

3. The method according to claim 2, characterized in that The step of inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a log of the target type includes: For each target string, the frequency of occurrence of the target string in different types of logs in the log sample set is input into the Bayesian filter to obtain a target probability corresponding to the target string, wherein the target probability is the probability that the log to be identified is a log of the target type when the target string appears in the log to be identified; Among the target probabilities corresponding to all target character strings, determine the largest N target probabilities, and determine the joint probability of the N target probabilities, where N is a preset value; The joint probability is determined as the probability that the log to be identified is the target type log.

4. The method according to claim 3, characterized in that The Bayesian filter is: Wherein, L is the target type log, N is the non-target type log, S is the target string, P(L|S) is the probability that the log to be identified is a target type log under the condition that the target string S appears in the log to be identified, P(S|N) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a non-target type log, and P(S|L) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a target type log.

5. The method according to any one of claims 2 to 4, characterized in that: The target type log is a junk log, which is a log generated when a non-malicious application is running, and when the probability that the log to be identified is the target type log meets a preset condition, determining the log to be identified as the target type log includes: When the probability is less than a preset threshold, the log to be identified is determined as a target type log.

6. The method according to claim 1, characterized in that The step of determining the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set includes: The frequency of occurrence of each target character string in different types of logs in the log sample set is input into a pre-trained classification model to determine the log type of the log to be identified.

7. The method according to claim 1, characterized in that The step of determining at least one target character string that belongs to a preset character string set and is contained in the log to be identified includes: The log to be identified is input into a first AC automaton established based on the preset character string set, and at least one target character string belonging to the preset character string set contained in the log to be identified is determined.

8. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Obtaining the same number of logs of each type to form the log sample set; Determine the frequency of occurrence of each character string in the preset character string set in different types of logs in the log sample set; A corresponding relationship between each character string in the preset character string set and the frequency at which each character string appears in different types of logs in the log sample set is established, and the corresponding relationship is stored.

9. The method according to any one of claims 1 to 4, characterized in that: The step of determining the log type of the log to be identified further includes: Adding the log to be identified to the log sample set; The frequencies of occurrence of each character string in the preset character string set in different types of logs in the log sample set are re-determined, and the corresponding relationship between each character string in the preset character string set and the frequencies of occurrence of each character string in different types of logs in the log sample set is updated.

10. A computer security management device, characterized in that: The device comprises: An acquisition module, used to acquire the logs to be identified; A determination module, configured to determine at least one target string that belongs to a preset string set and is contained in the log to be identified; based on the correspondence between each string in the preset string set and the frequency of occurrence of each string in different types of logs in the log sample set, determine the frequency of occurrence of each target string in different types of logs in the log sample set; An identification module, used to determine the log type of the log to be identified according to the frequency of occurrence of each target character string in different types of logs in the log sample set; A reporting module is used to input the log to be identified into a second AC automaton established based on a preset virus string set when the log to be identified is a target type log, and determine whether the log to be identified contains at least one string belonging to the preset virus string set; when the log to be identified contains at least one string belonging to the preset virus string set, determine the log to be identified as the content to be reported in the log to be identified; and determine whether the log to be identified includes a command string of a preset event; when it is determined that the log to be identified includes a command string of the preset event, determine whether the event information string corresponding to the command string is in the preset string set; when the event information string is not in the preset string set, determine the execution time of the preset event and the name of the thread executing the preset event as the content to be reported in the log to be identified; and report the content to be reported to a security management server.

11. The device according to claim 10, characterized in that The identification module is used to: Inputting the frequency of occurrence of each target character string in different types of logs in the log sample set into a Bayesian filter to determine the probability that the log to be identified is a log of the target type; When the probability that the log to be identified is the target type log meets a preset condition, the log to be identified is determined to be the target type log.

12. The device according to claim 11, characterized in that The identification module is used to: For each target string, the frequency of occurrence of the target string in different types of logs in the log sample set is input into the Bayesian filter to obtain a target probability corresponding to the target string, wherein the target probability is the probability that the log to be identified is a log of the target type when the target string appears in the log to be identified; Among the target probabilities corresponding to all target character strings, determine the largest N target probabilities, and determine the joint probability of the N target probabilities, where N is a preset value; The joint probability is determined as the probability that the log to be identified is the target type log.

13. The device according to claim 12, characterized in that The Bayesian filter is: Wherein, L is the target type log, N is the non-target type log, S is the target string, P(L|S) is the probability that the log to be identified is a target type log under the condition that the target string S appears in the log to be identified, P(S|N) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a non-target type log, and P(S|L) is the probability that the target string S appears in the log to be identified under the condition that the log to be identified is a target type log.

14. The device according to any one of claims 11 to 13, characterized in that The target type log is a junk log, which is a log generated when a non-malicious application is running. The identification module is used to: When the probability is less than a preset threshold, the log to be identified is determined as a target type log.

15. The device according to claim 10, characterized in that The identification module is used to: The frequency of occurrence of each target character string in different types of logs in the log sample set is input into a pre-trained classification model to determine the log type of the log to be identified.

16. The device according to claim 10, characterized in that The determining module is used to: The log to be identified is input into a first AC automaton established based on the preset character string set, and at least one target character string belonging to the preset character string set contained in the log to be identified is determined.

17. The device according to any one of claims 10 to 13, characterized in that The device also includes a building module, configured to: Obtaining the same number of logs of each type to form the log sample set; Determine the frequency of occurrence of each character string in the preset character string set in different types of logs in the log sample set; A corresponding relationship between each character string in the preset character string set and the frequency at which each character string appears in different types of logs in the log sample set is established, and the corresponding relationship is stored.

18. The device according to any one of claims 10 to 13, characterized in that The device also includes an updating module, which is used to: Adding the log to be identified to the log sample set; The frequencies of occurrence of each character string in the preset character string set in different types of logs in the log sample set are re-determined, and the corresponding relationship between each character string in the preset character string set and the frequencies of occurrence of each character string in different types of logs in the log sample set is updated.

19. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operation performed by the computer security management method according to any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the computer security management method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Naive Bayesian classification based mobile phone spam short message filtering method and system

    CN103634473A

  • Data processing method and device

    CN106940679A

  • Character-string screening method and device based on AC (Aho-Corasick) automaton and postfix expressions

    CN107193843A

  • System fault pre-warning method and system for data leakage prevention systems

    CN107423205A

  • Abnormal problem positioning method and device, equipment and storage medium

    CN109597986A