Method and device for detecting flood attacks
View Patent ↗Disclosed is a flood attack detection method, wherein the total number of keywords of a source packet is acquired, and the number of feature parameters corresponding to the source packet is acquired. A ratio of the number of feature parameters to the total number of keywords is compared with a preset threshold, and if the ratio is greater than or equal to the preset threshold, it is determined that a flood attack occurs.
1. A flood attack detection method, the method being carried out by a computer device having a processor, comprising:
receiving, by the device, source packets transmitted from a plurality of hosts, wherein the source packets include text content; and
counting, by the device, a total number of the received source packets carrying a keyword in a predetermined time to obtain a total number of the source packets with the keyword, wherein each received source packet's text content carries the keyword;
obtaining, by the device, a number of failure response packets in response to the received source packets transmitted from the plurality of hosts, wherein each of the failure response packets is generated and sent by a destination host of a source packet in the source packets, and indicates a request for resource on the destination host which causes a failure;
calculating a ratio of the number of the failure response packets to the total number of the source packets with the keyword; and
determining that a flood attack has occurred when the ratio exceeds or is equal to a preset failure threshold.
2. The flood attack detection method of claim 1 , further comprising:
performing, by the device, keyword feature filtering on the source packets, and the packets left is the source packets carrying the keyword.
3. A flood attack detection apparatus, comprising:
a processor configured to:
receive source packets transmitted from a plurality of hosts, wherein the source packets include text content; and
count a total number of the received source packets carrying a keyword in a predetermined time to obtain a total number of the source packets with the keyword, wherein each received source packet's text content carries the keyword;
obtain a number of failure response packets in response to the received source packets transmitted from the plurality of hosts, wherein each of the failure response packets is generated and sent by a destination host of a source packet in the source packets, and indicates a request for resource on the destination host which causes a failure;
calculate a ratio of the number of the failure response packets to the total number of the source packets with the keyword;
compare the ratio with a preset failure threshold; and
determine that a flood attack has occurred when the ratio exceeds or is equal to the preset failure threshold.
4. The flood attack detection apparatus of claim 3 , further comprising:
a storage unit, configured to storage a data table consisting of the total number of the source packets carrying the keyword and the number of the failure response packets.