Malicious domain name identification method based on multiple types of features

By extracting multi-dimensional features and combining the integrated learning method of base classifiers and meta-classifiers to identify malicious domain names, the problem of low recognition rate of new malicious domain names in the existing technology is solved, and higher recognition accuracy and applicability are achieved.

CN118540076APending Publication Date: 2024-08-23COMP NETWORK INFORMATION CENT CHINESE ACADEMY OF SCI
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310166120.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing technology is not effective in identifying new malicious domain names, especially domain name detection based on English word splicing, and it is difficult to identify malicious domain names with a short survival time, resulting in a low recognition rate.

Method used

Adopt a malicious domain name identification method based on multi-dimensional features, by extracting IP communication flow features, character features, registration-related features and network-related features, combined with base classifiers and meta-classifiers, and use integrated learning methods for classification and identification, including artificial neural networks, Base classifiers such as k-nearest neighbor classifier, random forest classifier and decision tree are used, and the stacking integrated learning method is used to improve detection accuracy.

Benefits of technology

It improves the recognition rate of new malicious domain names, can better characterize the communication behavior of domain names, overcomes the problem of low recognition rate in existing technologies, is suitable for gateway real-time intrusion detection systems, and avoids overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540076A
    Figure CN118540076A
Patent Text Reader

Abstract

The invention belongs to the technical field of malicious domain name detection, and provides a malicious domain name identification method based on multi-class features in order to solve the technical problem that in the prior art, the new malicious domain name identification rate is low, and the method comprises the steps that the multi-class features are extracted from a domain name data set comprising malicious domain names and normal domain names; the similar features are combined into a corresponding training set; the multiple types of features comprise IP communication flow features, and the IP communication flow features reflect communication behaviors of domain names; matching a corresponding base classifier for each type of features, and training each base classifier by adopting a corresponding training set; predicting the corresponding training set by adopting each trained base classifier, and outputting a prediction result; combining prediction results of the base classifiers into a new training set, and training element classifiers; and integrating the trained base classifier and the trained meta classifier into an ensemble learning classifier, and carrying out classification identification on the domain name to be detected by adopting the ensemble learning classifier. The method improves the recognition rate, and reduces the training cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of malicious domain name detection. Background Art

[0002] The Domain Name System protocol is an important part of the Internet. It maps hard-to-remember Internet Protocol addresses to easy-to-remember domain names. A large number of network services rely on domain name services. Since the domain name system does not detect the behavior of the services it relies on, DNS services are abused for various malicious activities: spreading malware, facilitating command and control server communications, sending spam, hosting fraud and phishing pages, etc. It plays a vital role in the malicious behavior of attackers, so it is extremely important to detect malicious domain names.

[0003] Disadvantages of existing technologies: 1. Most studies identify legitimate domain names and fake domain names based on the rules of domain name character features. As new malicious domain name families continue to emerge, the detection effect on domain names composed of English words is not good. As the number of domain names generated by different malicious domain name families is different, there are problems such as too little training data and low recognition rate. 2. Methods based on the characteristics of domain names themselves and historical domain name data are difficult to identify malicious domain names with a short survival time, and the detection effect on new malicious domain names is weak. Summary of the invention

[0004] The purpose of the present invention is to solve the above-mentioned difficulties existing in the prior art, to provide a malicious domain name identification method based on multi-dimensional features, and to solve the technical problem that the prior art has a low recognition rate for new malicious domain names.

[0005] The present invention is implemented by the following technical solution: a method for identifying malicious domain names based on multiple types of features, comprising the following steps:

[0006] Extracting multiple types of features from a domain name data set including malicious domain names and normal domain names, and combining similar features into a corresponding training set; the multiple types of features include IP communication flow features, and the IP communication flow features reflect the communication behavior of the domain name;

[0007] Match the corresponding base classifiers for each type of feature, and use the corresponding training sets to train each base classifier;

