<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[Tcpdump的常用指令小结，Linux抓包工具：tcpdump简单使用。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 14 Jan 2010 05:25:33 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	TCPDUMP数据包分析及在服务器维护过程中的作用。windump用法类似。今天特别为了测试tcpdump架设了两个虚拟机，对所述命令进行测试。以达到完全了解tcpdump的目的。环境centos 5 虚拟机用vmware。<br/><br/>tcpdump的选项介绍<br/><br/>　　　-a 　　　将网络地址和广播地址转变成名字；<br/>　　　-d 　　　将匹配信息包的代码以人们能够理解的汇编格式给出；<br/>　　　-dd 　　 将匹配信息包的代码以c语言程序段的格式给出；<br/>　　　-ddd 　　将匹配信息包的代码以十进制的形式给出；<br/>　　　-e 　　　在输出行打印出数据链路层的头部信息；<br/>　　　-f 　　　将外部的Internet地址以数字的形式打印出来；<br/>　　　-l 　　　使标准输出变为缓冲行形式；<br/>　　　-n 　　　不把网络地址转换成名字；<br/>　　　-t 　　　在输出的每一行不打印时间戳；<br/>　　　-v 　　　输出一个稍微详细的信息，例如在ip包中可以包括ttl和服务类型的信息；<br/>　　　-vv 　　 输出详细的报文信息；<br/>　　　-c 　　　在收到指定的包的数目后，tcpdump就会停止；<br/>　　　-F 　　　从指定的文件中读取表达式,忽略其它的表达式；<br/>　　　-i 　　　指定监听的网络接口；<br/>　　　-r 　　　从指定的文件中读取包(这些包一般通过-w选项产生)；<br/>　　　-w 　　　直接将包写入文件中，并不分析和打印出来；<br/>　　　-T 　　　将监听到的包直接解释为指定的类型的报文，常见的类型有rpc （远程过程调用）和snmp（简单网络管理协议；）<br/><br/>tcpdump -nnnv arp 查找ARP攻击时确定攻击原MAC地址时常用。<br/>tcpdump -nnnv udp port 53&nbsp;&nbsp;DNS服务器53端口受ARP攻击时查看攻击源时用。<br/>tcpdump -nnnv udp and not port 53&nbsp;&nbsp;可以确定是否有非53端口的大流量UDP攻击<br/>tcpdump -nnnv port 80 and host 192.168.0.1 找出从192.168.0.1的80端口收到或发送的IP包。<br/>tcpdump -nnnv ip host 210.27.48.1 and ! 210.27.48.2 获取主机210.27.48.1除了和主机210.27.48.2之外所有主机通信的ip包<br/><br/>tcpdump -nnnv host 210.27.48.1 and &#92; (210.27.48.2 or 210.27.48.3 &#92;)&nbsp;&nbsp;截获主机210.27.48.1 和主机210.27.48.2 或210.27.48.3的通信<br/><br/>tcpdump -nnnv host ! 192.168.15.129 and ! 192.168.15.130 and dst port 80 <br/>捕获除了主机192.168.15.129与192.168.15.130 且到本机目标80端口的数据包。<br/><br/>tcpdump -nnnv src 192.168.15.129 and port 53 捕获由192.168.15.129到本机53端口的数据包。不管是UDP还是TCP<br/><br/>信息参考：Tcpdump命令的使用与示例http://tcpdump.anheng.com.cn/news/24/586.html&quot; target=&quot;_blank&quot;&gt; http://tcpdump.anheng.com.cn/news/24/586.html<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;超级详细Tcpdump 的用法 http://course.51cto.com/art/200512/15473.htm<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Linux下的Sniffer Tcpdump的安装和使用http://unix-cd.com/vc/www/28/2007-08/8018.html 注此文中部分命令是错的。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TCPDump使用方法小结&nbsp;&nbsp; http://softtest.chinaitlab.com/qita/746811.html<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TCPDUMP高级用法http://blog.csdn.net/linyt/archive/2007/12/14/1936073.aspx<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>================================================================================<br/>Linux抓包工具：tcpdump简单使用<br/>简单用法，可以分析soap数据包。<br/> <br/>this is probably the easiest way to monitor SOAP messages.<br/><br/>simply use<br/><br/>#tcpdump -i eth0 -A -s 1024 port 80 &#124; tee dump.log<br/><br/>to log all the packet sent to port 80 to dump.log<br/><br/> <br/>***********************************************************<br/> <br/>今天在尝试TTserver的Http协议接口，为了确定走的协议是否为Http，需要抓包确定一下，<br/>在windows下有很多工具很方便的抓包，linux下只能通过命令行来操作了，下面简单记录一下<br/>tcpdump工具的使用：<br/>//抓包，<br/>tcpdump -nX -s 0 -w cap.raw host 123.123.123.123 and port 2978<br/>//读包<br/>tcpdump -r cap.raw -A<br/> <br/>tcpdump有很多参数选项，man就可看到，<br/>-----------------------------------------------------------------------------------&nbsp;&nbsp;&nbsp;&nbsp;<br/>EXAMPLES<br/>To print all packets arriving at or departing from sundown:<br/>tcpdump host sundown<br/> <br/>To print traffic between helios and either hot or ace:<br/>tcpdump host helios and &#92;( hot or ace &#92;)<br/> <br/>To print all IP packets between ace and any host except helios:<br/>tcpdump ip host ace and not helios<br/> <br/>To print all traffic between local hosts and hosts at Berkeley:<br/>tcpdump net ucb-ether<br/> <br/>To print all ftp traffic through internet gateway snup: (note that the<br/>expression is quoted to prevent the shell from (mis-)interpreting the<br/>parentheses):<br/>tcpdump &#039;gateway snup and (port ftp or ftp-data)&#039;<br/> <br/>To print traffic neither sourced from nor destined for local hosts (if<br/>you gateway to one other net, this stuff should never make it onto your<br/>local net).<br/>tcpdump ip and not net localnet<br/> <br/>To print the start and end packets (the SYN and FIN packets) of each<br/>TCP conversation that involves a non-local host.<br/>tcpdump &#039;tcp[tcpflags] &amp; (tcp-syn&#124;tcp-fin) != 0 and not src and dst net localnet&#039;<br/> <br/>To print all IPv4 HTTP packets to and from port 80, i.e. print only<br/>packets that contain data, not, for example, SYN and FIN packets and<br/>ACK-only packets. (IPv6 is left as an exercise for the reader.)<br/>tcpdump &#039;tcp port 80 and (((ip[2:2] - ((ip[0]&amp;0xf)&lt;&gt;2)) != 0)&#039;<br/> <br/>To print IP packets longer than 576 bytes sent through gateway snup:<br/>tcpdump &#039;gateway snup and ip[2:2] &gt; 576&#039;<br/> <br/>To print IP broadcast or multicast packets that were not sent via Eth-<br/>ernet broadcast or multicast:<br/>tcpdump &#039;ether[0] &amp; 1 = 0 and ip[16] &gt;= 224&#039;<br/> <br/>To print all ICMP packets that are not echo requests/replies (i.e., not<br/>ping packets):<br/>tcpdump &#039;icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply&#039;<br/>------------------------------------------------------------------------------------ <br/> <br/> 注：需要root的权限才能运行tcpdump命令<br/>说实话，tcpdump虽然强大，但是毕竟操作起来不如windows下一些图形软件方便。<br/>
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Tcpdump的常用指令小结，Linux抓包工具：tcpdump简单使用。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>