Method and device for detecting and handling domain name request and electronic equipment

Through the detection model based on frequency domain characteristics and the judgment of the number of requests within the preset period, combined with the release and blocking domain strategies, the problem of insufficient timeliness of DGA domain name detection and disposal in the prior art is solved, and the request for DGA domain name is realized Rapid detection and real-time disposal improve processing efficiency and accuracy.

CN118944979AInactive Publication Date: 2024-11-12CHINA TELECOM CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411345725.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing DGA domain name detection technology cannot detect massive domain name requests in real time, resulting in the continuous normal resolution and response of DGA domain names on the DNS server, and the processing timeliness is insufficient, so timely handling measures cannot be taken.

Method used

Using a detection model based on frequency domain characteristics, the pre-constructed detection model determines whether the domain name request is a DGA domain name, and determines whether to block based on the number of requests made by the source terminal within the preset period, and performs initial screening based on the release domain and blocking domain. and disposal to improve detection and disposal efficiency.

Benefits of technology

It realizes rapid detection and real-time disposal of DGA domain name requests, improves processing timeliness and detection accuracy, and reduces model detection pressure and energy waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944979A_ABST
    Figure CN118944979A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for detecting and handling domain name requests and electronic equipment. The method comprises the following steps: detecting whether a target domain name of a domain name request is a DGA domain name or not by adopting a pre-constructed detection model according to frequency domain characteristics of the domain name request generated by a source end; if the target domain name is not the DGA domain name, releasing the domain name request; if the target domain name is the DGA domain name, determining whether the number of times of requesting the DGA domain name by the source end in a preset period is smaller than a preset value or not; when the number of times that the source end requests the DGA domain name in the preset period is greater than or equal to a preset value, blocking the domain name request; and when the number of times that the source end requests the DGA domain name in the preset period is smaller than a preset value, releasing the domain name request. Based on the method, the detection rate and processing timeliness of the domain name request can be improved, and real-time detection and processing of the domain name request are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network service technology, and in particular to a method, device and electronic device for detecting and handling domain name requests. Background Art

[0002] Currently, DGA (Domain Generation Algorithm) domain names are widely used in modern botnets to generate a large number of random domain names to enhance their concealment and anti-blocking capabilities, posing a new threat to network security. First, DGA enables botnets to communicate with command and control (C&C) servers through constantly changing domain names, thereby bypassing traditional blacklist-based detection methods. Second, DGA may also lead to insufficient timeliness of malware datasets, as malware datasets need to be constantly updated to identify new DGA variants.

[0003] In recent years, DGA domain name detection technology has made significant progress, from relying on manual feature extraction to deep learning model methods that automatically extract features, and new detection models are constantly being proposed to improve detection results. However, existing research on DGA domain names focuses on classification and detection, and there is no research on how to efficiently implement and deal with DGA domain names on DNS servers. As a result, although the DGA domain name detection algorithm works very well, it cannot work in real time. The detection model cannot detect a large number of domain name requests in real time, and the DGA domain names in them can still be resolved and responded to normally on the DNS server. Only after a period of time after the attack using the DGA domain name occurs, the detection model can asynchronously detect the DGA request in the domain name request and take corresponding disposal measures. The model detection pressure is high and the processing timeliness is insufficient. Summary of the invention

[0004] The purpose of this application is to provide a method, device and electronic device for detecting and handling domain name requests, so as to achieve rapid detection and real-time handling of DGA domain name requests.

[0005] In a first aspect, the present application provides a method for detecting and handling domain name requests, the method comprising:

[0006] According to the frequency domain characteristics of the domain name request generated by the source end, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name;

[0007] If the target domain name is not a DGA domain name, the domain name request is released;

[0008] If the target domain name is a DGA domain name, determining whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value;

[0009] When the number of times that the source end requests the DGA domain name within a preset period is greater than or equal to the preset value, the domain name request is blocked.

[0010] The constructed detection model is used to determine whether the domain name request is a DGA domain name based on the frequency domain characteristics of the domain name request. The detection efficiency is faster and real-time detection of domain name requests can be achieved. The decision to release or block the domain name request is based on the number of times the source end requests the DGA domain name within a preset period, which realizes the synchronous detection and real-time processing of domain name requests and improves the processing timeliness.