[0008] Use each base classifier after training to predict the corresponding training set and output the prediction results;

[0009] The prediction results of each base classifier are combined into a new training set, and the new training set is used to train the meta classifier;

[0010] The trained base classifier and the trained meta classifier are integrated into an ensemble learning classifier, and the ensemble learning classifier is used to classify and identify the domain name to be tested.

[0011] Furthermore, the IP communication flow features are extracted as follows:

[0012] Extract the original communication data packets between the client and the server and save them in datagram storage format;

[0013] The original communication data packets are grouped and the TCP data packets of the IP addresses obtained by resolving the same domain name data are divided into the same traffic group through grouping.

[0014] After restoring the session of the same traffic group, the flow-related features including flow duration, data packet size, packet interval time and port number are extracted.

[0015] Furthermore, session restoration includes combining and time-ordering the TCP traffic packets in the traffic group.

[0016] Further, the duration of the flow is extracted as follows: the time interval between the first TCP packet and the last TCP packet in the flow group is calculated;

[0017] The packet size is extracted as follows: Calculate the expected, standard deviation, and median values ​​of the TCP packet size in the traffic group;

[0018] The packet interval time is extracted as follows: calculating the expected, standard deviation and median values ​​of the interval time between adjacent TCP data packets in the traffic group;

[0019] The port number is extracted as follows: Extract the set of port numbers of each TCP packet in the traffic group.

[0020] Furthermore, the datagram storage format is Pcap format.

[0021] Furthermore, the multiple types of features also include character features, registration-related features, and network-related features.

[0022] Furthermore, the matching relationship between each type of feature and the base classifier is as follows: character features correspond to artificial neural networks, registration-related features correspond to k-nearest neighbor classifiers, network-related features correspond to random forest classifiers, and IP communication flow features correspond to decision trees.

[0023] Furthermore, an LR logistic regression classifier is used as the meta-classifier.

[0024] Furthermore, a stacking ensemble learning method is used to train the meta-classifier.

[0025] Furthermore, a 5-fold cross-validation method was used to train each base classifier.

[0026] Compared with the prior art, the beneficial effects of the present invention include:

[0027] 1. By extracting IP communication flow features (dynamic features), the communication behavior of the domain name can be better characterized. The communication behavior of the domain name can verify whether the domain name actually has attack behavior, rather than just judging by analyzing the surface features of the domain name (static features) as in the prior art. This overcomes the problem of low recognition rate of new malicious domain name families and has better explainability.

[0028] 2. The present invention matches each type of feature with a base classifier suitable for each type of feature, so each base classifier does not need all features, and the training cost is low. In addition, when running in actual situations, base classifiers can be added or deleted according to data characteristics and service quality requirements.

[0029] 3. The present invention selects the best feature combination after combining with IP communication flow features through experimental tests on the science and technology network: IP communication flow features, character features, registration-related features and network-related features. Moreover, these features can be obtained in a short time and are suitable for gateway real-time intrusion detection systems.

[0030] 4. The present invention adopts the Stacking ensemble learning method to combine different heterogeneous base classifiers together, giving full play to the advantages of each base classifier method to obtain better prediction performance.

[0031] 5. The combination of LR logistic regression classifier and stacking ensemble method can avoid overfitting: the prediction results of each base classifier are obtained by weighting. Logistic regression is equivalent to weighting the prediction results of each base classifier to obtain the total prediction result. That is, in order to learn the importance of each base classifier, the base classifier results themselves are not calculated too much. Therefore, overfitting of the base classifier results can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 Schematic diagram of the principle of ensemble learning classifier for malicious domain name classification. DETAILED DESCRIPTION

[0033] Traditional malicious domain name detection methods can only detect through the characteristics of the domain name itself. If a new malicious domain name family is encountered whose characteristics are different from those of the existing domain names, the classifier constructed by the existing malicious domain names will be difficult to identify. The present invention analyzes malicious behavior, that is, IP communication flow characteristics, through the IP resolved by the domain name. The IP communication flow characteristics detect maliciousness by analyzing whether the domain name is actually used to attack, so it has a better detection effect.

