CC 攻擊成本低、發起易,多使用現成工具,特徵明顯。利用 tcpdump 即時抓封包分析,可快速判斷是否遭受攻擊。
# CentOS/RHEL
yum install -y tcpdump
# Debian/Ubuntu
apt-get install -y tcpdump
tcpdump -s0 -A -n -i any | grep -o -E '(GET|POST|HEAD) .*'
GET /static/css/style.css HTTP/1.1
GET /api/user/info HTTP/1.1
POST /order/submit HTTP/1.1
GET /images/logo.png HTTP/1.1
靜態資源 (css, js, jpg, png) 請求佔比高,路徑多樣。
GET / HTTP/1.1 (攻擊首頁)/thread-隨機數-1-1.html (針對 Discuz 論壇)POST /ajax/validator.phptcpdump -s0 -A -n -i any | grep '^User-Agent'
UA 多樣:Chrome, Firefox, IE, 爬蟲 (bingbot, Googlebot) 等交替出現。
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) 持續重複。axd5m8usy 等明顯非標準字串。tcpdump -s0 -A -n -i any | grep '^Host'
Host: www.45it.com
Host: www.45it.com
Host: sos.45it.com
Host: sos.45it.com
...
若某域名佔比極高,即為攻擊目標,可針對性防護 (WAF 規則、限流、封禁 IP)。
awk/sort/uniq -c 做統計:tcpdump ... | grep '^Host' | awk '{print $2}' | sort | uniq -c | sort -nr