[0011] In a possible design, the frequency domain characteristics of the domain name request generated by the source end are used to detect whether the target domain name of the domain name request is a DGA domain name using a pre-built detection model, including: determining whether the target domain name of the domain name request generated by the source end exists in a release domain and a blocking domain, wherein a normal domain name is cached in the release domain and a DGA domain name is cached in the blocking domain; when the target domain name exists in the release domain, the domain name request is released; when the target domain name does not exist in the release domain but exists in the blocking domain, the domain name request is blocked; when the target domain name does not exist in both the release domain and the blocking domain, based on the frequency domain characteristics of the domain name request, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name.

[0012] Before using the detection model to detect domain name requests, the release domain and the blocking domain are set to perform preliminary screening on the domain name requests generated by the source end, which improves the efficiency of detecting domain name requests and avoids energy waste.

[0013] In a possible design, after determining whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value, it also includes: reporting the domain name request to an analysis and judgment center, and determining through the analysis and judgment center whether the target domain name of the domain name request is a DGA domain name; when it is determined that the target domain name is not a DGA domain name, adding the target domain name to the release domain; when it is determined that the target domain name is a DGA domain name, adding the target domain name to the blocking domain.

[0014] The research and judgment center will then judge the suspected DGA domain name detected by the detection model, ensuring the rapid detection of domain name requests while improving the accuracy of the detection of domain name requests. And the detected DGA domain name will be added to the blocking domain, so that the DGA domain name can be detected more quickly in the next domain name request, improving the detection efficiency.

[0015] In a possible design, before using a pre-built detection model based on the frequency domain features of the domain name request generated by the source end to detect whether the target domain name of the domain name request is a DGA domain name, the method further includes: obtaining a domain name sample set, wherein the domain name sample set consists of a positive sample set including multiple DGA domain names and a negative sample set including multiple normal domain names; extracting a target string of each sample, and converting each target string into a numerical sequence; performing a frequency domain transformation on each numerical sequence to obtain each frequency domain feature; and performing model training using each frequency domain feature to obtain the detection model.

[0016] In one possible design, the frequency domain transformation of each numerical sequence to obtain each frequency domain feature includes: using a fast Fourier transform (FFT) algorithm to transform each numerical sequence to obtain each complex sequence; respectively extracting the amplitude sequence and phase sequence of each complex sequence, and obtaining the FFT transformation feature sequence corresponding to each complex sequence according to each amplitude sequence and each phase sequence; and using each FFT transformation feature sequence as the frequency domain feature.

[0017] In a second aspect, the present application provides a device for detecting and handling domain name requests, the device comprising:

[0018] A detection module, based on the frequency domain characteristics of the domain name request generated by the source end, uses a pre-built detection model to detect whether the target domain name of the domain name request is a DGA domain name;

[0019] A release module, if the target domain name is not a DGA domain name, releases the domain name request;

[0020] A determination module, if the target domain name is a DGA domain name, determines whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value;

[0021] The blocking module blocks the domain name request when the number of times the source end requests the DGA domain name within a preset period is greater than or equal to the preset value.

[0022] In one possible design, the detection module is specifically used to: determine whether the target domain name of the domain name request generated by the source end exists in a release domain and a blocking domain, wherein a normal domain name is cached in the release domain and a DGA domain name is cached in the blocking domain; when the target domain name exists in the release domain, the domain name request is released; when the target domain name does not exist in the release domain but exists in the blocking domain, the domain name request is blocked; when the target domain name does not exist in both the release domain and the blocking domain, based on the frequency domain characteristics of the domain name request, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name.

[0023] In a possible design, the device is also used to: report the domain name request to an analysis and judgment center, and determine through the analysis and judgment center whether the target domain name of the domain name request is a DGA domain name; when it is determined that the target domain name is not a DGA domain name, add the target domain name to the release domain; when it is determined that the target domain name is a DGA domain name, add the target domain name to the blocking domain.

[0024] In a possible design, the device is also used to: obtain a domain name sample set, wherein the domain name sample set consists of a positive sample set including multiple DGA domain names and a negative sample set including multiple normal domain names; extract a target string of each sample, and convert each target string into a numerical sequence; perform a frequency domain transformation on each numerical sequence to obtain each frequency domain feature; and use the each frequency domain feature to perform model training to obtain the detection model.