[0034] The IP communication flow feature proposed in the present invention is a dynamic feature that can reflect the behavior characteristics of the flow managed by the malicious domain name from the perspective of data flow, and describes what activities exist in the IP resolved by the domain name. The domain name communicates by resolving the IP. By analyzing the IP communication flow feature, it can be confirmed that the domain name does have attack behavior instead of just judging by analyzing the surface characteristics of the domain name.

[0035] The present invention is mainly divided into three steps: feature extraction, malicious domain name classification and identification training, and malicious domain name classification and identification using the trained ensemble learning classifier. The present invention is further described in detail below in conjunction with the accompanying drawings.

[0036] 1) Feature extraction

[0037] Multiple types of features are extracted from a domain name data set including malicious domain names and normal domain names, and similar features are combined into a corresponding training set; the multiple types of features include IP communication flow features, and the IP communication flow features reflect the communication behavior of the domain name.

[0038] Extract IP communication flow features as follows:

[0039] Extract the original communication data packets between the client and the server and save them in a datagram storage format, such as Pcap format;

[0040] The original communication data packets are grouped and the TCP data packets of the IP addresses obtained by resolving the same domain name data are divided into the same traffic group through grouping.

[0041] After restoring the progressive session of the same traffic group, the flow-related features including flow duration, packet size, packet interval time and port number are extracted. First of all, these three features are easy to calculate and obtain, and are efficient in actual scenarios. Secondly, the port represents a computer-specific service and reflects the intention of the communicating party; the duration and interval time reflect the frequency of network packet sending and receiving of the communicating party; the packet size reflects the specific content of the communication between the communicating parties. Although these are coarse-grained features, they can simply and effectively describe communication behavior. There is also a difference between benign and large-scale attack (such as DDoS, botnet) traffic. In addition, combining such features can also make the entire model more interpretable.

[0042] The duration of the flow is extracted as follows: the time interval between the first TCP packet and the last TCP packet in the flow group is calculated;

[0043] The packet size is extracted as follows: Calculate the expected, standard deviation, and median values ​​of the TCP packet size in the traffic group;

[0044] The packet interval time is extracted as follows: Calculate the expected, standard deviation and median values ​​of the interval time between adjacent TCP packets in the traffic group

[0045] The port number is extracted as follows: extract the port number of each TCP packet in the traffic group and form a port number set, using onehot encoding. Here, we need to extract a group of ports in the traffic data to form a set. Onehot encoding is used for the port number set. Advantages: simple and fast. Because the port number itself has no meaning, the port number represents the use of a certain type of service, such as port 80 or port 443 may be http-related services. And there is no concept of distance between numbers, such as the difference between 80 and 443 numbers themselves cannot reflect the difference in representative meaning. Therefore, onehot encoding representing the category is used.

[0046] In order to further improve the detection accuracy, the multiple features also include character features, registration-related features and network-related features. The extraction methods of these features belong to the existing technology and will not be repeated here.

[0047] (1) Character characteristics of the domain name, including:

[0048] a) Domain name length: The domain name string removes the string length of the top-level domain name. After calculating the length of all domain names, they are normalized and the ratio of each domain name length to the maximum domain name length is calculated.

[0049] b) The ratio of digits in the domain name: the ratio of the number of digits in the domain name to the length of the domain name

[0050] c) Randomness: Calculate the frequency of each character in the domain name and use it to calculate the information entropy

[0051] d) The ratio of the longest meaningful string length: Calculate the ratio of the longest continuous word pair length in the domain name to the entire domain name string length

[0052] e) Trigrams in domain names: 3-grams are extracted through natural language processing technology, that is, a sliding window operation with a length of 3 is performed on the string, and the string of each window is extracted and added to the dictionary. Finally, the dictionary is one-hot encoded

