Method for detecting DGA domain names based on domain name information
By building a domain name dictionary and a deep learning model to generate and classify domain name codes, it solves the problem of low detection accuracy of DGA domain names generated by the dictionary, improves detection accuracy and reduces errors, and achieves efficient identification of DGA domain names.
Patent Information
- Application Number
- CN202210542962.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-18
AI Technical Summary
The DGA domain name generated based on the dictionary in the existing technology has low detection accuracy and large recognition error, making it difficult to effectively identify the C2 server address in the botnet.
By constructing the character dictionary and word dictionary of the domain name, the character encoding, vocabulary encoding and feature encoding are generated. Combined with the deep learning algorithm model, word embedding, LSTM sequence model, Relu layer, Dropout layer and SoftMax layer are used for classification to determine the category of the domain name.
It improves the detection accuracy of DGA domain names generated based on arithmetic and hashing algorithms, and effectively solves the problems of low detection accuracy and large recognition errors of DGA domain names generated based on dictionaries, achieving efficient DGA domain name detection.
Smart Images

Figure CN114970521B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of malicious domain name detection and identification in network security, and in particular to a method for detecting DGA domain names based on domain name information. Background Art
[0002] In botnets, DGA domain names are often used as a means for C2 (Command & Control) control servers to communicate with controlled machines. Therefore, detection of DGA domain names plays an important role in discovering C2 server addresses, cutting off communication between botnets, and protecting network security.
[0003] The DGA generation algorithm based on arithmetic will generate a set of values that can be represented by ASCII code to form a DGA domain name, such as xwzzterdz.com. The DGA generation algorithm based on hashing uses the hexadecimal representation of the hash value to generate the DGA domain name, such as sq42jih5m7rrrsfm8h.cn. The hash algorithms used include MD5, SHA256, etc. The DGA generation algorithm based on dictionary will select words from a proprietary dictionary to combine and generate the DGA domain name, reducing the randomness of the domain name characters and making it more confusing, such as author-operate.com. At present, there are many detection technologies for DGA domain names generated based on arithmetic and DGA domain names generated based on hashing algorithms, but there are fewer detection technologies for DGA domain names generated based on dictionaries, and the detection accuracy is low and the error is large. Summary of the invention
[0004] The present invention aims at the technical problems of low detection accuracy and large recognition error of existing DGA domain names generated based on dictionaries, and provides a method for detecting DGA domain names based on domain name information. The method can efficiently detect DGA domain names, and use domain name information, character encoding, vocabulary encoding, and feature encoding of the domain name as input, and pass them into a deep learning algorithm model to obtain the detection result of the DGA domain name. This method can not only further improve the detection accuracy of DGA domain names generated based on arithmetic and hash algorithms, but also solve the problems of low detection accuracy and large recognition error of DGA domain names generated based on dictionaries.
[0005] To this end, the technical solution of the present invention is a method for detecting a DGA domain name based on domain name information, comprising the following steps:
[0006] Step 1: construct a character dictionary and a word dictionary of the domain name. The character dictionary consists of 37 characters including lowercase letters, numbers, hyphens, etc. The word dictionary is constructed by extracting the second-level domain names of the domain names from the DGA domain names generated based on arithmetic and hash, the DGA domain names generated based on dictionaries, and the non-DGA domain names, segmenting the second-level domain names, and obtaining the segmentation results of the domain names in three categories. The number of occurrences of the words in the segmentation results of the three categories are counted respectively, and they are sorted from high to low. The word dictionary is composed of words selected from the three categories;
[0007] Step 2 obtains the character code, vocabulary code, and feature code of the domain name, encodes the secondary domain name of the domain name according to the character dictionary to obtain the character code of the domain name, encodes the word segmentation result of the domain name according to the word dictionary to obtain the vocabulary code of the domain name, and extracts features from the domain name to form the feature code of the domain name;
[0008] Step 3: Take the character encoding, vocabulary encoding, and feature encoding as the input of the deep learning algorithm model. After multiple operations such as word embedding, LSTM sequence model, Relu layer, Dropout layer, and SoftMax layer, three classifications of the deep learning algorithm model are output. The domain name is judged to which category according to the output results.
[0009] The specific steps to obtain the character encoding, vocabulary encoding, and feature encoding of a domain name are as follows:
[0010] Step 2.1 encodes the secondary domain name of the domain name according to the character dictionary to obtain the character encoding of the domain name;
[0011] Step 2.2 extracts the second-level domain name of the domain name, segments the second-level domain name, and encodes the segmentation result of the domain name according to the word dictionary. If the word in the segmentation is not in the word dictionary, it is replaced by code 0 to obtain the word code of the domain name;
[0012] Step 2.3 calculates the features in the domain name, extracts the features from the domain name to form a feature code of the domain name;
[0013] Step 2.4 The length of the three codes is unified. The length of the vocabulary code is set to 6 bits, the length of the character code is set to 24 bits, and the length of the feature code is 5 bits. For the vocabulary code and the character code, if the code exceeds the specified number of bits, the front of the code is truncated. If the code is less than the specified number of bits, 0 is added to the front of the code to make the number of bits of the code equal to the specified number of bits;
[0014] Step 2.5 performs MinMax normalization on the feature code to eliminate the dimension in the feature code.
[0015] Preferably, the specific steps of constructing the character dictionary and word dictionary of the domain name are as follows:
[0016] Step 1.1: Number the lowercase letters "az", numbers "0-9", hyphen "-", a total of 37 characters, and form a character dictionary;
[0017] Step 1.2 extracts the second-level domain names from the three categories of domain names in the domain name set;
[0018] Step 1.3 After extracting the second-level domain name, segment the second-level domain name to obtain one or more words, and obtain the segmentation results of each domain name in the three categories of domain names;
[0019] Step 1.4 counts the number of occurrences of each word in each category of domain names, sorts the words from high to low according to the number of occurrences, and selects words from the sorting results of the three categories of domain names from high to low to form a word dictionary.
[0020] Preferably, the three categories of domain names in the domain name set are DGA domain names generated based on arithmetic and hash, DGA domain names generated based on a dictionary, and non-DGA domain names.
[0021] Preferably, the features in the domain name include: the length of the domain name, the proportion of domain name segmentation lengths less than 4, the number of domain name segmentation words, the proportion of vowel characters in the domain name, and the average word length after domain name segmentation.
[0022] Preferably, the specific steps of step 3 are as follows:
[0023] Step 3.1: character encoding, vocabulary encoding, and feature encoding are used as three inputs of the deep learning algorithm model, with vocabulary encoding as the first input, character encoding as the second input, and feature encoding as the third input;
[0024] Step 3.2: Use the word embedding algorithm to process the character encoding and vocabulary encoding. For the word embedding of vocabulary encoding, the input is a 6-bit one-dimensional vector and the output is a 6×50 two-dimensional vector. For the word embedding of character encoding, the input is a 24-bit one-dimensional vector and the output is a 24×24 two-dimensional vector.
[0025] Step 3.3: Use the results of word embedding processing of character encoding and vocabulary encoding as the input of two LSTM sequence models. Set the Kernel value of the two LSTMs to 128, and set the Dropout parameter of LSTM to 0.5 to prevent LSTM from overfitting. For vocabulary encoding, the input is a 6×50 two-dimensional vector and the output is a 128-bit one-dimensional vector. For character encoding, the input is a 24×24-bit two-dimensional vector and the output is a 128-bit one-dimensional vector.
[0026] Step 3.4 concatenates the one-dimensional vectors output by the two LSTMs;
[0027] Step 3.5: After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed;
[0028] Step 3.6 concatenates the feature code with the one-dimensional vector in step 3.5;
[0029] Step 3.7: After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed;
[0030] Step 3.8: Pass the one-dimensional vector in step 3.7 into the SoftMax layer, and output it as a one-dimensional vector with a length of 3 bits. Each bit represents each category, namely, DGA domain names generated based on arithmetic and hash algorithms, DGA domain names generated based on dictionaries, and non-DGA domain names. The value of each bit represents the confidence level of belonging to the category.
[0031] Step 3.9 determines which category the domain name belongs to based on the output result of step 3.8.
[0032] The beneficial effect of the present invention is that the method first constructs a character dictionary and a word dictionary of the domain name; secondly, obtains the character encoding, vocabulary encoding, and feature encoding of the domain name; finally, the three encodings are used as the input of the deep learning algorithm model, and after multiple operations such as word embedding, LSTM sequence model, Relu layer, Dropout layer, SoftMax layer, etc., the three classifications of the algorithm model are output (DGA domain name generated based on arithmetic and hash algorithm, DGA domain name generated based on dictionary, non-DGA domain name), and the domain name belongs to which category according to the output result. The method can efficiently detect the DGA domain name, use the domain name information, take the character encoding, vocabulary encoding, and feature encoding of the domain name as input, pass it into the deep learning algorithm model, and obtain the detection result of the DGA domain name. This method can not only further improve the detection accuracy of the DGA domain name generated based on arithmetic and hash algorithm, but also solve the problem of low detection accuracy and large recognition error of the DGA domain name generated based on the dictionary. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of the present invention for detecting a DGA domain name based on domain name information;
[0034] Figure 2 It is a model diagram of the deep learning algorithm in the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described below in conjunction with embodiments.
[0036] Figure 1-Figure 2The invention is an embodiment of a method for detecting a DGA domain name based on domain name information. The method of the invention is as follows: first, a character dictionary and a word dictionary of the domain name are constructed; secondly, the character encoding, the vocabulary encoding and the feature encoding of the domain name are obtained; finally, the three encodings are used as inputs of a deep learning algorithm model, and after multiple operations such as word embedding, LSTM sequence model, Relu layer, Dropout layer and SoftMax layer, three classifications of the algorithm model are output (DGA domain name generated based on arithmetic and hash algorithms, DGA domain name generated based on dictionaries and non-DGA domain name), and the category of the domain name is determined according to the output results.
[0037] like Figure 1 As shown:
[0038] 1. Domain name set: domain name data set for model training, including DGA domain names generated based on arithmetic and hash, DGA domain names generated based on dictionary, and non-DGA domain names;
[0039] 2. Construct a dictionary, including constructing a character dictionary and a word dictionary. The character dictionary consists of 37 characters including lowercase letters, numbers, hyphens, etc. The word dictionary construction process extracts the second-level domain names from the DGA domain names generated based on arithmetic and hash, the DGA domain names generated based on dictionaries, and the non-DGA domain names, and then segment the second-level domain names to obtain the segmentation results of the three categories of domain names. The number of occurrences of the words in the segmentation results of the three categories are counted respectively, and they are sorted from high to low. The word dictionary consists of selecting words from the three categories.
[0040] 3. Domain name encoding, including the character encoding of the domain name, the vocabulary encoding of the domain name, and the feature encoding of the domain name. According to the character dictionary, the character encoding of the domain name is obtained. According to the word dictionary, the vocabulary encoding of the domain name is obtained. In order to solve the problem of low algorithm detection accuracy caused by non-English domain names, some features are extracted from the domain name, including the length of the domain name, the proportion of domain name segmentation lengths less than 4, the number of domain name segmentation, the proportion of domain name vowel characters, and the average word length after domain name segmentation. A total of 5 features constitute the feature encoding of the domain name. The three encodings have a unified encoding length. The length of the vocabulary encoding is set to 6 bits, the length of the character encoding is set to 24 bits, and the length of the feature encoding is 5 bits. For vocabulary encoding and character encoding, if the encoding exceeds the specified number of bits, the front part of the encoding is truncated. If the encoding is less than the specified number of bits, 0 is added to the front part of the encoding to make the number of bits of the encoding equal to the specified number of bits;
[0041] 4. Word embedding processing: Because character encoding and word encoding are both generated based on dictionaries, these two types of encoding belong to categorical variables, so word embedding processing is performed on these two types of encoding to enable the model to better understand the data;
[0042] 5. LSTM-based deep learning algorithm: Use LSTM sequence model to extract features from data. Use Dropout layer to prevent overfitting of algorithm model training, use Relu activation layer to add nonlinear factors, use BatchNormalization for batch normalization, and other operations. Adam optimizer is used to accelerate algorithm model training throughout the deep learning model training process;
[0043] 6. SoftMax three-classification strategy: The last layer of the LSTM deep learning algorithm model is SoftMax three-classification, which includes DGA domain names generated based on arithmetic and hash, DGA domain names generated based on dictionary splicing, and non-DGA domain names.
[0044] like Figure 2 As shown: Model diagram based on LSTM deep learning algorithm:
[0045] 1. Vocabulary encoding: The first input of the algorithm model. The domain name is segmented and then encoded according to the word dictionary. The encoding length is 6 bits.
[0046] 2. Character encoding: The second input of the algorithm model. According to the character dictionary, the character encoding of the domain name is obtained, and the encoding length is 24 bits;
[0047] 3. Feature coding: The third input of the algorithm model. Calculate the five features of the domain name and get the feature coding of the domain name. The coding length is 5 bits;
[0048] 4. Word embedding: There are two types of word embedding. For word embedding of vocabulary encoding, the input is a 6-bit one-dimensional vector and the output is a 6×50 two-dimensional vector. For word embedding of character encoding, the input is a 24-bit one-dimensional vector and the output is a 24×24 two-dimensional vector.
[0049] 5. LSTM: Two types of LSTM, for vocabulary encoding, the input is a 6×50 two-dimensional vector, and the output is a 128-bit one-dimensional vector. For character encoding, the input is a 24×24-bit two-dimensional vector, and the output is a 128-bit one-dimensional vector. During the LSTM training process, the Dropout value is set to 0.5 to prevent overfitting of the training;
[0050] 6. Vector connection layer: The input is two vectors, and the two vectors are concatenated;
[0051] 7.Relu layer: Use the Relu activation function to add nonlinear factors to the training process of the algorithm model to improve the accuracy of the model.
[0052] 8. Batch normalization: The input and output are vectors of the same dimension. Batch normalization improves the convergence of gradients and speeds up model training;
[0053] 9. Dropout layer: The input and output are vectors of the same dimension to prevent overfitting during training;
[0054] 10.SoftMax three-classification: The output is a one-dimensional vector with a length of 3 bits. Each bit represents each category, namely DGA domain names generated based on arithmetic and hash algorithms, DGA domain names generated based on dictionaries, and non-DGA domain names. The value of each bit represents the confidence level of belonging to the category.
[0055] The present invention provides a method for detecting a DGA domain name based on domain name information, which mainly includes the following steps:
[0056] Step 1: Build a character dictionary and a word dictionary for the domain name.
[0057] The character dictionary consists of 37 characters including lowercase letters, numbers, hyphens, etc. The word dictionary construction process extracts the second-level domain names from the DGA domain names generated based on arithmetic and hash, the DGA domain names generated based on dictionaries, and the non-DGA domain names, and then segment the second-level domain names to obtain the segmentation results of the three categories of domain names. The number of occurrences of the words in the segmentation results of the three categories are counted respectively, and they are sorted from high to low. The word dictionary is composed of words selected from the three categories.
[0058] The specific steps for building a character dictionary and a word dictionary for a domain name are as follows:
[0059] Step 1.1: Number the lowercase letters "az", numbers "0-9", hyphen "-", etc., a total of 37 characters, to form a character dictionary;
[0060] Step 1.2 extracts the second-level domain name from the three categories of domain names in the domain name set. The three categories of domain names in the domain name set are DGA domain names generated based on arithmetic and hash, DGA domain names generated based on dictionaries, and non-DGA domain names. Extract the second-level domain name from these three categories of domain names, for example, "author-operate.com", and extract the second-level domain name as "author-operate".
[0061] After extracting the second-level domain name in step 1.3, the second-level domain name is segmented to obtain one or more words, and the segmentation results of each domain name in the three categories are obtained. For example, after segmenting the second-level domain name "author-operate", two words "author, operate" are obtained. Thus, the segmentation results of each domain name in the three categories are obtained.
[0062] Step 1.4 counts the number of occurrences of each word in each category of domain names, sorts the words from high to low according to the number of occurrences, and selects words from the sorting results of the three categories from high to low to form a word dictionary.
[0063] Step 2 obtains the character encoding, vocabulary encoding, and feature encoding of the domain name.
[0064] The secondary domain name of the domain name is encoded according to the character dictionary to obtain the character code of the domain name, the word segmentation result of the domain name is encoded according to the word dictionary to obtain the vocabulary code of the domain name, and features are extracted from the domain name to form a feature code of the domain name.
[0065] The specific steps to obtain the character encoding, vocabulary encoding, and feature encoding of a domain name are as follows:
[0066] Step 2.1 Encode the secondary domain name of the domain name according to the character dictionary to obtain the character encoding of the domain name. For example, for "baidu.com", only "baidu" is encoded to obtain the character encoding of the domain name.
[0067] Step 2.2 extracts the second-level domain name of the domain name, segments the second-level domain name, and encodes the segmentation result of the domain name according to the word dictionary. If the word in the segmentation is not in the word dictionary, it is replaced with code 0 to obtain the vocabulary code of the domain name.
[0068] Step 2.3 calculates the features in the domain name, extracts the features from the domain name to form the feature code of the domain name. The features in the domain name include: the length of the domain name, the proportion of domain name segmentation length less than 4, the number of domain name segmentation, the proportion of domain name vowel characters, and the average word length after domain name segmentation. In order to solve the problem of low algorithm detection accuracy caused by non-English domain names, the above 5 features are extracted from the domain name to form the feature code of the domain name.
[0069] Step 2.4 The three codes are unified in length, the length of the vocabulary code is set to 6 bits, the length of the character code is set to 24 bits, and the length of the feature code is 5 bits. For vocabulary code and character code, if the code exceeds the specified number of bits, the front of the code is truncated. If the code is less than the specified number of bits, 0 is added to the front of the code to make the number of bits of the code equal to the specified number of bits.
[0070] Step 2.5 performs MinMax normalization on the feature encoding.
[0071] Step 3 uses character encoding, vocabulary encoding, and feature encoding as inputs to the deep learning algorithm model. After multiple operations such as word embedding, LSTM sequence model, Relu layer, Dropout layer, and SoftMax layer, the algorithm model is output in three categories (DGA domain names generated based on arithmetic and hash algorithms, DGA domain names generated based on dictionaries, and non-DGA domain names). The domain name is determined to which category it belongs based on the output results. Among them, the LSTM sequence model is used to extract features from the data; the Dropout layer is used to prevent overfitting of the algorithm model training; the Relu activation layer is used to add nonlinear factors; BatchNormalization is used for batch normalization and other operations; the Adam optimizer is used to accelerate the algorithm model training throughout the deep learning model training process. The specific steps are as follows:
[0072] Step 3.1 uses character encoding, vocabulary encoding, and feature encoding as three inputs of the deep learning algorithm model, with vocabulary encoding as the first input, character encoding as the second input, and feature encoding as the third input.
[0073] Step 3.2 uses a word embedding algorithm to process the character encoding and vocabulary encoding. Because the character encoding and vocabulary encoding are generated based on a dictionary, these two encodings belong to categorical variables and are usually processed using One-Hot encoding or a word embedding algorithm. The present invention uses a word embedding algorithm to process these two encodings. For the word embedding of vocabulary encoding, the input is a 6-bit one-dimensional vector and the output is a 6×50 two-dimensional vector. For the word embedding of character encoding, the input is a 24-bit one-dimensional vector and the output is a 24×24 two-dimensional vector.
[0074] Step 3.3: Use the results of word embedding processing of character encoding and vocabulary encoding as the input of two LSTM sequence models, set the Kernel value of the two LSTMs to 128, and set the Dropout parameter of LSTM to 0.5 to prevent LSTM from overfitting. For vocabulary encoding, the input is a 6×50 two-dimensional vector, and the output is a 128-bit one-dimensional vector. For character encoding, the input is a 24×24-bit two-dimensional vector, and the output is a 128-bit one-dimensional vector.
[0075] Step 3.4 concatenates the one-dimensional vectors output by the two LSTMs.
[0076] Step 3.5 After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed. Using the Relu activation function, nonlinear factors are added during the training of the algorithm model to improve the accuracy of the model. The input and output of the Dropout layer are vectors of the same dimension to prevent overfitting during training. Batch normalization, the input and output are vectors of the same dimension. Batch normalization improves the convergence of the gradient and speeds up the training of the model.
[0077] Step 3.6 concatenates the feature encoding with the one-dimensional vector in step 3.5.
[0078] Step 3.7 After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed. Using the Relu activation function, nonlinear factors are added during the training of the algorithm model to improve the accuracy of the model. The input and output of the Dropout layer are vectors of the same dimension to prevent overfitting during training. Batch normalization, the input and output are vectors of the same dimension. Batch normalization improves the convergence of the gradient and speeds up the training of the model.
[0079] Step 3.8 passes the one-dimensional vector in step 3.7 into the SoftMax layer, and outputs a one-dimensional vector of length 3 bits, each bit represents each category, namely DGA domain names generated based on arithmetic and hash algorithms, DGA domain names generated based on dictionaries, and non-DGA domain names. The value of each bit represents the confidence level of belonging to the category.
[0080] Step 3.9 determines which category the domain name belongs to based on the output result of step 3.8. For example, if the classification labels of the hash-based and arithmetic-based DGA domain names in the training set are [1, 0, 0], the classification labels of the dictionary-generated DGA domain names are [0, 1, 0], and the classification labels of the non-DGA domain names are [0, 0, 1], the model output vector is [0.1, 0.8, 0.1]. Since the largest number in the result vector is in the second position and the second position corresponds to the dictionary-generated DGA domain name, the model determines that this domain name is a dictionary-generated DGA domain name.
[0081] However, what is described above is only a specific embodiment of the present invention and should not be used to limit the scope of implementation of the present invention. Therefore, the replacement of equivalent components, or equivalent changes and modifications made according to the scope of protection of the present invention should still fall within the scope covered by the claims of the present invention.
Claims
1. A method for detecting DGA domain names based on domain name information, characterized in that: The following steps are involved: Step 1: construct a character dictionary and a word dictionary of the domain name. The character dictionary consists of 37 characters including lowercase letters, numbers, hyphens, etc. The word dictionary is constructed by extracting the second-level domain names of the domain names from the DGA domain names generated based on arithmetic and hash, the DGA domain names generated based on dictionaries, and the non-DGA domain names, segmenting the second-level domain names, and obtaining the segmentation results of the domain names in three categories. The number of occurrences of the words in the segmentation results of the three categories are counted respectively, and they are sorted from high to low. The word dictionary is composed of words selected from the three categories; Step 2 obtains the character code, vocabulary code, and feature code of the domain name, encodes the secondary domain name of the domain name according to the character dictionary to obtain the character code of the domain name, encodes the word segmentation result of the domain name according to the word dictionary to obtain the vocabulary code of the domain name, and extracts features from the domain name to form the feature code of the domain name; Step 3: Take the character encoding, vocabulary encoding, and feature encoding as the input of the deep learning algorithm model. After multiple operations such as word embedding, LSTM sequence model, Relu layer, Dropout layer, and SoftMax layer, three classifications of the deep learning algorithm model are output. The domain name is judged to which category according to the output results. The specific steps of obtaining the character code, vocabulary code, and feature code of the domain name in step 2 are as follows: Step 2.1 encodes the secondary domain name of the domain name according to the character dictionary to obtain the character encoding of the domain name; Step 2.2 extracts the second-level domain name of the domain name, segments the second-level domain name, and encodes the segmentation result of the domain name according to the word dictionary. If the word in the segmentation is not in the word dictionary, it is replaced by code 0 to obtain the word code of the domain name; Step 2.3 calculates the features in the domain name, extracts features from the domain name to form a feature code of the domain name, and the features in the domain name include the domain name length, the vowel character ratio of the domain name, the number of words after the domain name segmentation, the ratio of the length of the words after the domain name segmentation is less than 4, and the average length of the words after the domain name segmentation; Step 2.4 The length of the three codes is unified. The length of the vocabulary code is set to 6 bits, the length of the character code is set to 24 bits, and the length of the feature code is 5 bits. For the vocabulary code and the character code, if the code exceeds the specified number of bits, the front of the code is truncated. If the code is less than the specified number of bits, 0 is added to the front of the code to make the number of bits of the code equal to the specified number of bits; Step 2.5 performs MinMax normalization on the feature code to eliminate the dimension in the feature code.
2. The method for detecting a DGA domain name based on domain name information according to claim 1, characterized in that: The specific steps of constructing the character dictionary and word dictionary of the domain name are as follows: Step 1.1 Number the lowercase letters "az", numbers "0-9", hyphen "-", a total of 37 characters, and form a character dictionary; Step 1.2 extracts the second-level domain names from the three categories of domain names in the domain name set; Step 1.3 After extracting the second-level domain name, segment the second-level domain name to obtain one or more words, and obtain the segmentation results of each domain name in the three categories of domain names; Step 1.4 counts the number of occurrences of each word in each category of domain names, sorts the words from high to low according to the number of occurrences, and selects words from the sorting results of the three categories of domain names from high to low to form a word dictionary.
3. The method for detecting a DGA domain name based on domain name information according to claim 2, characterized in that: The three categories of domain names in the domain name set in step 1.2 are DGA domain names generated based on arithmetic and hash, DGA domain names generated based on a dictionary, and non-DGA domain names.
4. The method for detecting a DGA domain name based on domain name information according to claim 1, characterized in that: The features of the domain name in step 2.3 include: domain name length, domain name vowel character ratio, number of words after domain name segmentation, ratio of words less than 4 in length after domain name segmentation, and average length of words after domain name segmentation.
5. The method for detecting a DGA domain name based on domain name information according to claim 1, characterized in that: The specific steps of step 3 are as follows: Step 3.1: character encoding, vocabulary encoding, and feature encoding are used as three inputs of the deep learning algorithm model, with vocabulary encoding as the first input, character encoding as the second input, and feature encoding as the third input; Step 3.2: Use the word embedding algorithm to process the character encoding and vocabulary encoding. For the word embedding of vocabulary encoding, the input is a 6-bit one-dimensional vector and the output is a 6×50 two-dimensional vector. For the word embedding of character encoding, the input is a 24-bit one-dimensional vector and the output is a 24×24 two-dimensional vector. Step 3.3: Use the results of word embedding processing of character encoding and vocabulary encoding as the input of two LSTM sequence models. Set the Kernel value of the two LSTMs to 128, and set the Dropout parameter of LSTM to 0.5 to prevent LSTM from overfitting. For vocabulary encoding, the input is a 6×50 two-dimensional vector and the output is a 128-bit one-dimensional vector. For character encoding, the input is a 24×24-bit two-dimensional vector and the output is a 128-bit one-dimensional vector. Step 3.4 concatenates the one-dimensional vectors output by the two LSTMs; Step 3.5: After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed; Step 3.6 concatenates the feature code with the one-dimensional vector in step 3.5; Step 3.7: After the concatenated vector passes through multiple layers of Relu layers and Dropout layers, batch normalization is performed; Step 3.8: The one-dimensional vector in step 3.7 is passed into the SoftMax layer, and the output is a one-dimensional vector with a length of 3 bits, each bit represents each category, namely, DGA domain names generated based on arithmetic and hash algorithms, DGA domain names generated based on dictionaries, and non-DGA domain names, and the value of each bit represents the confidence of belonging to the category; Step 3.9 determines which category the domain name belongs to based on the output result of step 3.8.
Citation Information
Patent Citations
Text hash retrieval method based on deep learning
CN110955745A
DGA domain name detection method and device and computer storage medium
CN113905016A
Embedded DGA representations for botnet analysis
EP3614645A1
System and method for detecting generated domain
US20200059451A1
Device and method for detecting malicious domain names
WO2019228613A1