[0025] In a possible design, the device is also used to: use a fast Fourier transform (FFT) algorithm to transform each numerical sequence to obtain each complex sequence; respectively extract the amplitude sequence and phase sequence of each complex sequence, and obtain the FFT transformation feature sequence corresponding to each complex sequence according to each amplitude sequence and each phase sequence; and use each FFT transformation feature sequence as the frequency domain features.

[0026] In a third aspect, the present application provides an electronic device, the electronic device comprising:

[0027] Memory, used to store computer programs;

[0028] The processor is used to implement the above-mentioned method steps for detecting and handling domain name requests when executing the computer program stored in the memory.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method steps for detecting and handling domain name requests.

[0030] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flowchart of a method for detecting and handling domain name requests provided by the present application;

[0032] Figure 2A flowchart of a method for constructing a detection model provided in this application;

[0033] Figure 3 A flowchart of an asynchronous processing method provided for this application;

[0034] Figure 4 A schematic diagram of a device for detecting and handling domain name requests provided by the present application;

[0035] Figure 5 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clear, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment.

[0037] In the description of this application, "multiple" is understood to be "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent two situations: A is directly connected to B and A is connected to B through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0038] In order to facilitate those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, the following is a brief description of the professional terms involved:

[0039] DGA (Domain Generation Algorithm) domain name: is an algorithm used by malware to generate a large number of seemingly random domain names for establishing and maintaining communications between controlled hosts in a botnet and command and control servers to evade detection by network security systems.

[0040] Cyber ​​Threat Intelligence Center (CTIC): is an organization dedicated to monitoring, analyzing and responding to cybersecurity threats. It collects information from different channels, including open source information, industry shared information, intelligence provided by government agencies, and threat activities detected by itself, and then uses the accumulated information to help identify and assess potential cybersecurity risks.

[0041] FFT (Fast Fourier Transform): Fast Fourier Transform is an efficient algorithm of Fourier Transform that can quickly calculate the frequency domain representation of a sequence or signal and analyze the proportion of different frequencies. In signal processing, FFT can convert signals in the time domain (or space domain) to the frequency domain.

[0042] See also Figure 1 As shown, it is a flow chart of a method for detecting and handling domain name requests provided by an embodiment of the present application. The specific implementation process of the method is as follows:

[0043] Step 101: Based on the frequency domain characteristics of the domain name request generated by the source end, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name;

[0044] Step 102: If the target domain name is not a DGA domain name, the domain name request is released;

[0045] Step 103: If the target domain name is a DGA domain name, determine whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value;

[0046] Step 104: When the number of times the source end requests the DGA domain name within a preset period is greater than or equal to a preset value, the domain name request is blocked;

[0047] Step 105: When the number of times the source end requests the DGA domain name within a preset period is less than a preset value, the domain name request is released.

[0048] Based on the frequency domain characteristics of domain name requests and the constructed detection model, DGA domain names can be quickly detected. Compared with the existing complex detection algorithms, the screening algorithm based on frequency domain characteristics has lower theoretical complexity and DGA seed independence, higher detection efficiency, and is also convenient for improving the subsequent DGA domain name disposal efficiency.

[0049] In the embodiment of the present application, before using the pre-built detection model to detect whether the target domain name of the domain name request generated by the source end is a DGA domain name, a detection model needs to be built first, see Figure 2 As shown in the figure, it is a schematic diagram of the process of building a detection model. The specific implementation process is as follows:

[0050] Step 201: Obtain a domain name sample set;

[0051] In the embodiment of the present application, the domain name sample set consists of a positive sample set including multiple DGA domain names and a negative sample set including multiple normal domain names.

[0052] For the positive sample set, specifically, obtain the malicious DGA domain names stored in the DGA domain name blacklist from the threat intelligence center, the number of which is N c ; Select N f For each mainstream DGA family, a length of L (L>20) and a number of N are generated. d (N d >N c )'s DGA domain name; the obtained N c Malicious DGA domain names and the N generated by each mainstream DGA family d DGA domain names are taken as positive samples to obtain a positive sample set, and the positive sample can be marked as 1.

[0053] For the negative sample set, specifically, common normal domain names are obtained from public information sources; a pure random generation of length L and number 10000 (N d >N c ) is a string composed of random lowercase letters and numbers; the obtained normal domain name and the generated string are taken as negative samples to obtain a negative sample set, and the negative sample can be marked as 0.

