How to determine CC attack commands in Centos

Source: Internet
Author: User

View the number of connections on all port 80

1netstat-nat | grep-I "80" | wc-l

Sort connected IP addresses by number of connections

1netstat-ntu | awk '{print $5}' | cut-d:-f1 | sort | uniq-c | sort-n

View TCP connection status

123456netstat-nat | awk '{print $6}' | sort | uniq-c | sort-rnnetstat-n | awk '/^ tcp/{++ S [$ NF]}; END {for (a in S) print a, S [a]} 'netstat-n | awk'/^ tcp/{++ state [$ NF]}; END {for (key in state) print key, "t ", state [key]} 'netstat-n | awk'/^ tcp/{++ arr [$ NF]}; END {for (k in arr) print k, "t ", arr [k]} 'netstat-n | awk'/^ tcp/{print $ NF} '| sort | uniq-c | sort-rnnetstat-ant | awk' {print $ NF} '| grep-V' [a-z]' | sort | uniq-c

View the 20 IP addresses with the maximum number of connections on port 80

12netstat-anlp | grep80 | greptcp | awk '{print $5}' | awk-F: '{print $1}' | sort | uniq-c | sort-nr | head-n20netstat-ant | awk '/: 80/{split ($5, ip ,":"); + + A [ip [1]} END {for (I in A) print A, I} '| sort-rn | head-n20

Use tcpdump to sniff access to port 80.

1 tcpdump-I eth0-tnn dst port 80-c 1000 | awk-F ". "'{print $1 ". "$2 ". "$3 ". "$4} '| sort | uniq-c | sort-nr | head-20

Find more time_wait connections

1netstat-n | grepTIME_WAIT | awk '{print $5}' | sort | uniq-c | sort-rn | head-n20

Search for many SYN connections

1netstat-an | grepSYN | awk '{print $5}' | awk-F: '{print $1}' | sort | uniq-c | sort-nr | more

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.