Embodiment
In order to make technical scheme of the present invention and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to the present invention to be described, is not intended to limit the present invention.
The present inventor, when the problem of the attack of the personation packet for DNS existing in the face of prior art, analyzes the type of attacking, and finds that the source IP address of the request that a lot of assailants send is palmed off.Utilize this feature, can send in local recurrence name server (Local Recursive Name Server) side direction the client transmission voucher of the source IP address of request, at client-side, generate the request of carrying voucher, in local recurrence name server side, the voucher carrying in asking is judged, if correct voucher is carried in request, continue to process this request; If wrong voucher is carried in request, abandon request.Like this, attack for the personation source IP address of DNS is just controlled effectively in local recurrence name server side, avoid attacking the even authoritative name server of recurrence name server (Authoritative Name Server) that threatens other, thereby avoided attacking infringement and the paralysis that causes the whole network.
Introduce DNS system and basic operation principle thereof below.
Fig. 1 is the schematic diagram of DNS system.As shown in Figure 1, DNS system generally includes resolver (Resolver), local recurrence name server and authoritative name server.
Normally, local recurrence name server and authoritative name server logically form large portion or the integral body of domain name service, therefore can respectively or be collectively referred to as name server (NS).Resolver can obtain the information in order to the request of customer in response end from name server.
In one embodiment, resolver can be accessed at least one local recurrence name server, and directly answers by the information of local recurrence name server the inquiry request that client is sent.Or the inquiry request that resolver can send client by local recurrence name server is transferred to authoritative name server and carries out recursive query.Particularly, if local recurrence name server can be found the respective record for inquiry request in local buffer memory (cache), directly to resolver, send response; If there is no respective record in the cache of local recurrence name server, the mode of enabling recursive query is transferred to authoritative name server, and to resolver, sends response by authoritative name server.
Resolver can be the program that the user program of a client can directly be accessed, and is preferably system program.Normally, user program is invoke resolver directly, therefore generally between resolver and user program without any specific session protocol.
Local recurrence name server (LRS), both can dispose on the internet and shared by popular institute, can be also to arrange specially for a tissue.Local recurrence name server has two main functions.First, it can serve recursive query.When LRS will answer an inquiry request, if LRS can reply, directly reply this inquiry request, if LRS can not directly reply this inquiry request, can send one or more iteration requests to carry out recursive query to a plurality of authoritative name servers (ANS).Secondly, the answer that local recurrence name server can buffer memory returns from authoritative name server, and only have and while there is no answer in its buffer memory, just inquire authoritative name server.
Authority's name server is a kind of database of safeguarding title and address mapping.Authority's name server is tree structure in store and territory the information relevant with tree structure configuration information conventionally.Authority's name server carries out buffer memory by the structure of any part in the tree in territory or tree structure configuration information, but a common specific authoritative name server is preserved the complete information of a particular subset of domain space, and the pointer that points to other name servers, be used for from other part acquired informations of territory tree.Authority's name server is known the complete information of this part territory tree, and authoritative name server is authority for these parts.
With the example that is treated to resource record (RR) inquiry, introduce the handling process of DNS system below.RR is the resource record in ANS database, can comprise polytype, such as A record, NS record, MX record, etc.
Fig. 2 is the handling process of DNS system to resource record inquiry.In Fig. 2, show the example of three authoritative name servers, three authoritative name servers are respectively root ANS, com territory ANS and ms.com territory ANS.
Exemplarily:
The requirement of client application is answered in resolver expectation, resolves the address of www.ms.com.Resolver sends inquiry request by message 1 to local recurrence name server; Local recurrence name server sends inquiry request by message 2 to root ANS; Root ANS is used name server (NS) record and address (A) record, returns to title and the IP address of com territory ANS in message 3; Local recurrence name server is by message 4 inquiry com territory ANS; Com territory ANS returns to title and the IP address of ms.com territory ANS in message 5; Local recurrence name server sends inquiry request by message 6 to the ANS in ms.com territory; The ANS in ms.com territory returns to the IP address of www.ms.com in message 7; Local recurrence name server returns to the IP address of www.ms.com to resolver by message 8.
In said process, root ANS and com territory ANS only provide the information of switching, and the NS of the authoritative name server in next stage territory records and A record, and ms.com territory ANS provides final authoritative answer.
Below in conjunction with specific embodiment, the present invention will be described in detail.
Above-mentionedly with concrete parse addresses and DNS system architecture, resource request query processing process has been carried out to exemplary illustrated.It will be appreciated by those of skill in the art that this restriction explanation is only used for purposes of illustration, and be not used in embodiment of the present invention is carried out to any restriction.
Embodiment mono-
Fig. 3 is that the minimizing of the embodiment of the present invention one is for the structure chart of the device of the attack of DNS.This device is positioned at the local recurrence name server side of DNS system.As can be seen from Figure 3, this device comprises request reception unit 301, voucher generation unit 302 and requesting processing 303.The request that the resolver that request reception unit 301 receives client is sent, is forwarded to requesting processing 303 by the request of carrying voucher, and the request of not carrying voucher is forwarded to voucher generation unit 302; Voucher generation unit 302 generates voucher for carrying the request of voucher, to the source IP address transmission voucher of request, and stores the voucher generating; Whether the voucher carrying in the request that requesting processing 303 receives according to the voucher judgement of this locality storage is correct, and the request that then correct voucher is carried in forwarding, to local recurrence name server, abandons the request of carrying wrong voucher.
Voucher generation unit 302 can adopt multiple for request generates the mode of voucher, for example, according to one or more in the sign of the packet of requestor's sign of the first request, request content, carrying request and random number, is that the first request generates voucher.
Particularly, when identifying generation voucher according to the requestor of the first request, requestor identifies specifically can comprise requestor IP address or requestor Email address etc.When generating voucher according to request content, can the self attributes based on request content generate voucher, such as when request content is URL, can be using this URL as voucher; When generating voucher according to the sign of the packet of carrying request, the sign of the packet of carrying request specifically can comprise No. ID, sequence number of packet, etc.When according to one or more generation voucher in random number, can determine one or more random number based on various random algorithms, using as voucher.
Exemplarily, in embodiment of the present invention, the concrete manifestation form of voucher can be token.
Further, the quantity of the request of the same resource record that requesting processing 303 is also can record queries failure response corresponding, the number of request of the same resource record that inquiry failure response within the scheduled time is corresponding reaches a predefined threshold value, here claim first threshold, requesting processing 303 abandons the follow-up request of sending for this resource record.
Requesting processing 303 record be generally the quantity of the request of the same resource record that the inquiry failed message that returns of authoritative name server is corresponding.Such as, if the request that source IP address sends for be the inquiry request of non-existent resource record, local recurrence name server can receive the inquiry failed message that name server returns, when inquiring about the request quantity of the same resource record that failure response is corresponding, reach a degree, reach first threshold, illustrate and probably occurred attack, assailant attacks DNS by the inquiry request for non-existent resource record.Now, in requesting processing 303, block this resource record, can avoid more attack to enter network system.In general block a certain resource record and no longer process the subsequent request of sending for this resource record, can directly abandon the subsequent request of sending for this resource record.
Further, requesting processing 303 also can record the quantity from the request of same source IP address, the request from same source IP address within the scheduled time reaches a predefined threshold value, reach Second Threshold, requesting processing 303 abandons the follow-up request that this source IP address is sent.
Second Threshold be requesting processing 303 oneself record for same source IP address, within a period of time, send the maximum permissible value of the quantity of request.Generally, a source IP address sends a large amount of requests, is likely assailant's behavior.A large amount of requests can cause the congested of network, and especially local recurrence name server need to be to the situation of authoritative name server inquiry, more easily causes larger congested.When the quantity that a certain source IP address sends request in the given time reaches some, the source IP address of request is sent in blockade, abandons the follow-up request that this source IP address is sent, and can avoid attacking more entering network system.
The quantity of the above request that same resource record corresponding to first threshold control inquiry response failure is set, with Second Threshold is set controls a source IP address and send a large amount of requests, can in requesting processing 303, realize respectively, also can in requesting processing 303, realize simultaneously.Under different situations and demand, can do flexibly and arrange.
Embodiment bis-
Fig. 4 be the minimizing of the embodiment of the present invention two for the structure chart of the device of the attack of DNS, this device is positioned at the client-side of DNS system.As can be seen from Figure 4, this device comprises request transmitting unit 401, voucher receiving element 402 and request retransmission unit 403.Wherein, request transmitting unit 401, for sending request to local recurrence name server side; Voucher receiving element 402, for receiving the voucher by local recurrence name server adnation one-tenth; Request retransmission unit 403, for described voucher is carried to request, and resends local recurrence name server side by the request that carries described voucher.
Embodiment tri-
Fig. 5 is that the minimizing of the embodiment of the present invention three is for the system construction drawing of the attack of DNS.The minimizing of the present embodiment comprises resolver 501, server side checkout gear 502 and local recurrence name server 503 for the system of the attack of DNS.Server side checkout gear 502 can adopt the device of embodiment mono-.
In the system of the present embodiment, server side checkout gear 502 receives the first request that resolver 501 sends, if voucher is not carried in judgement the first request, is that the first request generates voucher, store this voucher, and send voucher to the resolver 501 of sending the source IP address of the first request; Resolver 501 receives after voucher, generates first request of carrying voucher, and resends to local recurrence name server 503 voucher the first request that carries; Server side checkout gear 502 receives the first request that carries voucher that resolver 501 resends, if carry correct voucher in judgement the first request, first request that forwards is to local recurrence name server 503; If carry wrong voucher in judgement the first request, abandon the first request.
Server side checkout gear 502 can adopt the multiple mode for request generation voucher, for example, according to one or more in the sign of the packet of requestor's sign of the first request, request content, carrying request and random number, be that the first request generates voucher.Particularly, when identifying generation voucher according to the requestor of the first request, requestor identifies specifically can comprise requestor IP address or requestor Email address etc.When generating voucher according to request content, can the self attributes based on request content generate voucher, such as when request content is URL, can be using this URL as voucher; When generating voucher according to the sign of the packet of carrying request, the sign of the packet of carrying request specifically can comprise No. ID, sequence number of packet, etc.When according to one or more generation voucher in random number, can determine one or more random number based on various random algorithms, using as voucher.Exemplarily, the concrete form of implementation of voucher can be token.
Further, the quantity of the request of the same resource record that server side checkout gear 502 is also can record queries failure response corresponding, the number of request of the same resource record that inquiry failure response within the scheduled time is corresponding reaches a predefined threshold value, here claim first threshold, server side checkout gear 502 abandons the follow-up request of sending for this resource record.
Further, server side checkout gear 502 also can record the quantity from the request of same source IP address, the request from same source IP address within the scheduled time reaches a predefined threshold value, reach Second Threshold, server side checkout gear 502 abandons the follow-up request that this source IP address is sent.
The quantity of the above request that same resource record corresponding to first threshold control inquiry response failure is set, with Second Threshold is set controls a source IP address and send a large amount of requests, can in server side checkout gear 502, realize respectively, also can in server side checkout gear 502, realize simultaneously.Under different situations and demand, can do flexibly and arrange.
Embodiment tetra-
Fig. 6 is that the minimizing of the embodiment of the present invention four is for the system construction drawing of the attack of DNS.The minimizing of the present embodiment comprises resolver 601, client-side checkout gear 602, server side checkout gear 603 and local recurrence name server 604 for the system of the attack of DNS.Server side checkout gear 603 can adopt the device of embodiment mono-, and client-side checkout gear 602 can adopt the device of embodiment bis-.
In the system of the present embodiment, the first request that client-side checkout gear 602 sends to local recurrence name server 604 transparent transmission resolvers 601; Server side checkout gear 603 receives the first request that client-side checkout gear 602 sends, if voucher is not carried in the first request, generates voucher, stores this voucher, and sends voucher to the resolver 601 of sending the source IP address of the first request; Client-side checkout gear 602 receives after voucher, generates first request of carrying voucher, and resends to local recurrence name server 604 the first request that carries voucher; Server side checkout gear 603 receives the first request that carries voucher that client-side checkout gear 602 resends, if carry correct voucher in judgement the first request, first request that forwards is to local recurrence name server 604; If carry wrong voucher in judgement the first request, abandon the first request.
Server side checkout gear 603 can adopt the multiple mode for request generation voucher, for example, according to one or more in the sign of the packet of requestor's sign of the first request, request content, carrying request and random number, be that the first request generates voucher.
Further, the quantity of the request of the same resource record that server side checkout gear 603 is also can record queries failure response corresponding, the number of request of the same resource record that inquiry failure response within the scheduled time is corresponding reaches a predefined threshold value, here claim first threshold, server side checkout gear 603 abandons the follow-up request of sending for this resource record.
Further, server side checkout gear 603 also can record the quantity from the request of same source IP address, the request from same source IP address within the scheduled time reaches a predefined threshold value, reach Second Threshold, server side checkout gear 603 abandons the follow-up request that this source IP address is sent.
The quantity of the above request that same resource record corresponding to first threshold control inquiry response failure is set, with Second Threshold is set controls a source IP address and send a large amount of requests, can in server side checkout gear 603, realize respectively, also can in server side checkout gear 603, realize simultaneously.Under different situations and demand, can do flexibly and arrange.
Compare with embodiment tri-, embodiment tetra-has all arranged checkout gear at client-side and local recurrence name server side, without the standard to existing DNS, changes.
Embodiment five
Fig. 7 is that the minimizing of the embodiment of the present invention six is for the method flow diagram of the attack of DNS.As shown in Figure 7, the method for the present embodiment comprises the steps:
In step 701, local recurrence name server receives after first request of not carrying voucher that resolver sends, and is that the first request generates voucher, stores this voucher, and sends voucher to the resolver of the source IP address of the first request;
Can adopt multiplely for request generates the mode of voucher, for example, be that the first request generates voucher according to one or more in the sign of the packet of requestor's sign of the first request, request content, carrying request and random number.
In step 702, resolver receives after voucher, generates first request of carrying voucher, and resends the first request to local recurrence name server;
In step 703, local recurrence name server receives the first request that carries voucher resending, if carry correct voucher in judgement the first request, continues the first request to process; If carry wrong voucher in the first request, abandon the first request.
Further, the method for the present embodiment also comprises:
First threshold is set;
Local recurrence name server records the quantity of the request of the same resource record that failed inquiry response is corresponding;
The number of request of the same resource record that the inquiry response of the failure within the scheduled time is corresponding reaches first threshold, and local recurrence name server abandons the subsequent request of sending for this resource record.
Further, the method for the present embodiment also comprises:
Second Threshold is set;
Local recurrence name server record is from the quantity of the request of same source IP address;
The number of request from same source IP address within the scheduled time reaches Second Threshold, and local recurrence name server abandons the subsequent request that this source IP address is sent.
Based on above-mentioned labor, embodiment of the present invention has also proposed a kind of minimizing for the system of the attack of DNS, and this system comprises client-side and local recurrence name server side, wherein:
Client-side, for send first request of not carrying voucher to local recurrence name server side, receive the voucher that local recurrence name server side generates for this first request, and resend to local recurrence name server side the first request that carries this voucher;
Local recurrence name server side, first request of not carrying voucher sending for receiving client-side, to the source IP address transmission voucher of this first request, and receives the first request that carries voucher being resend by client-side; If carry correct voucher in this first request resending, the first request that continues this to resend is processed, if carry wrong voucher in this first request resending, abandons the first request that this resends.
Preferably, in embodiment of the present invention, the concrete manifestation form of voucher can be token.
Based on foregoing detailed description, embodiment of the present invention can be stored in machine readable media the mode by instruction or instruction set.These computer-readable recording mediums include, but are not limited to: floppy disk, CD, DVD, hard disk, flash memory, USB flash disk, CF card, SD card, mmc card, SM card, memory stick (Memory Stick), xD card etc.In addition, embodiment of the present invention can also be stored in the storage medium based on flash memory (Nand flash) mode by instruction or instruction set, such as USB flash disk, CF card, SD card, SDHC card, mmc card, SM card, memory stick, xD card etc.
In fact, can specifically implement embodiment of the present invention by various ways.Such as, can follow the application programming interfaces of certain standard, embodiment of the present invention is written as to the computer program being stored in local storage medium, also can be encapsulated as web application and be used for downloading.
It should be noted that, in above-mentioned each flow process and each structural representation, be not all step and modules be all necessary, can ignore according to the actual needs some step or module.The execution sequence of each step is not fixed, and can adjust as required.The system configuration of describing in the various embodiments described above can be physical structure, can be also logical construction,, some module may be realized by Same Physical entity, or some module may be divided by a plurality of physical entities and realized, or, can jointly realize by some parts in a plurality of autonomous devices.
In addition, be noted that, the program code that not only can read by object computer, and the operating system that can make by the instruction based on program code to calculate hands-operation etc. completes practical operation partly or completely, thereby realize the function of any one embodiment in above-described embodiment.
In addition, be understandable that, the program code of being read by storage medium write in memory set in the expansion board of inserting in computer or write in the memory arranging in the expanding element being connected with computer, instruction based on program code subsequently makes to be arranged on the CPU on expansion board or expanding element etc. and comes operating part and all practical operations, thereby realizes the function of above-mentioned arbitrary embodiment.
From above description and specific embodiment to invention, can find out, in local recurrence name server side, be that first request of not carrying voucher receiving generates voucher, at resolver adnation, become to carry the first request of voucher, whether the voucher carrying in the first request again sending in local recurrence name server side judgement is correct, continue pack processing containing the request of correct voucher, discarded packets is containing the request of wrong voucher.Application embodiments of the invention, assailant's request is just inhibited in local recurrence name server side, the recurrence name server that the request of avoiding a large amount of assailants to send enters other even arrives authoritative name server, thereby has effectively suppressed the attack for DNS on source.And embodiments of the invention do not change or change very little to the standard of existing DNS, have and implement simple, low cost and other advantages.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.