[0054] Combine the positive sample set and the negative sample set to obtain the domain name sample set.

[0055] Step 202: extracting target strings of each sample, and converting each target string into a numerical sequence;

[0056] For each sample in the domain name sample set, preprocessing is first performed, and the preprocessing can be used to extract the target string. Since DGA domain names usually generate longer subdomain strings than normal domain names, it is only necessary to detect the longest level in a multi-level domain name. Therefore, in the embodiment of the present application, the target string can be the longest level in the multi-level domain name. For example, if the domain name is a[.]as23sedde[.]com, the extracted target string is "as23sedde".

[0057] After extracting the target string of each sample, each target string is converted into a numerical sequence, and the converted numerical value can be an ASCII numerical value. For example, the target string is "aabc", and the converted numerical sequence is [97,97,98,99]. After conversion to a numerical sequence, each numerical sequence is aligned to a specified length L, and the specified length L can be set according to actual needs. For example, if FFT is required for subsequent frequency domain conversion, L needs to be an integer power of 2. If the target string length exceeds L, it is truncated, and if the length is less than L, it is padded with 0. Since only lowercase characters and numbers can appear in the domain name, there will be no 0 value, so the original string length information will not be lost during padding, and no additional confusion will be added. The padded numerical sequence can be expressed as x(n), n∈[0,L-1].

[0058] Step 203: Perform frequency domain transformation on each numerical sequence to obtain each frequency domain feature;

[0059] Specifically, the Fast Fourier Transform (FFT) algorithm represented by Cooley-Tukey can be used to transform each numerical sequence to obtain each complex sequence. The specific complex sequence can be expressed as follows:

[0060] X(k)=X R (k)+jX I (k)

[0061] Where k is the frequency index.

[0062] The amplitude sequence and phase sequence of each complex sequence are extracted respectively, and the FFT transform feature sequence corresponding to each complex sequence is obtained according to each amplitude sequence and each phase sequence. Among them, the amplitude sequence A(k) and the phase sequence P(k) are two real number domain sequences. Since x(n) is a real number sequence, according to the properties of Fourier transform, A(k) and P(k) satisfy the following symmetry:

[0063]

[0064] Obviously, only half of each transform sequence contains valid information, so the extracted FFT transform feature sequence F[x(n)] is:

[0065]

[0066] The obtained FFT transformation feature sequences are used as frequency domain features.

[0067] Step 204: Use each frequency domain feature to perform model training to obtain a detection model.

[0068] In the embodiment of the present application, since there are many FFT transform feature sequences, most of which are invalid "frequency bands", which will interfere with the discrimination efficiency and detection accuracy of the detection model, it is necessary to first perform dimensionality reduction processing on each FFT transform feature sequence. Among them, the dimensionality reduction method used includes but is not limited to various feature selection algorithms.

[0069] Specifically, the feature index of the selected feature can be saved as a mask Boolean array MASK with a length of L. The mask Boolean array MASK represents whether the feature at the corresponding position is selected or not. Each FFT transform feature sequence F[x(n)] is reduced in dimension to obtain the result F after feature selection. s [x(n)], specifically expressed as:

[0070] F s[x(n)]=F[x(n)]·diag(MASK)

[0071] Among them, diag(MASK) means converting MASK into a diagonal matrix, where the elements on the diagonal are the values ​​in MASK and the rest of the elements are 0. F[x(n)] is multiplied element by element with the diagonal matrix, and the result is F s [x(n)] then contains only the features in the original matrix selected by MASK.

[0072] Specifically, the above-obtained F s [x(n)] is used as a model training sample for model training. The model selected for model training may include but is not limited to various models that support fuzzy classification, such as random forests. That is, the model can give the probability of judging that the input sample belongs to a positive sample, expressed as P r {F s [x(n)]; 1}. During the model training process, various parameters involved in the model are optimized, and F1-score (standard metric) is used as a scoring criterion to determine the optimal parameter combination of the model. The optimization method of parameter optimization may include but is not limited to grid optimization, Bayesian optimization, and gradient descent algorithms.

[0073] The output of the final trained detection model is classified into two categories, as shown below:

[0074]

[0075] Among them, P TH It is a preset discrimination threshold and can be set according to actual needs.

