A domain name classifier detection method, device, equipment and storage medium
By obtaining and processing domain name feature values and using a random forest model to detect anomalies in the domain name classifier, it solves the problem of domain name classifier attack detection in the existing technology and improves the accuracy of network security.
Patent Information
- Application Number
- CN202011159624.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-26
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-10-26
AI Technical Summary
Existing technology is difficult to accurately detect whether a domain name classifier has been attacked, resulting in incorrect identification of malicious domain names and affecting network security.
By obtaining the training domain name set and the benchmark domain name set, the domain name feature values are calculated, and based on the weight coefficient and the random forest model, a domain name set to be compared is generated to detect whether there are abnormalities in the domain name classifier.
It achieves accurate detection of domain name classifiers, ensures the correct identification of malicious domain names, and improves network security.
Smart Images

Figure CN114500457B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security, and in particular to a domain name classifier detection method, device, equipment and storage medium. Background Art
[0002] In the daily network security field, there have always been cases of illegal activities such as registering malicious domain names to spread malware or take advantage of opportunities to control servers. In order to avoid the above situations, users usually use domain name classifiers to identify normal domain names and malicious domain names. However, hackers can interfere with the classification results given by the domain name classifier by attacking the domain name classifier, resulting in errors in the identification of illegal activities. Therefore, determining whether the domain name classifier has been attacked has become a technical problem that urgently needs to be solved in the field of network security. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application hope to provide a domain name classifier detection method, device, equipment and storage medium, which can accurately determine whether there is an abnormality in the domain name classifier.
[0004] To achieve the above purpose, the technical solution of this application is implemented as follows:
[0005] A domain name classifier detection method, the method comprising:
[0006] Obtain a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name represents a malicious domain name;
[0007] Acquire a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; the fourth domain name represents a trustworthy malicious domain name;
[0008] Based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set;
[0009] Based on the third domain name and the fourth domain name, label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set to generate a domain name set to be compared;
[0010] The to-be-compared domain name set is processed based on the domain name classifier to detect whether there is an abnormality in the domain name classifier.
[0011] In some implementations, the classifying the first domain name and the second domain name based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set to obtain an abnormal domain name set and a suspected poisoned domain name set includes:
[0012] Calculate the value of the domain name feature of each domain name in the training domain name set to obtain a first domain name feature value of each first domain name and each second domain name;
[0013] Calculate the value of the domain name feature of each domain name in the base domain name set to obtain the second domain name feature value of each of the third domain names and the third domain name feature value of each of the fourth domain names;
[0014] Get the weight coefficient of the domain name feature;
[0015] Based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
[0016] In some implementations, labeling the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the third domain name and the fourth domain name to generate a domain name set to be compared includes:
[0017] Each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set are compared with the domain names in the reference domain name set, and the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set are labeled based on the comparison results to generate the domain name set to be compared.
[0018] In some implementations, obtaining the weight coefficient of the domain name feature includes:
[0019] Obtaining a first domain name sample from the third domain name, and obtaining a second domain name sample from the fourth domain name;
[0020] Respectively calculating feature vectors of the first domain name sample and the second domain name sample in a feature space; wherein the feature space has a corresponding relationship with the domain name feature;
[0021] Based on the feature vector and the random forest model, a weight coefficient of the domain name feature is obtained.
[0022] In some implementations, the classifying the first domain name and the second domain name based on the first domain name feature value, the second domain name feature value, the third domain name feature value, and the weight coefficient to obtain the abnormal domain name set and the suspected poisoned domain name set includes:
[0023] Calculate the absolute difference between the first domain name feature value and the first mean value to obtain the first absolute value of each domain name in the training domain name set; wherein the first mean value is the mean of the second domain name feature value;
[0024] Calculate the absolute difference between the first domain name feature value and the second mean value to obtain the second absolute value of each domain name in the training domain name set; wherein the second mean value is the mean value of the third domain name feature value;
[0025] Based on the first absolute value, the second absolute value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
[0026] In some implementations, the classifying the first domain name and the second domain name based on the first absolute value, the second absolute value, the second domain name feature value, the third domain name feature value, and the weight coefficient to obtain the abnormal domain name set and the suspected poisoned domain name set includes:
[0027] Based on the first absolute value, the first mean, the first standard deviation and the first boundary value, a first score of each domain name in the training domain name set is obtained; wherein the first standard deviation is the standard deviation of the second domain name feature value; and the first boundary value is the boundary value of the second domain name feature value;
[0028] Based on the second absolute value, the second mean, the second standard deviation and the second boundary value, a second score for each domain name in the training domain name set is obtained; wherein the second standard deviation is the standard deviation of the third domain name feature value; and the second boundary value is the boundary value of the third domain name feature value;
[0029] Based on the first score of each domain name and the weight coefficient, obtaining a first weighted value for each domain name in the training domain name set;
[0030] Based on the second score of each domain name and the weight coefficient, obtaining a second weighted value for each domain name in the training domain name set;
[0031] Based on the first weighted value and the second weighted value, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
[0032] In some implementations, the classifying the first domain name and the second domain name based on the first weighted value and the second weighted value to obtain the abnormal domain name set and the suspected poisoned domain name set includes:
[0033] Calculating an absolute difference between the first weighted value and the second weighted value of each domain name;
[0034] Determine the domain names whose absolute difference is less than a preset threshold from the training domain name set, and generate the suspected poisoned domain name set;
[0035] Determine a target label for each domain name in the training domain name set based on the first weighted value and the second weighted value of each domain name;
[0036] The domain names whose target labels are different from the original labels are determined from the training domain name set to generate the abnormal domain name set; wherein the original labels are label information of each domain name in the training domain name set.
[0037] In some implementations, the step of comparing each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and labeling the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the comparison results to generate the domain name set to be compared includes:
[0038] Generate a domain name set to be confirmed based on the abnormal domain name set and the suspected poisoned domain name set;
[0039] Each domain name in the domain name set to be confirmed is matched with the third domain name, the fourth domain name and the standard database, and the domain names in the domain name set to be confirmed are labeled based on the matching results to generate the domain name set to be compared.
[0040] In some implementations, matching each domain name in the to-be-confirmed domain name set with the third domain name, the fourth domain name, and a standard database, and tagging the domain names in the to-be-confirmed domain name set based on the matching results to generate the to-be-compared domain name set includes:
[0041] Matching each domain name in the to-be-confirmed domain name set with the third domain name and the fourth domain name, and classifying the domain names in the to-be-confirmed domain name set into a first safe domain name, a first poisonous domain name, and an unknown domain name based on the matching result;
[0042] Matching the unknown domain name with the standard database, and determining the second poisoned domain name and the unknown poisoned domain name based on the matching result;
[0043] Based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, the first poisoned domain name and the second poisoned domain name are labeled, and the unknown poisoned domain name is deleted to generate the domain name set to be compared.
[0044] In some implementations, the processing of the to-be-compared domain name set based on a domain name classifier to detect whether the domain name classifier is normal includes:
[0045] Processing the domain names in the to-be-compared domain name set based on the domain name classifier to generate a pre-processed domain name set; wherein the pre-processed domain name set includes a classified first domain name and a classified second domain name;
[0046] Calculating a first matching degree between the classified first domain name and the first domain name to be compared, and calculating a second matching degree between the classified second domain name and the second domain name to be compared; wherein the domain name set to be compared includes the first domain name to be compared and the second domain name to be compared;
[0047] Based on the first matching degree and the second matching degree, obtaining a target value;
[0048] When the target value is greater than a preset matching value, detecting that the domain name classifier is normal;
[0049] When the target value is less than or equal to the preset matching value, it is detected that an abnormality exists in the domain name classifier.
[0050] In some implementations, when the target value is less than or equal to the preset matching value, after detecting that the domain name classifier is abnormal, the method further includes:
[0051] The domain name classifier is trained based on the domain name set to be compared to obtain a target classifier.
[0052] A domain name classifier detection device, comprising: an acquisition module, a classification module, a generation module and a detection module;
[0053] The acquisition module is used to acquire a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name set represents a malicious domain name;
[0054] The acquisition module is further used to acquire a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name;
[0055] The classification module is used to classify the first domain name and the second domain name based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set to obtain an abnormal domain name set and a suspected poisoned domain name set;
[0056] The generating module is used to label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the third domain name and the fourth domain name, so as to generate a domain name set to be compared;
[0057] The detection module is further used to process the to-be-compared domain name set based on the domain name classifier, and detect whether there is an abnormality in the domain name classifier.
[0058] A domain name classifier detection device, comprising: a processor, a memory and a communication bus;
[0059] The communication bus is used to realize the communication connection between the processor and the memory;
[0060] The processor is used to execute the program in the memory to implement any of the domain name classifier detection methods described above.
[0061] A computer-readable storage medium having one or more programs, wherein the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned domain name classifier detection method.
[0062] The domain name classifier detection method, device, equipment and storage medium provided in the embodiment of the present application obtain a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name represents a malicious domain name; obtain a reference domain name set; wherein the reference domain name set includes a third domain name and a fourth domain name; the third domain name represents a trusted normal domain name; the fourth domain name represents a trusted malicious domain name; based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set; based on the third domain name and the fourth domain name, the domain names in the abnormal domain name set and the suspected poisoned domain name are labeled to generate a domain name set to be compared; the domain name set to be compared is processed based on the domain name classifier to detect whether the domain name classifier has an abnormality; in this way, the normal domain name and the malicious domain name are labeled by the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, and the domain name set to be compared generated by the labeled domain name is processed based on the domain name classifier to detect whether the domain name classifier has an abnormality, so that it can accurately determine whether the domain name classifier has an abnormality. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A flowchart of a domain name classifier detection method provided in an embodiment of the present application;
[0064] Figure 2 A flowchart of another domain name classifier detection method provided in an embodiment of the present application;
[0065] Figure 3 A flowchart of another domain name classifier detection method provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of a process for sequentially performing tag matching on domain names marked as normal provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of a process of sequentially performing label matching on domain names marked as DGA provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of an architecture for determining whether a domain name classifier is normal provided in an embodiment of the present application;
[0069] Figure 7 A schematic diagram of the structure of a domain name classifier detection device provided in an embodiment of the present application;
[0070] Figure 8 A schematic diagram of the structure of a domain name classifier detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0072] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0073] Unless otherwise specified, the domain classifier detection device performs any step in the embodiments of the present application, and the processor of the domain classifier detection device may perform the step. It is also worth noting that the embodiments of the present application do not limit the order in which the domain classifier detection device performs the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be independently executed by the domain classifier detection device, that is, when the domain classifier detection device performs any step in the following embodiments, it may not rely on the execution of other steps.
[0074] The present application embodiment provides a domain name classifier detection method, which is applied to a domain name classifier detection device, such as Figure 1 As shown, the method comprises the following steps:
[0075] Step 101: Obtain a training domain name set.
[0076] The training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; and the second domain name represents a malicious domain name.
[0077] In an embodiment of the present application, a domain name classifier detection device obtains a training domain name set including a first domain name and a second domain name from any channel; at the same time, according to the label information carried by the first domain name and the second domain name, the first domain name and the second domain name are divided into a first domain name representing a normal domain name and a second domain name representing a malicious domain name. In a feasible implementation, the first domain name may be a domain name labeled as a normal domain name, and the second domain name may be a domain name labeled as a DGA domain name; in other embodiments of the present application, a domain name labeled as a normal domain name is used as an example for explanation, and a domain name labeled as a DGA domain name is used as an example for explanation.
[0078] In the embodiment of the present application, the network attacker usually uses data poisoning to modify the domain name related information, so that the domain name classifier or the user regards the normal domain name as the DGA domain name, or regards the DGA domain name as the normal domain name; at the same time, the domain name with the modified domain name related information is called poisoned data; wherein, when the characteristic distribution of the poisoned data is greatly different from the characteristic distribution of the trusted domain name, it is also called an outlier, and when the characteristic distribution of the poisoned data is similar to the characteristic distribution of the trusted domain name, it is also called hidden poisoned data. It should be noted that poisoned data and hidden poisoned data can exist in the first domain name and the second domain name at the same time; that is, the first domain name does not mean that the domain name must be a normal domain name, it may also be a DGA domain name, but the label of the domain name has changed due to data poisoning; accordingly, the second domain name does not mean that the domain name must be a DGA domain name, it may also be a normal domain name, but the label of the domain name has changed due to data poisoning; wherein, the first domain name and the second domain name can have poisoned data at the same time, or only the first domain name has poisoned data or the second domain name has poisoned data, and the present application does not make any limitation on this.
[0079] Step 102: Obtain a base domain name set.
[0080] Among them, the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name.
[0081] In the embodiment of the present application, the domain name classifier detection device can mine and search for DGA domain names and normal domain names from the information of third-party trusted websites to obtain a reference domain name set. In a feasible implementation, the domain name classifier detection device can collect normal website domain names from one website to generate a third domain name, and collect third-party trusted DGA domain names from another website to generate a fourth domain name.
[0082] In a feasible implementation, the registration information of the trusted DGA domain name is collected through a domain name query protocol (whios), wherein the registration information of the fourth domain name includes the current owner of the domain name and the owner's contact information, and more contact information of the owner is collected on social networking sites through network information mining technology, and the current owners of all DGA domain names and all the owners' contact information are stored in a DGA domain name registration information data table; wherein the DGA domain name registration information data table is mainly composed of domain names, contacts, contact email addresses, contact numbers and other contact information.
[0083] Step 103: Based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0084] It should be noted that domain name features include: domain name information entropy features, consonant features, vowel features, number features, length features, N-gram features, and Chinese and English morpheme features; among them, domain name information entropy features may include domain name information entropy, the product of domain name information entropy and domain name length normal rate, etc.; consonant features may include the number of consonants, the product of the number of consonants and the domain name length normal rate; vowel features may include vowel information entropy, the product of vowel information entropy and domain name length normal rate, etc.; number features may include the product of the number of numbers and the domain name length normal rate, the product of the number of number combinations and the domain name length normal rate, etc.; length features may include domain name length; N-gram features may include the 2-gram value of English vocabulary in the domain name, the 3-gram value of Chinese vocabulary in the domain name, etc.; Chinese and English morpheme features may include the number of non-morpheme characters in the domain name, the average length of domain name morphemes, etc.
[0085] Among them, the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the benchmark domain name set are different in specific expressions.
[0086] In an embodiment of the present application, the domain name classifier detection device can classify the first domain name and the second domain name based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set to obtain an abnormal domain name set and a suspected poisoned domain name set; wherein the domain name classifier detection device screens out abnormal domain names whose domain name feature value distribution is significantly different from that of trusted domain names to obtain an abnormal domain name set; and generates a suspected poisoned domain name set based on hidden poisoned domain names whose domain name feature value distribution is similar to that of trusted domain names.
[0087] Step 104: Based on the third domain name and the fourth domain name, label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set to generate a domain name set to be compared.
[0088] In an embodiment of the present application, the domain name classifier detection device matches each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the trusted normal domain name and the trusted DGA domain name, and re-labels the domain names marked as normal and marked as DGA with corresponding domain name labels based on the matching results; the domain name classifier detection device generates a domain name set to be compared based on the re-labeled domain names.
[0089] In the embodiment of the present application, the domain names in the to-be-matched domain name set can be classified into two categories: domain names with normal labels and domain names with DGA labels.
[0090] Step 105: Process the domain name set to be compared based on the domain name classifier to detect whether there is an abnormality in the domain name classifier.
[0091] In an embodiment of the present application, a domain name classifier detection device inputs the domain names in the domain name set to be compared into the domain name classifier for processing, obtains corresponding classification results, compares the classification results with the domain names in the domain name set to be compared based on the label information of each domain name, detects the prediction results of the domain name classifier based on the comparison results, and detects the degree of poisoning of the domain name classifier based on the results.
[0092] It should be noted that the domain name classifier detection device can detect the misjudgment rate of the domain name classifier based on the predicted results of the domain name classifier, and determine the degree of poisoning of the domain name classifier based on the misjudgment rate and a preset threshold; wherein, if the misjudgment rate exceeds the preset probability value, it is considered that the degree of poisoning of the domain name classifier is high, that is, the domain name classifier may be attacked and poisoned.
[0093] The domain name classifier detection method provided in the embodiment of the present application obtains a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name represents a malicious domain name; obtains a base domain name set; wherein the quasi-domain name set includes a third domain name and a fourth domain name; the third domain name represents a trusted normal domain name; the fourth domain name represents a trusted malicious domain name; based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the base domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set; based on the third domain name and the fourth domain name, the domain names in the abnormal domain name set and the suspected poisoned domain name are labeled to generate a domain name set to be compared; the domain name set to be compared is processed based on the domain name classifier to detect whether there is an abnormality in the domain name classifier; in this way, the normal domain name and the malicious domain name are labeled by the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the base domain name set, and the domain name set to be compared generated by the labeled domain name is processed based on the domain name classifier to detect whether there is an abnormality in the domain name classification, so that it can accurately determine whether there is an abnormality in the domain name classifier.
[0094] Based on the above embodiments, the present application also provides a domain name classifier detection method, such as Figure 2 As shown, the method comprises the following steps:
[0095] Step 201: The domain name classifier detection device obtains a training domain name set.
[0096] The training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; and the second domain name represents a malicious domain name.
[0097] Step 202: The domain name classifier detection device obtains a reference domain name set.
[0098] Among them, the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name.
[0099] Step 203: The domain name classifier detection device calculates the value of the domain name feature of each domain name in the training domain name set to obtain the first domain name feature value of each first domain name and each second domain name.
[0100] In the embodiment of the present application, the domain name classifier detection device calculates the first domain name feature value of each domain name marked as normal and each domain name marked as DGA.
[0101] The domain name classifier detection device calculates and obtains the domain name feature value of each first domain name and each second domain name in each of the above domain name features.
[0102] Step 204: The domain name classifier detection device calculates the value of the domain name feature of each domain name in the reference domain name set, and obtains the second domain name feature value of each third domain name and the third domain name feature value of each fourth domain name.
[0103] In the embodiment of the present application, the domain name classifier detection device obtains the second domain name feature value of each trusted normal domain name under each domain name feature, and the fourth domain name feature value of each trusted DGA domain name under each domain name feature.
[0104] Among them, the domain name classifier detection device calculates the first mean Ei, the first standard deviation Si and the first boundary value of the second domain name feature value of each third domain name; and at the same time calculates the second mean Ei', the second standard deviation Si' and the second boundary value ei' of the third domain name feature value of each fourth domain name.
[0105] It should be noted that the first mean value Ei is different from the second mean value Ei'; the first standard deviation Si is different from the second standard deviation Si'; and the first boundary value ei is different from the second boundary value ei'.
[0106] Step 205: The domain name classifier detection device obtains a weight coefficient of the domain name feature.
[0107] In a feasible implementation, the domain name classifier detection device may also implement step 205 through steps 205a to 205c:
[0108] Step 205a: The domain name classifier detection device obtains a first domain name sample from the third domain name, and obtains a second domain name sample from the fourth domain name.
[0109] In an embodiment of the present application, the domain name classifier detection device randomly selects any number of domain names from the trusted normal domain names and the trusted DGA domain names as the first domain name sample and the second domain name sample, that is, the domain names in the first domain name sample are trusted normal domain names; correspondingly, the domain names in the second domain name sample are trusted DGA domain names.
[0110] Step 205b: The domain name classifier detection device calculates feature vectors of the first domain name sample and the second domain name sample in the feature space respectively.
[0111] Among them, the feature space has a corresponding relationship with the domain name feature.
[0112] In an embodiment of the present application, the domain name classifier detection device calculates the vector value of each first domain name sample and each second domain name sample in the feature space corresponding to the domain name feature, that is, the feature vector value; wherein the feature space is a feature set space composed of the domain name features corresponding to each domain name.
[0113] Step 205c: The domain name classifier detection device obtains a weight coefficient of the domain name feature based on the feature vector and the random forest model.
[0114] In an embodiment of the present application, the domain name classifier detection device uses the feature vector to perform model training on the random forest model, and uses the trained random forest model to evaluate the importance of each domain name feature to obtain a weight coefficient corresponding to each domain name feature.
[0115] It should be noted that the random forest model is a classifier that uses multiple trees to train and predict training samples; in the embodiment of the present application, there is no limitation on the number of decision trees used in the random forest model, and at the same time, the idea of transfer learning is used in the training process to analyze the importance of domain name features of the training samples, that is, the feature vector.
[0116] Step 206: The domain name classifier detection device classifies the first domain name and the second domain name based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0117] In an embodiment of the present application, a domain name classifier detection device processes a first domain name feature value and a second domain name feature value, and processes a first domain name feature value and a third domain name feature value, and then based on a weight coefficient corresponding to the domain name feature, performs attribute analysis on domain names marked as normal and domain names marked as DGA in a training domain name set, screens out abnormal domain names whose domain name feature value distribution is significantly different from that of trusted domain names, and hidden poisoned domain names whose domain name feature value distribution is similar to that of trusted domain names, and generates an abnormal domain name set based on the abnormal domain names, and generates a suspected poisoned domain name set based on the hidden poisoned domain names; wherein, the trusted domain names include trusted normal domain names and trusted DGA domain names.
[0118] Step 207: The domain name classifier detection device tags the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the third domain name and the fourth domain name, and generates a domain name set to be compared.
[0119] In a feasible implementation, the domain name classifier detection device may also implement step 207 by executing the following 207a:
[0120] Step 207a, the domain name classifier detection device compares each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and labels the domain names in the abnormal domain name set and the suspected poisoned domain name set based on the comparison results to generate a domain name set to be compared.
[0121] In an embodiment of the present application, the domain name classifier detection device compares each domain name in the abnormal domain name set with the trusted normal domain names and the trusted DGA domain names in the base domain name set, and accordingly, compares each domain name in the suspected poisoned domain name set with the trusted normal domain names and the trusted DGA domain names in the base domain name set. Based on the above two comparison results, the poisoned domain names are screened out from the abnormal domain name set and the suspected poisoned domain name set, and the poisoned domain names are labeled to generate a domain name set to be compared.
[0122] Step 208: The domain name classifier detection device processes the domain name set to be compared based on the domain name classifier to detect whether there is an abnormality in the domain name classifier.
[0123] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0124] The domain name classifier detection method provided in the embodiment of the present application labels normal domain names and malicious domain names by training the domain name features of each domain name in the domain name set and the domain name features of each domain name in the reference domain name set, and processes the domain name set to be compared generated by the labeled domain names based on the domain name classifier to detect whether there is an abnormality in the domain name classification. In this way, it can be accurately determined whether there is an abnormality in the domain name classifier.
[0125] Based on the above embodiments, the embodiments of the present application also provide a domain name classifier detection method, such as Figure 3 As shown, the method comprises the following steps:
[0126] Step 301: The domain name classifier detection device obtains a training domain name set.
[0127] The training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; and the second domain name represents a malicious domain name.
[0128] Step 302: The domain name classifier detection device obtains a reference domain name set.
[0129] Among them, the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name.
[0130] Step 303: The domain name classifier detection device calculates the value of the domain name feature of each domain name in the training domain name set to obtain the first domain name feature value of each first domain name and each second domain name.
[0131] Step 304: The domain name classifier detection device calculates the value of the domain name feature of each domain name in the reference domain name set to obtain the second domain name feature value of each third domain name and the third domain name feature value of each fourth domain name.
[0132] Step 305: The domain name classifier detection device obtains a weight coefficient of the domain name feature.
[0133] Step 306: The domain name classifier detection device calculates the absolute difference between the first domain name feature value and the first mean value to obtain the first absolute value of each domain name in the training domain name set.
[0134] The first mean is the mean of the second domain name feature values.
[0135] Step 307: The domain name classifier detection device calculates the absolute difference between the first domain name feature value and the second mean value to obtain the second absolute value of each domain name in the training domain name set.
[0136] Among them, the second mean is the mean of the third domain name feature value.
[0137] Step 308: The domain name classifier detection device classifies the first domain name and the second domain name based on the first absolute value, the second absolute value, the second domain name characteristic value, the third domain name characteristic value and the weight coefficient to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0138] In a feasible implementation, when the domain name classifier detection device executes step 308, it can also be implemented by the following steps 308a to 308e:
[0139] Step 308a: The domain name classifier detection device obtains a first score for each domain name in the training domain name set based on the first absolute value, the first mean, the first standard deviation, and the first boundary value.
[0140] The first standard deviation is the standard deviation of the second domain name feature value; and the first boundary value is the boundary value of the second domain name feature value.
[0141] In the embodiment of the present application, the domain name classifier detection device compares the first absolute value di, the first mean Ei, the first standard deviation Si and the first boundary value ei to obtain the score Scorei of each domain name relative to the trusted normal domain name under each domain name feature.
[0142] The value of the score of each domain name relative to the trusted normal domain name under each domain name feature can be expressed in any form, and this application does not impose any limitation on this.
[0143] In another feasible implementation, the domain name classifier detection device processes the first mean Ei, the first standard deviation Si, and the first boundary value ei to generate a data set corresponding to the first mean Ei, the first standard deviation Si, and the first boundary value ei: Si, ei and ei+Si, and then the first absolute value di is sequentially The values of Si, ei and ei+Si are compared to obtain the score Scorei of each domain name in the training domain name set relative to the trusted normal domain name under each domain name feature; in a feasible implementation, Scorei can be calculated by the following formula (1):
[0144]
[0145] The above formula (1) indicates that when di is in different value ranges, there will be corresponding scores; for example, when the first absolute value di is in the value range of Si and ei, the score of Scorei is 4.
[0146] Step 308b: The domain name classifier detection device obtains a second score for each domain name in the training domain name set based on the second absolute value, the second mean, the second standard deviation, and the second boundary value.
[0147] The second standard deviation is the standard deviation of the third domain name characteristic value; and the second boundary value is the boundary value of the third domain name characteristic value.
[0148] In the embodiment of the present application, the domain name classifier detection device compares the second absolute value di', the second mean Ei', the second standard deviation Si' and the second boundary value ei' to obtain the score Scorei' of each domain name relative to the trusted DGA domain name under each domain name feature.
[0149] The value of the score of each domain name relative to the trusted DGA domain name under each domain name feature can be expressed in any form, and this application does not impose any limitation on this.
[0150] In another feasible implementation, the domain name classifier detection device processes the second mean Ei', the second standard deviation Si' and the second boundary value ei' to generate a data set corresponding to the second mean Ei', the second standard deviation Si' and the second boundary value ei': Si', ei' and ei'+Si', and then the second absolute value di' is successively The numerical values of Si', ei' and ei'+Si' are compared to obtain the score Scorei' of each domain name relative to the trusted DGA domain name under each domain name feature; in a feasible implementation, Scorei' can be calculated using the following formula (2):
[0151]
[0152] The above formula (2) indicates that when di' is in different value ranges, there will be corresponding scores; for example, when the second absolute value di' is in the value range of Si' and ei', the score of Scorei' is 4.
[0153] It should be noted that the score Scorei' calculated by the domain name classifier detection device for each domain name in the training domain name set relative to the trusted DGA domain name under each domain name feature may be the same as or different from the score Scorei of each domain name in the training domain name set relative to the trusted normal domain name under each domain name feature.
[0154] Step 308c: The domain name classifier detection device obtains a first weighted value for each domain name in the training domain name set based on the first score and weight coefficient of each domain name.
[0155] In an embodiment of the present application, a domain name classifier detection device multiplies the first score of each domain name in the training domain name set for each domain name feature by the weight coefficient corresponding to each domain name feature and superimposes all the products to obtain a first weighted value of each domain name for each trusted normal domain name on each domain name feature; wherein each domain name in the training domain name set includes domain names marked as normal and domain names marked as DGA.
[0156] Step 308d: The domain name classifier detection device obtains a second weighted value for each domain name in the training domain name set based on the second score and weight coefficient of each domain name.
[0157] In an embodiment of the present application, the domain name classifier detection device multiplies the second score of each domain name in the training domain name set for each domain name feature by the weight coefficient corresponding to each domain name feature and superimposes all the products to obtain the second weighted value of each domain name for each domain name feature for the trusted DGA domain name; wherein each domain name in the training domain name set includes domain names marked as normal and domain names marked as DGA.
[0158] Step 308e: The domain name classifier detection device classifies the first domain name and the second domain name based on the first weighted value and the second weighted value to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0159] In a feasible implementation, when the domain name classifier detection device executes step 308e, it can also be implemented by executing the following steps e1 to e4:
[0160] Step e1: The domain name classifier detection device calculates the absolute difference between the first weighted value and the second weighted value of each domain name.
[0161] Step e2: The domain name classifier detection device determines domain names whose absolute difference is less than a preset threshold from the training domain name set, and generates a set of suspected poisoned domain names.
[0162] In an embodiment of the present application, the domain name classifier detection device calculates the absolute difference between the first weighted value and the second weighted value of each domain name in the training domain name set. If the absolute difference is less than a preset threshold, the domain name is considered to be a suspected hidden poisoned domain; in an embodiment of the present application, 5 is used as the preset threshold for comparison.
[0163] Step e3: The domain name classifier detection device determines a target label for each domain name in the training domain name set based on the first weighted value and the second weighted value of each domain name.
[0164] Step e4: The domain name classifier detection device determines the domain names whose target labels are different from the original labels from the training domain name set, and generates an abnormal domain name set.
[0165] Among them, the original label is the label information of each domain name in the training domain name set.
[0166] In an embodiment of the present application, the domain name classifier detection device compares the first weighted value and the second weighted value of each domain name in the training domain name set, determines the weighted value with a larger value, and uses the label of the trusted domain name corresponding to the weighted value as the classification result, and compares the classification result based on the domain name with the original label of the domain name in the training domain name set. If there is a difference in the label, an abnormal domain name set is generated based on the domain name.
[0167] Step 309: The domain name classifier detection device generates a set of domain names to be confirmed based on the abnormal domain name set and the suspected poisoned domain name set.
[0168] In the embodiment of the present application, the domain name classifier detection device integrates each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set to generate a domain name set to be confirmed.
[0169] Step 310: The domain name classifier detection device matches each domain name in the domain name set to be confirmed with the third domain name, the fourth domain name and the standard database, and tags the domain names in the domain name set to be confirmed based on the matching results to generate a domain name set to be compared.
[0170] In a feasible implementation, when the domain name classifier detection device executes step 310, it can also be implemented by executing the following steps 310a to 310c:
[0171] Step 310a: The domain name classifier detection device matches each domain name in the domain name set to be confirmed with the third domain name and the fourth domain name, and classifies the domain names in the domain name set to be confirmed into a first safe domain name, a first poisonous domain name and an unknown domain name based on the matching result.
[0172] In an embodiment of the present application, the domain name classifier detection device can divide each domain name in the domain name set to be confirmed into domain names marked as normal and domain names marked as DGA according to the original label; at the same time, the domain names marked as normal are matched with each domain name in the trusted normal domain names and each domain name in the trusted DGA domain names in turn; accordingly, the domain names marked as DGA are matched with each domain name in the trusted normal domain names and each domain name in the trusted DGA domain names in turn, and each domain name in the domain name set to be confirmed is divided into a first safe domain name, a first poisonous domain name and an unknown domain name based on the matching result.
[0173] Step 310b: The domain name classifier detection device matches the unknown domain name with the standard database, and determines the second poisoned domain name and the unknown poisoned domain name based on the matching result.
[0174] In an embodiment of the present application, the annotation database may be based on a domain name library provided by whois.
[0175] In a feasible implementation, the domain name set to be confirmed can be divided into two categories, namely, the domain names marked as normal and the domain names marked as DGA, and the corresponding matching processes are performed in turn, such as Figure 4 As shown in FIG. 1 , a flowchart of performing label matching on domain names marked as normal is given; accordingly, Figure 5 A flowchart of label matching for domain names marked as DGA is given; Figure 4 As shown, step 401, obtain the domain name marked as normal; step 402, determine whether the domain name marked as normal is in the trusted normal domain name, if it exists, it is considered that the domain name is a non-poisoned domain name, that is, non-poisoned data, if not, then execute step 403, continue to determine whether the domain name is in the trusted DGA domain name, if it is, it is a poisoned domain name, that is, poisoned data; similarly, Figure 4 The same steps are used to match domains marked as DGA, but the matching results are different. Figure 4 and Figure 5 If the domain name marked as normal and the domain name marked as DGA cannot be found in the trusted normal domain names and the trusted DGA domain names, then execute step 404 and correspondingly execute step 504, continue to determine whether the domain name has been registered through whois query, if not registered, it is defined as unknown poisoned data, if registered, then execute steps 405 and 505 accordingly, check the current holder and owner contact information of the domain name, and search from the trusted DGA domain name registration information data table, if no match is found, it is defined as unknown poisoned data, if a match is found, the domain name marked as DGA is confirmed as non-poisoned data, and the domain name marked as normal is confirmed as non-poisoned data.
[0176] Step 310c: The domain name classifier detection device labels the first poisoned domain name and the second poisoned domain name based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, deletes unknown poisoned domain names, and generates a domain name set to be compared.
[0177] In the embodiment of the present application, labels are retained for non-poisoned domain names; unknown poisoned domain names are recorded to provide materials for subsequent research on poisoned data and are deleted from the training domain name set; at the same time, the first poisoned domain name and the second poisoned domain name are re-labeled based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, and the labels of the poisoned domain names whose label information of the first poisoned domain name and the second poisoned domain name in the training domain name set is normal domain names are modified to DGA domain names, and the labels of the poisoned domain names whose label information of the first poisoned domain name and the second poisoned domain name in the training domain name set is DGA domain names are modified to normal domain names, and a domain name set to be compared is generated based on the poisoned domain names with corrected labels.
[0178] Step 311: The domain name classifier detection device processes the domain names in the to-be-compared domain name set based on the domain name classifier to generate a pre-processed domain name set.
[0179] The pre-processed domain name set includes a classified first domain name and a classified second domain name.
[0180] In an embodiment of the present application, the domain name classifier classifies each domain name in the domain name set to be compared according to preset rules, and divides it into a classified first domain name and a classified second domain name recognized by the domain name classifier; in other embodiments of the present application, the recognized normal domain name is explained as the classified first domain name, and the recognized DGA domain name is explained as the classified second domain name.
[0181] Step 312: The domain name classifier detection device calculates a first matching degree between the classified first domain name and the first domain name to be compared, and calculates a second matching degree between the classified second domain name and the second domain name to be compared.
[0182] The domain name set to be compared includes a first domain name to be compared and a second domain name to be compared.
[0183] In the embodiments of the present application, the domain name confirmed to be poisoned and marked as normal is used as an example for explanation as the first domain name to be compared, and the domain name confirmed to be poisoned and marked as DGA is used as an example for explanation as the second domain name to be compared.
[0184] In a feasible implementation, the domain name classifier detection device calculates the matching degree between the recognized normal domain name and the domain name confirmed to be poisoned and marked as normal as the first matching degree, and calculates the matching degree between the recognized DGA domain name and the domain name confirmed to be poisoned and marked as DGA as the second matching degree.
[0185] Step 313: The domain name classifier detection device obtains a target value based on the first matching degree and the second matching degree.
[0186] In the embodiment of the present application, the domain name classifier detection device determines the classification confidence of the domain name classifier, that is, the target value, based on the first matching degree and the second matching degree.
[0187] Step 314: When the target value is greater than the preset matching value, the domain name classifier detection device detects that the domain name classifier is normal.
[0188] In an embodiment of the present application, the domain name classifier detection device compares the target value with the preset matching value to detect whether there is an abnormality in the domain name classifier; if the calculated target value is greater than the preset matching value, the domain name classifier is considered to be normal and the prediction result has a high success rate, otherwise the opposite is true.
[0189] Step 315: When the target value is less than or equal to the preset matching value, the domain name classifier detection device detects that there is an abnormality in the domain name classifier.
[0190] In the embodiment of the present application, after executing step 315, the domain name classifier detection device may further execute the following step A:
[0191] Step A: The domain name classifier detection device trains the domain name classifier based on the domain name set to be compared to obtain a target classifier.
[0192] In other embodiments of the present application, the domain name classifier detection device confirms that the target value is less than the preset matching value, that is, it is considered that the success rate of the prediction result of the domain name classifier is low, there is a risk of poisoning, and retraining is required.
[0193] Among them, the domain name classifier detection device retrains the domain name classifier through the domain names in the domain name set to be compared until the prediction result of the domain name classifier is higher than the preset threshold, then stops training, and the domain name classifier at this time is the target classifier.
[0194] like Figure 6As shown, a schematic diagram of an architecture for judging whether a domain name classifier is normal is provided. The domain name classifier detection method provided in the embodiment of the present application can be applied to the architecture to judge whether the domain name classifier is normal, that is, whether it is poisoned, and to correct it if the domain name classifier is poisoned; wherein, the training data reading module reads the training data set, that is, the training domain name set, and inputs the training data set into the poisoning data detection module for confirmation to obtain a suspected poisoned domain name set and an abnormal domain name set, and at the same time, by obtaining a known domain name database construction module from a third-party trusted website, a reference domain name set including a trusted normal domain name and a trusted DGA domain name is obtained, and each domain name in the suspected poisoned domain name set and the abnormal domain name set is compared with the reference domain name set based on the domain name confirmation module, and the relevant domain names in the training data set are processed based on the comparison result based on the training data cleaning module to generate a domain name set to be compared; the domain name set to be compared is input into the domain name classifier to determine the degree of poisoning of the domain name classifier, that is, the classifier poisoning judgment module is used to determine whether the domain name classifier is abnormal, and if the domain name classifier is abnormal, the domain name classification is corrected by processing the generated domain name set to be compared by the training data cleaning module to generate a target domain name classifier.
[0195] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0196] The domain name classifier detection method provided in the embodiment of the present application labels normal domain names and malicious domain names by training the domain name features of each domain name in the domain name set and the domain name features of each domain name in the reference domain name set, and processes the domain name set to be compared generated by the labeled domain names based on the domain name classifier to detect whether there is an abnormality in the domain name classification. In this way, it can be accurately determined whether there is an abnormality in the domain name classifier.
[0197] Based on the above embodiments, the embodiments of the present application further provide a domain name classifier detection device 7, which can be applied to Figures 1 to 3 In a domain name classifier detection method provided in a corresponding embodiment, referring to Figure 7 As shown, the domain name classifier detection device 7 may include: an acquisition module 71, a classification module 72, a generation module 73 and a detection module 74, wherein:
[0198] The acquisition module 71 is used to acquire a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; and the second domain name represents a malicious domain name;
[0199] The acquisition module 71 is further used to acquire a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name;
[0200] A classification module 72, configured to classify the first domain name and the second domain name based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, to obtain an abnormal domain name set and a suspected poisoned domain name set;
[0201] A generating module 73 is used to label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the third domain name and the fourth domain name, and generate a domain name set to be compared;
[0202] The confirmation module 74 is further used to process the domain name set to be compared based on the domain name classifier and detect whether there is an abnormality in the domain name classifier.
[0203] In other embodiments of the present application, the classification module 72 is further used to calculate the value of the domain name feature of each domain name in the training domain name set, and obtain the first domain name feature value of each first domain name and each second domain name;
[0204] Obtaining the value of the domain name feature of each domain name in the calculation base domain name set, obtaining the second domain name feature value of each third domain name, and the third domain name feature value of each fourth domain name;
[0205] Get the weight coefficient of the domain name feature;
[0206] Based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0207] In other embodiments of the present application, the generation module 73 is also used to compare each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the comparison results to generate a domain name set to be compared.
[0208] In other embodiments of the present application, the classification module 72 is further used to obtain a first domain name sample from a third domain name, and obtain a second domain name sample from a fourth domain name;
[0209] Calculate the feature vectors of the first domain name sample and the second domain name sample in the feature space respectively; wherein the feature space has a corresponding relationship with the domain name feature;
[0210] Based on the feature vector and random forest model, the weight coefficient of the domain name feature is obtained.
[0211] In other embodiments of the present application, the classification module 72 is further used to calculate the absolute difference between the first domain name feature value and the first mean value to obtain the first absolute value of each domain name in the training domain name set; wherein the first mean value is the mean value of the second domain name feature value;
[0212] Calculate the absolute difference between the first domain name feature value and the second mean value to obtain the second absolute value of each domain name in the training domain name set; wherein the second mean value is the mean value of the third domain name feature value;
[0213] Based on the first absolute value, the second absolute value, the second domain name characteristic value, the third domain name characteristic value and the weight coefficient, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0214] In other embodiments of the present application, the classification module 72 is further used to obtain a first score for each domain name in the training domain name set based on the first absolute value, the first mean, the first standard deviation, and the first boundary value; wherein the first standard deviation is the standard deviation of the second domain name feature value; the first boundary value is the boundary value of the second domain name feature value;
[0215] Based on the second absolute value, the second mean, the second standard deviation and the second boundary value, a second score of each domain name in the training domain name set is obtained; the second standard deviation is the standard deviation of the third domain name feature value; the second boundary value is the boundary value of the third domain name feature value;
[0216] Based on the first score and weight coefficient of each domain name, a first weight value of each domain name in the training domain name set is obtained;
[0217] Based on the second score and the weight coefficient of each domain name, a second weighted value of each domain name in the training domain name set is obtained;
[0218] Based on the first weighted value and the second weighted value, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0219] In other embodiments of the present application, the classification module 72 is further configured to calculate the absolute difference between the first weighted value and the second weighted value of each domain name;
[0220] Determine the domain names whose absolute difference is less than a preset threshold from the training domain name set to generate a set of suspected poisoned domain names;
[0221] Determine a target label for each domain name in the training domain name set based on the first weighted value and the second weighted value of each domain name;
[0222] The domain names whose target labels are different from the original labels are determined from the training domain name set to generate an abnormal domain name set; wherein the original label is the label information of each domain name in the training domain name set.
[0223] In other embodiments of the present application, the generating module 73 is further used to generate a domain name set to be confirmed based on the abnormal domain name set and the suspected poisoned domain name set;
[0224] Each domain name in the domain name set to be confirmed is matched with the third domain name, the fourth domain name and the standard database, and the domain names in the domain name set to be confirmed are labeled based on the matching results to generate a domain name set to be compared.
[0225] In other embodiments of the present application, the generating module 73 is further used to match each domain name in the to-be-confirmed domain name set with the third domain name and the fourth domain name, and divide the domain names in the to-be-confirmed domain name set into a first safe domain name, a first poisonous domain name, and an unknown domain name based on the matching result;
[0226] Matching the unknown domain name with the standard database, and determining the second poisoned domain name and the unknown poisoned domain name based on the matching result;
[0227] Based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, the first poisoned domain name and the second poisoned domain name are labeled, and the unknown poisoned domain name is deleted to generate a domain name set to be compared.
[0228] In other embodiments of the present application, the detection module 74 is further used to process the domain names in the comparison domain name set based on the domain name classifier to generate a pre-processed domain name set; wherein the pre-processed domain name set includes the classified first domain name and the classified second domain name;
[0229] Calculating a first matching degree between the classified first domain name and the first domain name to be compared, and calculating a second matching degree between the classified second domain name and the second domain name to be compared; wherein the domain name set to be compared includes the first domain name to be compared and the second domain name to be compared;
[0230] Based on the first matching degree and the second matching degree, generating a target value;
[0231] When the target value is greater than the preset matching value, the detection domain classifier is normal;
[0232] When the target value is less than or equal to the preset matching value, an abnormality is detected in the domain name classifier.
[0233] In other embodiments of the present application, the detection module 74 is further used to train a domain name classifier based on the domain name set to be compared to obtain a target classifier.
[0234] It should be noted that the specific implementation process of the steps executed by each module in this embodiment can be referred to Figures 1 to 3 The implementation process of the domain name classifier detection method provided in the corresponding embodiment will not be repeated here.
[0235] The domain name classifier detection device provided in the embodiment of the present application labels normal domain names and malicious domain names by using the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, and processes the domain name set to be compared generated by the labeled domain names based on the domain name classifier to detect whether there is an abnormality in the domain name classification. In this way, it can be accurately determined whether there is an abnormality in the domain name classifier.
[0236] Based on the above embodiments, the embodiments of the present application further provide a domain name classifier detection device 8, which can be applied to Figures 1 to 3 In a domain name classifier detection method provided in a corresponding embodiment, referring to Figure 8 As shown, the domain name classifier detection device 8 may include: a processor 81, a memory 82 and a communication bus 83, wherein:
[0237] The communication bus 83 is used to implement the communication connection between the processor 81 and the memory 82 .
[0238] The processor 81 is used to execute the program stored in the memory 82 to implement the following steps:
[0239] Obtain a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name represents a malicious domain name;
[0240] Obtain a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; the fourth domain name represents a trustworthy malicious domain name;
[0241] Based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set;
[0242] Based on the third domain name and the fourth domain name, the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set are labeled to generate a domain name set to be compared;
[0243] The domain name set to be compared is processed based on the domain name classifier to detect whether there is an abnormality in the domain name classifier.
[0244] In other embodiments of the present application, the processor 81 is used to execute the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set stored in the memory 82, classify the first domain name and the second domain name, obtain the abnormal domain name set and the suspected poisoned domain name set, and can also implement the following steps:
[0245] Calculate the value of the domain name feature of each domain name in the training domain name set to obtain the first domain name feature value of each first domain name and each second domain name;
[0246] Calculate the value of the domain name feature of each domain name in the base domain name set to obtain the second domain name feature value of each third domain name and the third domain name feature value of each fourth domain name;
[0247] Get the weight coefficient of the domain name feature;
[0248] Based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0249] In other embodiments of the present application, the processor 81 is used to execute the third domain name and the fourth domain name stored in the memory 82, label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set, generate a domain name set to be compared, and can also implement the following steps:
[0250] Each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set are compared with the domain names in the benchmark domain name set, and the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set are labeled based on the comparison results to generate a domain name set to be compared.
[0251] In other embodiments of the present application, the processor 81 is used to execute the weight coefficient for obtaining the domain name feature stored in the memory 82, and can also implement the following steps:
[0252] Obtaining a first domain name sample from a third domain name, and obtaining a second domain name sample from a fourth domain name;
[0253] Calculate the feature vectors of the first domain name sample and the second domain name sample in the feature space respectively; wherein the feature space has a corresponding relationship with the domain name feature;
[0254] Based on the feature vector and random forest model, the weight coefficient of the domain name feature is obtained.
[0255] In other embodiments of the present application, the processor 81 is used to execute the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient stored in the memory 82 to classify the first domain name and the second domain name to obtain an abnormal domain name set and a suspected poisoned domain name set, and can also implement the following steps:
[0256] Calculate the absolute difference between the first domain name feature value and the first mean value to obtain the first absolute value of each domain name in the training domain name set; wherein the first mean value is the mean of the second domain name feature value;
[0257] Calculate the absolute difference between the first domain name feature value and the second mean value to obtain the second absolute value of each domain name in the training domain name set; wherein the second mean value is the mean value of the third domain name feature value;
[0258] Based on the first absolute value, the second absolute value, the second domain name characteristic value, the third domain name characteristic value and the weight coefficient, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0259] In other embodiments of the present application, the processor 81 is used to execute the first absolute value, the second absolute value, the second domain name feature value, the third domain name feature value and the weight coefficient stored in the memory 82, classify the first domain name and the second domain name, obtain the abnormal domain name set and the suspected poisoned domain name set, and can also implement the following steps:
[0260] Based on the first absolute value, the first mean, the first standard deviation and the first boundary value, a first score of each domain name in the training domain name set is obtained; wherein the first standard deviation is the standard deviation of the second domain name feature value; the first boundary value is the boundary value of the second domain name feature value;
[0261] Based on the second absolute value, the second mean, the second standard deviation and the second boundary value, a second score of each domain name in the training domain name set is obtained; wherein the second standard deviation is the standard deviation of the third domain name feature value; and the second boundary value is the boundary value of the third domain name feature value;
[0262] Based on the first score and weight coefficient of each domain name, a first weight value of each domain name in the training domain name set is obtained;
[0263] Based on the second score and the weight coefficient of each domain name, a second weighted value of each domain name in the training domain name set is obtained;
[0264] Based on the first weighted value and the second weighted value, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set.
[0265] In other embodiments of the present application, the processor 81 is used to execute the first weighted value and the second weighted value stored in the memory 82 to classify the first domain name and the second domain name to obtain an abnormal domain name set and a suspected poisoned domain name set, and can also implement the following steps:
[0266] Calculate the absolute difference between the first weighted value and the second weighted value of each domain name;
[0267] Determine the domain names whose absolute difference is less than a preset threshold from the training domain name set to generate a set of suspected poisoned domain names;
[0268] Determine a target label for each domain name in the training domain name set based on the first weighted value and the second weighted value of each domain name;
[0269] The domain names whose target labels are different from the original labels are determined from the training domain name set to generate an abnormal domain name set; wherein the original label is the label information of each domain name in the training domain name set.
[0270] In other embodiments of the present application, the processor 81 is used to execute the instructions stored in the memory 82 to compare each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and to label the domain names in the abnormal domain name set and the suspected poisoned domain name set based on the comparison results to generate a domain name set to be compared, and can also implement the following steps:
[0271] Generate a domain name set to be confirmed based on the abnormal domain name set and the suspected poisoned domain name set;
[0272] Each domain name in the domain name set to be confirmed is matched with the third domain name, the fourth domain name and the standard database, and the domain names in the domain name set to be confirmed are labeled based on the matching results to generate a domain name set to be compared.
[0273] In other embodiments of the present application, the processor 81 is used to execute the steps stored in the memory 82 to match each domain name in the domain name set to be confirmed with the third domain name, the fourth domain name and the standard database, and to tag the domain names in the domain name set to be confirmed based on the matching results to generate a domain name set to be compared, and can also implement the following steps:
[0274] Match each domain name in the domain name set to be confirmed with the third domain name and the fourth domain name, and divide the domain names in the domain name set to be confirmed into a first safe domain name, a first poisonous domain name, and an unknown domain name based on the matching result;
[0275] Matching the unknown domain name with the standard database, and determining the second poisoned domain name and the unknown poisoned domain name based on the matching result;
[0276] Based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, the first poisoned domain name and the second poisoned domain name are labeled, and the unknown poisoned domain name is deleted to generate a domain name set to be compared.
[0277] In other embodiments of the present application, the processor 81 is used to execute the domain name set to be compared based on the domain name classifier stored in the memory 82, detect whether there is an abnormality in the domain name classifier, and can also implement the following steps:
[0278] Processing the domain names in the to-be-compared domain name set based on the domain name classifier to generate a pre-processed domain name set; wherein the pre-processed domain name set includes a classified first domain name and a classified second domain name;
[0279] Calculating a first matching degree between the classified first domain name and the first domain name to be compared, and calculating a second matching degree between the classified second domain name and the second domain name to be compared; wherein the domain name set to be compared includes the first domain name to be compared and the second domain name to be compared;
[0280] Based on the first matching degree and the second matching degree, obtaining a target value;
[0281] When the target value is greater than the preset matching value, the detection domain classifier is normal;
[0282] When the target value is less than or equal to the preset matching value, an abnormality is detected in the domain name classifier.
[0283] In other embodiments of the present application, the processor 81 is used to execute the following steps after determining that the domain name classifier is abnormal when the target value is less than or equal to the preset matching value stored in the memory 82:
[0284] The domain name classifier is trained based on the domain name set to be compared to obtain a target classifier.
[0285] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figures 1 to 3 The implementation process of the domain name classifier detection method provided in the corresponding embodiment will not be repeated here.
[0286] The domain name classifier detection device provided in the embodiment of the present application labels normal domain names and malicious domain names by using the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, and processes the domain name set to be compared generated by the labeled domain names based on the domain name classifier to detect whether there is an abnormality in the domain name classification. In this way, it can be accurately determined whether there is an abnormality in the domain name classifier.
[0287] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following. Figures 1 to 3 The corresponding embodiments provide steps of the domain name classifier detection method.
[0288] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0289] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0290] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0291] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0292] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0293] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0294] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0295] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A domain name classifier detection method, characterized in that: The method comprises: Obtain a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name represents a malicious domain name; Acquire a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; the fourth domain name represents a trustworthy malicious domain name; Based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set, the first domain name and the second domain name are classified to obtain an abnormal domain name set and a suspected poisoned domain name set; Compare each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the comparison results to generate a domain name set to be compared; The to-be-compared domain name set is processed based on the domain name classifier to detect whether there is an abnormality in the domain name classifier.
2. The method according to claim 1, characterized in that The first domain name and the second domain name are classified based on the domain name feature of each domain name in the training domain name set and the domain name feature of each domain name in the reference domain name set to obtain an abnormal domain name set and a suspected poisoned domain name set, including: Calculate the value of the domain name feature of each domain name in the training domain name set to obtain a first domain name feature value of each first domain name and each second domain name; Calculate the value of the domain name feature of each domain name in the base domain name set to obtain the second domain name feature value of each of the third domain names and the third domain name feature value of each of the fourth domain names; Get the weight coefficient of the domain name feature; Based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
3. The method according to claim 2, characterized in that The weight coefficient of obtaining the domain name feature includes: Obtaining a first domain name sample from the third domain name, and obtaining a second domain name sample from the fourth domain name; Respectively calculating feature vectors of the first domain name sample and the second domain name sample in a feature space; wherein the feature space has a corresponding relationship with the domain name feature; Based on the feature vector and the random forest model, a weight coefficient of the domain name feature is obtained.
4. The method according to claim 2, characterized in that: The classifying the first domain name and the second domain name based on the first domain name feature value, the second domain name feature value, the third domain name feature value and the weight coefficient to obtain the abnormal domain name set and the suspected poisoned domain name set includes: Calculate the absolute difference between the first domain name feature value and the first mean value to obtain the first absolute value of each domain name in the training domain name set; wherein the first mean value is the mean of the second domain name feature value; Calculate the absolute difference between the first domain name feature value and the second mean value to obtain the second absolute value of each domain name in the training domain name set; wherein the second mean value is the mean value of the third domain name feature value; Based on the first absolute value, the second absolute value, the second domain name feature value, the third domain name feature value and the weight coefficient, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
5. The method according to claim 4, characterized in that The first domain name and the second domain name are classified based on the first absolute value, the second absolute value, the second domain name feature value, the third domain name feature value and the weight coefficient to obtain the abnormal domain name set and the suspected poisoned domain name set, including: Based on the first absolute value, the first mean, the first standard deviation and the first boundary value, a first score of each domain name in the training domain name set is obtained; wherein the first standard deviation is the standard deviation of the second domain name feature value; and the first boundary value is the boundary value of the second domain name feature value; Based on the second absolute value, the second mean, the second standard deviation and the second boundary value, a second score for each domain name in the training domain name set is obtained; wherein the second standard deviation is the standard deviation of the third domain name feature value; and the second boundary value is the boundary value of the third domain name feature value; Based on the first score of each domain name and the weight coefficient, obtaining a first weighted value for each domain name in the training domain name set; Based on the second score of each domain name and the weight coefficient, obtaining a second weighted value for each domain name in the training domain name set; Based on the first weighted value and the second weighted value, the first domain name and the second domain name are classified to obtain the abnormal domain name set and the suspected poisoned domain name set.
6. The method according to claim 5, characterized in that The classifying the first domain name and the second domain name based on the first weighted value and the second weighted value to obtain the abnormal domain name set and the suspected poisoned domain name set includes: Calculating an absolute difference between the first weighted value and the second weighted value of each domain name; Determine the domain names whose absolute difference is less than a preset threshold from the training domain name set, and generate the suspected poisoned domain name set; Determine a target label for each domain name in the training domain name set based on the first weighted value and the second weighted value of each domain name; The domain names whose target labels are different from the original labels are determined from the training domain name set to generate the abnormal domain name set; wherein the original labels are label information of each domain name in the training domain name set.
7. The method according to claim 1, characterized in that The step of comparing each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and labeling the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the comparison results to generate a domain name set to be compared includes: Generate a domain name set to be confirmed based on the abnormal domain name set and the suspected poisoned domain name set; Each domain name in the domain name set to be confirmed is matched with the third domain name, the fourth domain name and the standard database, and the domain names in the domain name set to be confirmed are labeled based on the matching results to generate the domain name set to be compared.
8. The method according to claim 7, characterized in that The step of matching each domain name in the domain name set to be confirmed with the third domain name, the fourth domain name and the standard database, and labeling the domain names in the domain name set to be confirmed based on the matching results to generate the domain name set to be compared includes: Matching each domain name in the to-be-confirmed domain name set with the third domain name and the fourth domain name, and classifying the domain names in the to-be-confirmed domain name set into a first safe domain name, a first poisonous domain name, and an unknown domain name based on the matching result; Matching the unknown domain name with the standard database, and determining the second poisoned domain name and the unknown poisoned domain name based on the matching result; Based on the label information of the first poisoned domain name and the second poisoned domain name in the training domain name set, the first poisoned domain name and the second poisoned domain name are labeled, and the unknown poisoned domain name is deleted to generate the domain name set to be compared.
9. The method according to claim 8, characterized in that The processing of the to-be-compared domain name set based on the domain name classifier and detecting whether the domain name classifier is abnormal includes: Processing the domain names in the to-be-compared domain name set based on the domain name classifier to generate a pre-processed domain name set; wherein the pre-processed domain name set includes a classified first domain name and a classified second domain name; Calculating a first matching degree between the classified first domain name and the first domain name to be compared, and calculating a second matching degree between the classified second domain name and the second domain name to be compared; wherein the domain name set to be compared includes the first domain name to be compared and the second domain name to be compared; Based on the first matching degree and the second matching degree, obtaining a target value; When the target value is greater than a preset matching value, detecting that the domain name classifier is normal; When the target value is less than or equal to the preset matching value, it is detected that an abnormality exists in the domain name classifier.
10. The method according to claim 9, characterized in that In the case where the target value is less than or equal to the preset matching value, after detecting that the domain name classifier is abnormal, the method further includes: The domain name classifier is trained based on the domain name set to be compared to obtain a target classifier.
11. A domain name classifier detection device, characterized in that: The domain name classifier detection device comprises: an acquisition module, a classification module, a generation module and a detection module; The acquisition module is used to acquire a training domain name set; wherein the training domain name set includes a first domain name and a second domain name; the first domain name represents a normal domain name; the second domain name set represents a malicious domain name; The acquisition module is further used to acquire a base domain name set; wherein the base domain name set includes a third domain name and a fourth domain name; the third domain name represents a trustworthy normal domain name; and the fourth domain name represents a trustworthy malicious domain name; The classification module is used to classify the first domain name and the second domain name based on the domain name features of each domain name in the training domain name set and the domain name features of each domain name in the reference domain name set to obtain an abnormal domain name set and a suspected poisoned domain name set; The generating module is used to compare each domain name in the abnormal domain name set and each domain name in the suspected poisoned domain name set with the domain names in the reference domain name set, and label the domain names in the abnormal domain name set and the domain names in the suspected poisoned domain name set based on the comparison result to generate a domain name set to be compared; The detection module is further used to process the to-be-compared domain name set based on the domain name classifier, and detect whether there is an abnormality in the domain name classifier.
12. A domain name classifier detection device, characterized in that: The domain name classifier detection device includes: a processor, a memory and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the program in the memory to implement the domain name classifier detection method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the domain name classifier detection method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Domain name detection method and apparatus, computer device, and storage medium
CN108600200A
DGA domain name detection model construction method, device, server and storage medium
CN109688110A
Method for detecting host infection caused by DGA malicious software
CN111031026A
Learning type DNS analyzer and analysis method thereof
KR1020140035678A
