<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深度VPS &#187; TCP连接</title>
	<atom:link href="http://www.deepvps.com/tag/tcp%E8%BF%9E%E6%8E%A5/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>判断CC攻击，netstat命令详解</title>
		<link>http://www.deepvps.com/determine-the-cc-attack-netstat-command-detailed.html</link>
		<comments>http://www.deepvps.com/determine-the-cc-attack-netstat-command-detailed.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 15:23:58 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[80端口]]></category>
		<category><![CDATA[CC]]></category>
		<category><![CDATA[CC攻击]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[TCP连接]]></category>
		<category><![CDATA[命令]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=669</guid>
		<description><![CDATA[查看所有80端口的连接数
netstat -nat&#124;grep -i &#8220;80&#8243;&#124;wc -l
对连接的IP按连接数量进行排序
netstat -ntu &#124; awk &#8216;{print $5}&#8217; &#124; cut -d: -f1 &#124; sort &#124; uniq -c &#124; sort -n
查看TCP连接状态
netstat -nat &#124;awk &#8216;{print $6}&#8217;&#124;sort&#124;uniq -c&#124;sort -rn
netstat -n &#124; awk &#8216;/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}&#8217;
netstat -n &#124; awk &#8216;/^tcp/ {++state[$NF]}; END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217;
netstat -n &#124; awk &#8216;/^tcp/ {++arr[$NF]};END [...]]]></description>
			<content:encoded><![CDATA[<h3>查看所有80端口的连接数</h3>
<blockquote><p>netstat -nat|grep -i &#8220;80&#8243;|wc -l</p></blockquote>
<h3>对连接的IP按连接数量进行排序</h3>
<blockquote><p>netstat -ntu | awk &#8216;{print $5}&#8217; | cut -d: -f1 | sort | uniq -c | sort -n</p></blockquote>
<h3>查看TCP连接状态</h3>
<blockquote><p>netstat -nat |awk &#8216;{print $6}&#8217;|sort|uniq -c|sort -rn<br />
netstat -n | awk &#8216;/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}&#8217;<br />
netstat -n | awk &#8216;/^tcp/ {++state[$NF]}; END {for(key in state) print key,&#8221;\t&#8221;,state[key]}&#8217;<br />
netstat -n | awk &#8216;/^tcp/ {++arr[$NF]};END {for(k in arr) print k,&#8221;\t&#8221;,arr[k]}&#8217;<br />
netstat -n |awk &#8216;/^tcp/ {print $NF}&#8217;|sort|uniq -c|sort -rn<br />
netstat -ant | awk &#8216;{print $NF}&#8217; | grep -v &#8216;[a-z]&#8216; | sort | uniq -c</p></blockquote>
<p><span id="more-669"></span></p>
<h3>查看80端口连接数最多的20个IP</h3>
<blockquote><p>netstat -anlp|grep 80|grep tcp|awk &#8216;{print $5}&#8217;|awk -F: &#8216;{print $1}&#8217;|sort|uniq -c|sort -nr|head -n20<br />
netstat -ant |awk &#8216;/:80/{split($5,ip,&#8221;:&#8221;);++A[ip[1]]}END{for(i in A) print A,i}&#8217; |sort -rn|head -n20</p></blockquote>
<h3>用tcpdump嗅探80端口的访问看看谁最高</h3>
<blockquote><p>tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -F&#8221;.&#8221; &#8216;{print $1&#8243;.&#8221;$2&#8243;.&#8221;$3&#8243;.&#8221;$4}&#8217; | sort | uniq -c | sort -nr |head -20</p></blockquote>
<h3>查找较多time_wait连接</h3>
<blockquote><p>netstat -n|grep TIME_WAIT|awk &#8216;{print $5}&#8217;|sort|uniq -c|sort -rn|head -n20</p></blockquote>
<h3>查找较多的SYN连接</h3>
<blockquote><p>netstat -an | grep SYN | awk &#8216;{print $5}&#8217; | awk -F: &#8216;{print $1}&#8217; | sort | uniq -c | sort -nr | more</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/determine-the-cc-attack-netstat-command-detailed.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