[0076] The above detection model built based on FFT features can realize rapid detection of domain name requests. Compared with the existing complex detection algorithms, the detection method based on frequency domain features has lower theoretical complexity and DGA seed independence, and can independently set the discrimination threshold to meet the strictness of identifying DGA domain names in different regulatory scenarios.

[0077] After the above detection model is constructed, the operation of step 101 above can be performed.

[0078] Furthermore, in a possible implementation, after receiving the domain name request generated by the source end, before using the detection model to detect the domain name request, the domain name request can also be judged by setting the release domain and the blocking domain, wherein normal domain names are cached in the release domain and DGA domain names are cached in the blocking domain.

[0079] Specifically, after receiving a domain name request generated by the source end, it is determined whether the target domain name of the domain name request exists in the released domain.

[0080] If the target domain name exists in the release domain, the domain name request is released; if the target domain name does not exist in the release domain, it is determined whether the target domain name exists in the blocking domain.

[0081] When the target domain name exists in the blocking threshold, the domain name request is blocked; when the target domain name does not exist in the blocking domain, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name based on the frequency domain characteristics of the domain name request.

[0082] In the embodiment of the present application, the release domain and the blocking domain may be in the form of a cache table to store normal domain names and DGA domain names respectively, and the specific implementation form may include but is not limited to a hash table, various Bloom filters, etc. The release domain and the blocking domain may be set in the pending domain, which is a hash counter used to record the frequency of occurrence of requests and their sources within a certain period of time.

[0083] By setting the release domain and the blocking domain, we can make full use of the known historical judgment information and make a quick judgment on the DGA domain name for the domain name request, so as to reduce the number of calls to the detection model and the number of reports and judgments to the subsequent judgment center, thereby speeding up the disposal process and avoiding energy waste.

[0084] Specifically, the above steps 103 to 105 are synchronous processing, which is to release or block the domain name request according to the number of times the source end requests the DGA domain name within a preset period. The synchronous processing can be set in the pending domain, and the number of times the source end requests the DGA domain name within the preset period is determined by the counting mechanism in the pending domain, and then the processing is performed. In the embodiment of the present application, the calculation expression for judging whether the number of times the source end requests the DGA domain name within the preset period is less than the preset value is as follows:

[0085]

[0086] Among them, T represents the observation period, that is, the preset period, and TH is the set threshold. Parameters TH and T will be updated regularly, and cnt(h) will be cleared every T time to reduce misjudgment. If the above expression is not true, it means that the source end has requested too many suspected DGA domain names during the observation period, and the domain name request will be blocked, but the target domain name will not be added to the blocking domain; if the expression is true, the domain name request will be released first.

[0087] The purpose of setting up synchronous processing is to report domain name requests to the analysis and judgment center. When the analysis and judgment results of the analysis and judgment center cannot be fed back to the local area in a timely manner, the domain name request can be quickly processed locally to achieve real-time detection and real-time processing of domain name requests and improve processing timeliness.

[0088] Furthermore, in a possible implementation, when the detection model detects that the target domain name of the domain name request is a DGA domain name, the domain name request is also processed asynchronously.

[0089] In the examples of this application, see Figure 3 As shown, the specific process of asynchronous processing is as follows:

[0090] Step 301: reporting the domain name request to the judgment center, and determining whether the target domain name of the domain name request is a DGA domain name by the judgment center;

[0091] Specifically, the domain name request information (including the request host, i.e., the source end, the target domain name, etc.) is reported to the analysis center, and the analysis center determines whether the target domain name of the domain name request is a DGA domain name. The analysis center can be a detection agency such as a threat intelligence center.

[0092] It is worth noting that the asynchronous processing can be carried out simultaneously with the synchronous processing, or after the synchronous processing is completed. Therefore, regardless of whether the domain name request is released or blocked after the synchronous processing, the domain name request must be reported to the analysis center.

[0093] Step 302: When it is determined that the target domain name is not a DGA domain name, the target domain name is added to the release domain;

[0094] Step 303: When it is determined that the target domain name is a DGA domain name, the target domain name is added to the blocking domain.

[0095] The domain name requests generated by the source end are reported to the analysis and judgment center for analysis. The detection model can quickly detect the domain name requests, and at the same time, the domain name requests can be accurately analyzed and judged while the real-time processing of the domain name requests can be synchronously handled, thereby improving the accuracy of detecting domain name requests. The target domain name of the domain name request is added to the release domain or the blocking domain based on the detection results, which can facilitate faster processing of the domain name request the next time the same domain name request is received, thereby improving processing timeliness.

