查看linux 線程

3中方法:

1. cat /proc/${pid}/status

2. pstree -p ${pid}

3. top -p ${pid} 再按H

或者直接輸入 top -bH -d 3 -p ${pid}



查看進程工作

strace -p ${pid}

開啓iptables日誌
iptables -t raw -I PREROUTING 1 -p tcp --syn -m statistic --mode nth --every 5000 -j LOG --log-prefix "IPTABLES DETECTING SYN: "
tail /var/log/message
關閉iptables日誌
iptables -t raw -F

查看是否被攻擊
netstat -n -p TCP | grep SYN_RECV | grep :80 | wc -l
netstat -tn|grep ESTABLISH|wc -l
查出服務器是否受到DOS攻擊 (看SYN_RECV)
netstat -an |awk '{print $6}'|sort|uniq -c|sort -rn
5116 TIME_WAIT
1624 ESTABLISHED
531 FIN_WAIT1
512 FIN_WAIT2
126 SYN_RECV
10 CLOSING
9 LISTEN

查出服務器異常IP鏈接
netstat -an | awk '{print $5}' | cut -d":" -f1 | sort | uniq -c | sort -rn | head
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章