awk, cut, sort, uniq 隞, 臭誑啣箸 ip 蝺賊, 銝衣券蝺賊摨勗撠, 隞乩撠 TCP ESTABLISHED 蝺瑼X:- netstat -an|grep ESTABLISHED|awk '/^tcp/ {print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|more
銴鋆賭誨蝣 撠 port 80 蝺, 撠瘥 ip 蝺賊啣箔蒂脰摨:- netstat -ntu | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr|more
銴鋆賭誨蝣 箸憭交貊 10 IP 園交賂嗡葉 :80 舫亙嚗舀寞唾瑼X亦- netstat -atnp -A inet | grep ":80" | awk -F " " '{print $5}' | awk -F ":" '{print $1}' | sort | uniq -c | sort -nr | head -10
銴鋆賭誨蝣 9 P4 e4 |" L, w" D0 F N
隞乩寞曉唬皞 ip 敺, 靘憒 ip x.x.x.x, 臭誑 iptables 餅餅4 ]/ b% \7 n& v) S
撠 IP- iptables -A INPUT -p all -s x.x.x.x/32 -j DROP
銴鋆賭誨蝣 閫文 IP- iptables -D INPUT -p all -s x.x.x.x/32 -j DROP
銴鋆賭誨蝣 隞乩:* B) q# y+ b; C$ L7 z' K, ^
https://www.phpini.com/linux/linux-netstat-detect-ddos: s8 o7 ~2 {- ~; b
https://www.phpini.com/linux/count-ip-connections4 h! f1 b2 q: D9 n7 i0 P
https://www.phpini.com/linux/netstat-check-connections
# H6 X; g. s$ @5 a' x=================================================
% q+ x' b6 F1 I/ }4 t血嚗
8 `' h. \% l. n! L) l: z0 k亥岷芯port鋡怠芯函撘雿剁
' v( r4 X* s5 ]; |" f1 J3 [. q1.)- netstat -tulpn | grep LISTEN
銴鋆賭誨蝣 2.)- lsof -i -P -n | grep LISTEN
銴鋆賭誨蝣 3.)- sudo nmap -sT -O localhost
銴鋆賭誨蝣 =================================================. ~ J1 S6 Y1 h( ?/ u
亥岷port雿函backlogbacklog閰脣憭改 嚗 https://cloud.tencent.com/developer/article/1644836" k- m+ g) ^7 \3 ]5 @ A
|
|