[0096] Based on the same inventive concept, the present application also provides a device for detecting and handling domain name requests, which is used to quickly detect and handle domain name requests, solve the problem that the existing detection model cannot detect domain name requests in real time and the processing timeliness is insufficient, and effectively improve the detection efficiency and accuracy of DGA domain names, see Figure 4 , the device comprises:

[0097] The detection module 401 detects whether the target domain name of the domain name request is a DGA domain name according to the frequency domain characteristics of the domain name request generated by the source end and adopts a pre-built detection model;

[0098] The release module 402 releases the domain name request if the target domain name is not a DGA domain name;

[0099] Determination module 403, if the target domain name is a DGA domain name, determines whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value;

[0100] The blocking module 404 blocks the domain name request when the number of times the source end requests the DGA domain name within a preset period is greater than or equal to the preset value.

[0101] In one possible design, the detection module 401 is specifically used to: determine whether the target domain name of the domain name request generated by the source end exists in the release domain and the blocking domain, wherein a normal domain name is cached in the release domain and a DGA domain name is cached in the blocking domain; when the target domain name exists in the release domain, the domain name request is released; when the target domain name does not exist in the release domain but exists in the blocking domain, the domain name request is blocked; when the target domain name does not exist in both the release domain and the blocking domain, based on the frequency domain characteristics of the domain name request, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name.

[0102] In a possible design, the device is also used to: report the domain name request to an analysis and judgment center, and determine through the analysis and judgment center whether the target domain name of the domain name request is a DGA domain name; when it is determined that the target domain name is not a DGA domain name, add the target domain name to the release domain; when it is determined that the target domain name is a DGA domain name, add the target domain name to the blocking domain.

[0103] In a possible design, the device is also used to: obtain a domain name sample set, wherein the domain name sample set consists of a positive sample set including multiple DGA domain names and a negative sample set including multiple normal domain names; extract a target string of each sample, and convert each target string into a numerical sequence; perform a frequency domain transformation on each numerical sequence to obtain each frequency domain feature; and use the each frequency domain feature to perform model training to obtain the detection model.

[0104] In a possible design, the device is also used to: use a fast Fourier transform (FFT) algorithm to transform each numerical sequence to obtain each complex sequence; respectively extract the amplitude sequence and phase sequence of each complex sequence, and obtain the FFT transformation feature sequence corresponding to each complex sequence according to each amplitude sequence and each phase sequence; and use each FFT transformation feature sequence as the frequency domain features.

[0105] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the functions of the aforementioned device for detecting and handling domain name requests, referring to Figure 5 , the electronic device comprises:

[0106] At least one processor 501, and a memory 502 connected to the at least one processor 501. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 In the example, the processor 501 and the memory 502 are connected via a bus 500. The bus 500 is Figure 5 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be called a controller, and there is no limitation on the name.

[0107] In the embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the method for detecting and handling domain name requests discussed above by executing the instructions stored in the memory 502. The processor 501 can implement Figure 4 The functions of each module in the device shown.

[0108] Among them, the processor 501 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 502 and calling data stored in the memory 502, the various functions of the device and processing data, the device can be monitored as a whole.

[0109] In one possible design, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0110] Processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method for detecting and handling domain name requests disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0111] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0112] By programming the processor 501, the code corresponding to the method for detecting and handling domain name requests described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 1The steps of the method for detecting and handling domain name requests in the embodiment shown are as follows: How to design and program the processor 501 is a technique known to those skilled in the art and will not be described in detail here.

[0113] Based on the same inventive concept, an embodiment of the present application further provides a storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer executes the method for detecting and handling domain name requests discussed above.

[0114] In some possible implementations, various aspects of the method for detecting and handling domain name requests provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the method for detecting and handling domain name requests according to various exemplary implementations of the present application described above in this specification.

[0115] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0116] 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.

[0117] 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 including 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.

[0118] 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 The steps for the functions specified in one or more boxes.

[0119] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for detecting and handling domain name requests, characterized in that: The method comprises: According to the frequency domain characteristics of the domain name request generated by the source end, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name; If the target domain name is not a DGA domain name, the domain name request is released; If the target domain name is a DGA domain name, determining whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value; When the number of times that the source end requests the DGA domain name within a preset period is greater than or equal to the preset value, the domain name request is blocked.

