How
常日,攻击者利用一个造孽账号将DDoS主控程序安装在一台打算机上,并在网络上的多台打算机上安装代理程序。在所设定的韶光内,主控程序与大量代理程序进行通讯,代理程序收到指令时对目标发动攻击,主控程序乃至能在几秒钟内激活成百上千次代理程序的运行。
ClassificationDDoS攻击分类
攻击子类

描述
畸形报文
FragFlood、Smurf、StreamFlood、LandFlood、IP畸形报文、TCP畸形报文、UDP畸形报文等。
畸形报文攻击指通过向目标系统发送有缺陷的IP报文,使得目标系统在处理这样的报文时涌现崩溃,从而达到谢绝做事的攻击目的。
传输层DDoS攻击
Syn Flood、AckFlood、UDPFlood、ICMPFlood、RstFlood等。
以Syn Flood攻击为例,它利用了TCP协议的三次握手机制,当做事端吸收到一个Syn要求时,做事端必须利用一个监听行列步队将该连接保存一定韶光。因此,通过向做事端一直发送Syn要求,但不相应Syn+Ack报文,从而花费做事真个资源。当监听行列步队被占满时,做事端将无法相应正常用户的要求,达到谢绝做事攻击的目的。
DNS DDoS攻击
DNSRequestFlood、DNSResponseFlood、虚假源+真实源DNS Query Flood、威信做事器攻击和Local做事器攻击等。
以DNS Query Flood攻击为例,实在质上实行的是真实的Query要求,属于正常业务行为。但如果多台傀儡机同时发起海量的域名查询要求,做事端无法相应正常的Query要求,从而导申谢绝做事。
连接型DDoS攻击
TCP慢速连接攻击、连接耗尽攻击、Loic、Hoic、Slowloris、 Pyloris、Xoic等慢速攻击。
以Slowloris攻击为例,其攻击目标是Web做事器的并发上限。当Web做事器的连接并发数达到上限后,Web做事即无法接管新的要求。Web做事吸收到新的HTTP要求时,建立新的连接来处理要求,并在处理完成后关闭这个连接。如果该连接一贯处于连接状态,收到新的HTTP要求时则须要建立新的连接进行处理。而当所有连接都处于连接状态时,Web将无法处理任何新的要求。Slowloris攻击利用HTTP协议的特性来达到攻击目的。HTTP要求以\r\n\r\n标识Headers的结束,如果Web做事端只收到\r\n,则认为HTTP Headers部分没有结束,将保留该连接并等待后续的要求内容。
Web运用层DDoS攻击
HTTP Get Flood、HTTP Post Flood、CC等攻击。
常日运用层攻击完备仿照用户要求,类似于各种搜索引擎和爬虫一样,这些攻击行为和正常的业务并没有严格的边界,难以辨别。Web做事中一些资源花费较大的事务和页面。例如,Web运用中的分页和分表,如果掌握页面的参数过大,频繁的翻页将会占用较多的Web做事资源。尤其在高并发频繁调用的情形下,类似这样的事务就成了早期CC攻击的目标。由于现在的攻击大都是稠浊型的,因此仿照用户行为的频繁操作都可以被认为是CC攻击。例如,各种刷票软件对网站的访问,从某种程度上来说便是CC攻击。CC攻击瞄准的是Web运用的后端业务,除了导申谢绝做事外,还会直接影响Web运用的功能和性能,包括Web相应韶光、数据库做事、磁盘读写等。
Suricata Rulestcp畸形报文TCP报文标志位包括URG、ACK、PSH、RST、SYN、FIN。攻击者通过发送造孽TCP flag组合的报文,受害主机收到后进行判断识别,花费其性能,乃至会造成有些操作系统报文处理非常,主机崩溃。
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"GPL SCAN nmap fingerprint attempt"; flags:SFPU; flow:stateless; reference:arachnids,05; classtype:attempted-recon; sid:2100629; rev:7; metadata:created_at 2010_09_23, updated_at 2010_09_23;)
teardrop攻击攻击者截取IP数据包后,把偏移字段设置成禁绝确的值,吸收端在收到这些分拆的数据包后,就不能按数据包中的偏移字段值精确组合出被拆分的数据包,这样,吸收端会一直的考试测验,以至操作系统因资源耗尽而崩溃
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"ET EXPLOIT Invalid non-fragmented packet with fragment offset>0"; fragbits: !M; fragoffset: >0; reference:url,http://doc.emergingthreats.net/bin/view/Main/2001022; classtype:bad-unknown; sid:2001022; rev:5; metadata:created_at 2010_07_30, updated_at 2010_07_30;)
smurf攻击攻击者向网络中的广播地址发送源IP假造为受害者的ICMP要求报文,使得网络中的所有主机向受害者回应ICMP应答报文,这样造成受害者系统繁忙,链路拥塞
alert ip any any <> 127.0.0.0/8 any (msg:"GPL SCAN loopback traffic"; reference:url,http://rr.sans.org/firewall/egress.php; classtype:bad-unknown; sid:2100528; rev:6; metadata:created_at 2010_09_23, updated_at 2020_08_20;)
land攻击Land攻击是指攻击者向受害者发送TCP报文,此TCP报文的源地址和目的地址同为受害者的IP地址。这将导致受害者向它自己的地址发送SYN-ACK回应报文,结果这个地址又发回ACK并创建一个空连接。从而造成资源的花费。
alert tcp $HOME_NET any -> $HOME_NET any (msg:"ET MALWARE APT 41 LOWKEY Backdoor [TCP Relay Module] - TCP Relay Successfully Activated on New Host"; flow:established,to_server; content:"|00 00 00 00 00 D4 00 00 00 00 00 00 00 00 00 00|"; reference:url,http://www.fireeye.com/blog/threat-research/2019/10/lowkey-hunting-for-the-missing-volume-serial-id.html; classtype:command-and-control; sid:2028888; rev:1; )
ping of death攻击者A向受害者B发送一些尺寸超大的ICMP
alert icmp $EXTERNAL_NET any -> $HOME_NET any (msg:"GPL ICMP Large ICMP Packet"; dsize:>800; itype:8; reference:arachnids,246; classtype:bad-unknown; sid:2100499; rev:5; metadata:created_at 2010_09_23, updated_at 2010_09_23;)
syn flood恶意的向某个做事器端口发送大量的SYN包,则可以使做事器打开大量的半开连接,分配TCB,从而花费大量的做事器资源,同时也使得正常的连接要求无法被相应。而攻击发起方的资源花费比较较可忽略不计。
alert tcp $EXTERNAL_NET 10000: -> $HOME_NET 0:1023 (msg:"ET DOS Potential Tsunami SYN Flood Denial Of Service Attempt"; flags:S; flow:to_server; dsize:>900; threshold: type both, count 20, seconds 120, track by_src; reference:url,http://security.radware.com/uploadedFiles/Resources_and_Content/Threat/TsunamiSYNFloodAttack.pdf; classtype:attempted-dos; sid:2019404; rev:3; metadata:created_at 2014_10_15, updated_at 2014_10_15;)
udp floodUDP Flood属于带宽类攻击,向目标做事器发起大量的UDP报文,这种UDP报文常日为大包,且速率非常快,常日会造成以下危害:花费网络带宽资源,严重时造成链路拥塞;大量变源变端口的UDP Flood会导致依赖会话转发的网络设备,性能降落乃至会话耗尽,从而导致网络瘫痪。
alert udp $EXTERNAL_NET any -> $HOME_NET 5060 (msg:"ET VOIP INVITE Message Flood UDP"; content:"INVITE"; depth:6; threshold: type both , track by_src, count 100, seconds 60; reference:url,http://doc.emergingthreats.net/2009698; classtype:attempted-dos; sid:2009698; rev:1; metadata:created_at 2010_07_30, updated_at 2010_07_30;)
icmp flood短韶光内向特定目标不断要求 ICMP 回应,致使目标系统包袱过重而不能处理合法的传输任务,就发生了 ICMP Flood。
alert icmp any any -> any any (msg:"ET DOS Microsoft Windows 7 ICMPv6 Router Advertisement Flood"; itype:134; icode:0; byte_test:1,&,0x08,2; content:"|03|"; offset:20; depth:1; byte_test:1,&,0x40,2,relative; byte_test:1,&,0x80,2,relative; threshold:type threshold, track by_src, count 10, seconds 1; reference:url,http://www.samsclass.info/ipv6/proj/proj8x-124-flood-router.htm; classtype:attempted-dos; sid:2014996; rev:3; metadata:created_at 2012_07_02, updated_at 2012_07_02;)
dns quert flood多台傀儡机同时发起海量的域名查询要求,做事端无法相应正常的Query要求,从而导申谢绝做事。
alert dns $HOME_NET any -> any any (msg:"ET MALWARE Likely Linux/Tsunami DDoS Attack Participation (s-p-o-o-f-e-d.h-o-s-t.name)"; threshold:type limit,track by_src,count 3,seconds 60; dns.query; content:"s-p-o-o-f-e-d.h-o-s-t.name"; depth:26; fast_pattern; nocase; endswith; reference:md5,c01991d55133d0057c9b721bb141a5d9; classtype:trojan-activity; sid:2021691; rev:5; metadata:created_at 2015_08_19, former_category CURRENT_EVENTS, updated_at 2020_09_17;)
slowloris攻击者在HTTP要求头中将Connection设置为Keep-Alive,哀求Web Server保持TCP连接不要断开,随后缓慢的每隔几分钟发送一个key value格式的数据到做事端,如a:b\r\n,导致做事端认为HTTP头部没有吸收完成而一贯等待。如果攻击者利用多线程或者傀儡机来做同样的操作,做事器的WEB容器很快就被攻击者占满了TCP连接而不再接管新的要求。
alert http $EXTERNAL_NET any -> $HTTP_SERVERS any (msg:"ET SCAN Simple Slowloris Flooder"; flow:established,to_server; threshold:type limit, track by_src, count 1, seconds 300; http.method; content:"POST"; http.header; content:"Content-length|3a 20|5235|0d 0a|"; fast_pattern; http.header_names; content:!"User-Agent|0d 0a|"; reference:url,http://www.imperva.com/docs/HII_Denial_of_Service_Attacks-Trends_Techniques_and_Technologies.pdf; classtype:web-application-attack; sid:2016033; rev:5; metadata:created_at 2012_12_13, updated_at 2020_05_08;)
cc攻击针对 Web 做事在第七层协议发起的攻击,正常的有效的数据包 不断发出针对不同资源和页面的 HTTP 要求,并尽可能要求无法被缓存的资源(DB查询等),这样就极大加重了做事器的打算和IO资源,从而导致瘫痪
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ET DOS LOIC Javascript DDoS Outbound"; flow:established,to_server; threshold: type both, track by_src, count 5, seconds 60; http.method; content:"GET"; http.uri; content:"/?id="; fast_pattern; depth:5; content:"&msg="; distance:13; within:5; pcre:"/^\/\?id=[0-9]{13}&msg=/"; reference:url,http://isc.sans.org/diary/Javascript+DDoS+Tool+Analysis/12442; reference:url,http://www.wired.com/threatlevel/2012/01/anons-rickroll-botnet; classtype:attempted-dos; sid:2014141; rev:6; metadata:created_at 2012_01_23, updated_at 2020_05_06;)
Suricata 支持ddos流量模型的Optiontcp.flagsdetect which flags are set in the TCP header#define TH_FIN 0x01#define TH_SYN 0x02#define TH_RST 0x04#define TH_PUSH 0x08#define TH_ACK 0x10#define TH_URG 0x20
fragbits,fragoffset
check if the fragmentation and reserved bits are set in the IP headermatch on specific decimal values of the IP fragment offset field
itype, icode
match on a specific ICMP type/code TYPECODEDescription00Echo Reply——回显应答(Ping应答) 30Network Unreachable——网络不可达 31Host Unreachable——主机不可达 32Protocol Unreachable——协议不可达 33Port Unreachable——端口不可达 34Fragmentation needed but no frag35Source routing failed——源站选路失落败 36Destination network unknown——目的网络未知 ... ...
flow
match on direction and state of the flowestablished/not established For TCP a connection will be established after a three way handshake.For other protocols (for example UDP), the connection will be considered established after seeing traffic fromboth sides of the connection.
threshold
control the rule's alert frequencythreshold: type <threshold|limit|both>, track <by_src|by_dst>, count <N>, seconds <T>A threshold setting of N means on the Nth time the rule matches an alert is generated.If set to limit N, it alerts at most N times.
byte_test
extract <num of bytes> and perform an operation selected with <operator> against the value in <test value> at a particular <offset>data = DetectBytetestParse("4 , ! &, 5, 0 , little ", NULL, NULL);((data->op == DETECT_BYTETEST_OP_AND)&& (data->nbytes == 4)&& (data->value == 5)&& (data->offset == 0)&& (data->neg_op)&& (data->flags == DETECT_BYTETEST_LITTLE)&& (data->base == DETECT_BYTETEST_BASE_UNSET))
dns.query,http.header,http.method,http.uri
content modifiers
match on the size of the packet payloadhow many bytes from the beginning of the payload will be checkeddistance 两个content间隔within 两个content尾的间隔
Reference
https://help.aliyun.com/document_detail/28401.html
单包攻击事理与防御
畸形报文攻击
SYN Flood事理及防护
DDoS攻击--CC攻击防护详解(HTTP)
icmp 报文详解