[0053] f) Edit distance to known malicious domain names: Edit distance is the number of times a string is edited to another string. There are three types of edit operations: change, add, and delete. Then calculate the ratio of each edit distance to the maximum edit distance.

[0054] (2) Registration-related features: Attackers often register malicious domain names in batches to evade blacklist detection, so malicious domain names have relevant features in registration information entropy.

[0055] a) Registration Country Code: The country code where the domain name is registered.

[0056] b) Domain name registrar: the name of the business that registered the domain name, such as: Alibaba Cloud Computing Ltd

[0057] c) Domain name registration individual: the name of the domain name registration individual or enterprise

[0058] d) Domain name server: the authoritative name server used to resolve the domain name

[0059] e)Whois server information: Whois server used for domain name registration

[0060] f) Registration Date: The date the domain name was registered

[0061] g) Expiration Date: The date the domain name expires

[0062] The information of categories a to e is encoded using onehot encoding, and the date types f and g are further calculated into six features: year, month, day, hour, minute, and second.

[0063] (3) Network-related characteristics: Benign domain names will frequently update network information such as IP to ensure service availability, while malicious domain names provide relatively little network information.

[0064] a) ip: the number of ips obtained by reverse analysis of the domain name, the number of times the ip has changed, and whether the ip appears in the blacklist

[0065] b) SOA information: specifically includes the refresh time of the domain name, the re-request time, the TTL of the domain name request, etc. The time type further calculates six characteristics: year, month, day, hour, minute, and second. The TTL information is calculated in the range of [0,1), [1,10), [10,100), [100,300), [300,900), the number of times the TTL changes, the number of different TTL values, and the average value of the TTL records.

[0066] c)cname information: the number of aliases needs to be calculated

[0067] d)mx information: including the domain name's mail exchange server address, etc., to calculate whether the address appears in the blacklist

[0068] 2) Malicious domain name classification and identification training

[0069] Match the corresponding base classifiers for each type of feature, and use the corresponding training sets to train each base classifier; use each trained base classifier to predict the corresponding training set and output the prediction results; form a new training set with the prediction results of each base classifier, and use the new training set to train the meta classifier.

[0070] An integrated learning method is adopted to form an overall model through multiple base classifier models. Integrated learning is mainly divided into bagging, boosting and stacking. The present invention uses the stacking integrated learning method. The main process is to predict the entire training set with all the trained base classifiers, and the predicted value of the j-th base classifier for the ith training sample will be used as the j-th eigenvalue of the ith sample in the new training set. For example, for each base classifier, each batch size is n, and the number of categories is 2, then the base classifier generates an n*2 matrix, and the base classifier has 4 models, which will be combined to generate features of size 4*n*2.

[0071] Finally, training is performed based on the new training set. At the same time, the prediction process must first be carried out through the prediction of all base classifiers to form a test set, and finally the test set is predicted to verify the training effect.

[0072] Four base classifiers were used, and each base classifier was trained using all the data in the training set except the test set. The first base classifier uses an artificial neural network, and the selected features are character features. The neural network has strong learning ability and can learn features in the string that are not easy to manually distinguish. The second model uses the k nearest neighbor classifier and selects registration-related features. KNN can measure the similarity between malicious domain names by calculating the distance between different feature values ​​for classification. The algorithm is efficient and does not need to be retrained when new data is added. The third model uses the random forest classifier and selects network-related features. Since network data often has missing values, the random forest method has strong anti-interference ability and can maintain high accuracy in the presence of missing features. The fourth model uses the C4.5 decision tree and selects flow-related features. The decision tree method is easier to understand and explain. Finally, the results of the base classifier are predicted by the LR logistic regression classifier to obtain the final result.