2. The method according to claim 1, characterized in that The detecting whether the target domain name of the domain name request is a DGA domain name by using a pre-built detection model according to the frequency domain characteristics of the domain name request generated by the source end includes: Determine whether the target domain name of the domain name request generated by the source end exists in a release domain and a blocking domain, wherein a normal domain name is cached in the release domain and a DGA domain name is cached in the blocking domain; When the target domain name exists in the release domain, the domain name request is released; When the target domain name does not exist in the release domain, but exists in the blocking domain, blocking the domain name request; When the target domain name does not exist in both the release domain and the blocking domain, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name according to the frequency domain characteristics of the domain name request.

3. The method according to claim 1, characterized in that After determining whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value, the method further includes: Report the domain name request to the research and judgment center, and determine whether the target domain name of the domain name request is a DGA domain name through the research and judgment center; When it is determined that the target domain name is not a DGA domain name, adding the target domain name to the release domain; When it is determined that the target domain name is a DGA domain name, the target domain name is added to the blocking domain.

4. The method according to claim 1, characterized in that Before detecting whether the target domain name of the domain name request is a DGA domain name by using a pre-built detection model according to the frequency domain characteristics of the domain name request generated by the source end, the method further includes: Acquire a domain name sample set, wherein the domain name sample set consists of a positive sample set including multiple DGA domain names and a negative sample set including multiple normal domain names; Extract the target string of each sample and convert each target string into a numerical sequence; Perform frequency domain transformation on each numerical sequence to obtain each frequency domain feature; The detection model is obtained by using the frequency domain features to perform model training.

5. The method according to claim 4, characterized in that The frequency domain transformation is performed on each numerical sequence to obtain each frequency domain feature, including: Adopting the fast Fourier transform FFT algorithm, each numerical sequence is transformed to obtain each complex sequence; The amplitude sequence and phase sequence of each complex number sequence are extracted respectively, and the FFT transformation characteristic sequence corresponding to each complex number sequence is obtained according to each amplitude sequence and each phase sequence; Each FFT transformation feature sequence is used as the frequency domain features.

6. A device for detecting and handling domain name requests, characterized in that: The device comprises: A detection module, based on the frequency domain characteristics of the domain name request generated by the source end, uses a pre-built detection model to detect whether the target domain name of the domain name request is a DGA domain name; A release module, if the target domain name is not a DGA domain name, releases the domain name request; A determination module, if the target domain name is a DGA domain name, determines whether the number of times the source end requests the DGA domain name within a preset period is less than a preset value; The blocking module blocks the domain name request when the number of times the source end requests the DGA domain name within a preset period is greater than or equal to the preset value.

7. The device according to claim 6, characterized in that The detection module is specifically used for: Determine whether the target domain name of the domain name request generated by the source end exists in a release domain and a blocking domain, wherein a normal domain name is cached in the release domain and a DGA domain name is cached in the blocking domain; When the target domain name exists in the release domain, the domain name request is released; When the target domain name does not exist in the release domain, but exists in the blocking domain, blocking the domain name request; When the target domain name does not exist in both the release domain and the blocking domain, a pre-built detection model is used to detect whether the target domain name of the domain name request is a DGA domain name according to the frequency domain characteristics of the domain name request.

8. The device according to claim 6, characterized in that The device is also used for: Report the domain name request to the research and judgment center, and determine whether the target domain name of the domain name request is a DGA domain name through the research and judgment center; When it is determined that the target domain name is not a DGA domain name, adding the target domain name to the release domain; When it is determined that the target domain name is a DGA domain name, the target domain name is added to the blocking domain.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method steps of any one of claims 1 to 5 when executing the computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and system of malicious http detection

    CN107483488A

  • System and method for detecting domain generation algorithms

    CN114897127A

  • Malicious DNS traffic detection method and device based on neural network

    CN117834278A

  • DGA domain name detection method and device, electronic equipment and storage medium

    CN118509235A

  • SYSTEM AND METHOD FOR DETECTING DOMAIN GENERATION ALGORITHMS (DGAs) USING DEEP LEARNING AND SIGNAL PROCESSING TECHNIQUES

    US20220245461A1