Một số câu lệnh ssh kiểm tra server khi bị tấn công DDoS

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Kiểm tra số connection trên port 80:
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -n | grep :80 |wc -l[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]
Kiểm tra số lượng connection đang ở trạng thái SYN_RECV:
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -n | grep :80 | grep SYN_RECV|wc -l[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]

Hiển thị tất cả các IP đang kết nối và số lượng kết nối từ mỗi IP:
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -an|grep :80 |awk '{print $5}'|cut -d":" -f1|sort|uniq -c|sort -rn[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]
Nếu muốn kiểm tra IP nào mở nhiều SYN thì thêm vào:
Code:
[FONT=Times New Roman][COLOR=#4B0082]netstat -an|grep :80|grep SYN |awk '{print $5}'|cut -d":" -f1|sort|uniq -c|sort -rn[/COLOR][/FONT]
- Đối với server có nhiều IP, để kiểm tra IP nào đang bị tấn công:
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -plan  | grep  :80 | awk '{print $4}'| cut -d: -f1 |sort |uniq -c[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]

- Hiển thị tất cả các IP đang kết nối và số lượng kết nối từ mỗi IP:
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -an | grep ':80' | awk '{print $5}' | sed s/'::ffff:'// | cut -d":" -f1 | sort | uniq -c[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]
- Hiển thị số lượng kết nối mỗi loại
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]netstat -an | grep :80 | awk '{print $6}' | sort | uniq -c[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]

61 ESTABLISHED
13 FIN_WAIT1
17 FIN_WAIT2
1 LISTEN
25 SYN_RECV
298 TIME_WAIT
- Hiển thị tất cả các IP đang kết nối và số lượng kết nối từ mỗi IP
Code:
[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]watch  "netstat -an | grep ':80' | awk '{print \$5}' | sed s/'::ffff:'// | cut -d\":\" -f1 | sort | uniq -c"[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]
- Hiển thị số lượng kết nối mỗi loại :
Code:
[/COLOR][/FONT][/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082]watch "netstat -an | grep :80 | awk '{print \$6}' | sort | uniq -c"[/COLOR][/FONT][FONT=Times New Roman][COLOR=#4B0082][FONT=Times New Roman][COLOR=#4B0082]
 

Facebook Comments

Similar threads

Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Back
Top