[0073] During training, the domain name data is divided into 5-fold cross validation methods, with 4 parts as training sets and the remaining 1 part as validation set. The training set is formed into a new training set through the prediction results of each base classifier and then the final result is obtained through the LR logistic regression classifier.

[0074] 3) Classification and identification of malicious domain names

[0075] The trained base classifier and the trained meta classifier are integrated into an ensemble learning classifier, and the ensemble learning classifier is used to classify and identify the domain name to be tested.

[0076] After the model is trained offline, it can be deployed online to achieve real-time detection. The results can be obtained after the domain name data is input into the detection system. At the same time, the model is regularly updated according to the new domain name data.

[0077] The above technical solution is only one implementation mode of the present invention. For those skilled in the art, it is easy to make various types of improvements or modifications based on the principles disclosed in the present invention, and it is not limited to the technical solution described in the above specific embodiments of the present invention. Therefore, the above description is only preferred and does not have a restrictive meaning.

Claims

1. A method for identifying malicious domain names based on multiple features. It is characterized in that The steps include: Extracting multiple types of features from a domain name data set including malicious domain names and normal domain names, and combining similar features into a corresponding training set; the multiple types of features include IP communication flow features, and the IP communication flow features reflect the communication behavior of the domain name; Match the corresponding base classifiers for each type of feature, and use the corresponding training sets to train each base classifier; Use each base classifier after training to predict the corresponding training set and output the prediction results; The prediction results of each base classifier are combined into a new training set, and the new training set is used to train the meta classifier; The trained base classifier and the trained meta classifier are integrated into an ensemble learning classifier, and the ensemble learning classifier is used to classify and identify the domain name to be tested.

2. According to the method for identifying malicious domain names based on multiple features in claim 1, It is characterized in that Extract IP communication flow features as follows: Extract the original communication data packets between the client and the server and save them in datagram storage format; The original communication data packets are grouped and the TCP data packets of the IP addresses obtained by resolving the same domain name data are divided into the same traffic group through grouping. After restoring the session of the same traffic group, the flow-related features including flow duration, data packet size, packet interval time and port number are extracted.

3. According to the method for identifying malicious domain names based on multiple features as described in claim 2, It is characterized in that Session restoration involves combining and time-ordering TCP traffic packets in a traffic group.

4. According to claim 2, the method for identifying malicious domain names based on multiple features, It is characterized in that The duration of the flow is extracted as follows: the time interval between the first TCP packet and the last TCP packet in the flow group is calculated; The packet size is extracted as follows: Calculate the expected, standard deviation, and median values ​​of the TCP packet size in the traffic group; The packet interval time is extracted as follows: calculating the expected, standard deviation and median values ​​of the interval time between adjacent TCP data packets in the traffic group; The port number is extracted as follows: Extract the set of port numbers of each TCP packet in the traffic group.

5. According to claim 2, the method for identifying malicious domain names based on multiple features, It is characterized in that The datagram storage format is Pcap format.

6. The method for identifying malicious domain names based on multiple features according to claim 1, It is characterized in that The multiple types of features also include character features, registration-related features, and network-related features.

7. The method for identifying malicious domain names based on multiple features according to claim 6, It is characterized in that The matching relationship between each type of feature and the base classifier is as follows: character features correspond to artificial neural networks, registration-related features correspond to k-nearest neighbor classifiers, network-related features correspond to random forest classifiers, and IP communication flow features correspond to decision trees.

8. The method for identifying malicious domain names based on multiple features according to claim 1, It is characterized in that The LR logistic regression classifier is used as the meta-classifier.

9. The method for identifying malicious domain names based on multiple features according to claim 1 or 8, It is characterized in that The meta-classifier is trained using a stacking ensemble learning method.

10. The method for identifying malicious domain names based on multiple features according to claim 1, It is characterized in that A 5-fold cross-validation method was used to train each base classifier.

Citation Information

Cited By

  • Domain name security detection method based on multi-dimensional data association analysis

    CN119966730A