首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
标题:
*
140
字
TAG标签:
(用空格隔开)
30
字
恢复历史版本:
请选择分类
html
python
javascript
php
sql
c
c++
c#
java
plain
所有人可见
仅自己可见
编辑器:UEditor
编辑器:TinyMCE
编辑器:Editor.md
HTML转MD
HTML转MD2
<h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><p><span style="font-size: 15px; font-weight: normal;">原文 </span><a href="https://www.cnblogs.com/doit8791/p/5730595.html" _src="https://www.cnblogs.com/doit8791/p/5730595.html" style="font-size: 15px; font-weight: normal;">https://www.cnblogs.com/doit8791/p/5730595.html</a><br/></p><p><a href="https://blog.csdn.net/xuaner8786/article/details/79659755" _src="https://blog.csdn.net/xuaner8786/article/details/79659755" style="font-size: 15px; font-weight: normal;">https://blog.csdn.net/xuaner8786/article/details/79659755 15个免费好用的抓包工具</a> </p><p><a href="https://baijiahao.baidu.com/s?id=1608844599911189279&wfr=spider&for=pc" _src="https://baijiahao.baidu.com/s?id=1608844599911189279&wfr=spider&for=pc" style="font-size: 15px; font-weight: normal;">https://baijiahao.baidu.com/s?id=1608844599911189279&wfr=spider&for=pc 白帽子黑客抓包工具排行榜</a><br/></p><p><span style="font-size: 15px; font-weight: normal; line-height: 22px;"> 抓包应该是每个技术人员掌握的基础知识,无论是技术支持运维人员或者是研发,多少都会遇到要抓包的情况,用过的抓包工具有fiddle、wireshark,作为一个不是经常要抓包的人员,学会用</span><span style="font-size: 15px; font-weight: normal; line-height: 22px;">Wireshark就够了,毕竟它是功能最全面使用者最多的抓包工具。</span></p><p><span data-wiz-span="data-wiz-span" style="font-size: 11pt; font-weight: normal;">Wireshark(前称Ethereal)是一个网络封包分析软件。网络封包分析软件的功能是撷取网络封包,并尽可能显示出最为详细的网络封包资料。Wireshark使用WinPCAP作为接口,直接与网卡进行数据报文交换。</span></p><p><span data-wiz-span="data-wiz-span" style="font-size: 11pt; font-weight: normal;">网络封包分析软件的功能可想像成 "电工技师使用电表来量测电流、电压、电阻" 的工作 - 只是将场景移植到网络上,并将电线替换成网络线。在过去,网络封包分析软件是非常昂贵的,或是专门属于营利用的软件。Ethereal的出现改变了这一切。在GNUGPL通用许可证的保障范围底下,使用者可以以免费的代价取得软件与其源代码,并拥有针对其源代码修改及客制化的权利。Ethereal是目前全世界最广泛的网络封包分析软件之一。</span></p></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">wireshark的官方下载网站: </span><a href="http://www.wireshark.org/" style="color: rgb(29, 88, 209); text-decoration-line: none;"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">http://www.wireshark.org/</span></a></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">wireshark是非常流行的网络封包分析软件,功能十分强大。可以截取各种网络封包,显示网络封包的详细信息。</span></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">wireshark是开源软件,可以放心使用。 可以运行在Windows和Mac OS上。</span></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;"><br/></span></p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">Wireshark不能做的<a style="color: rgb(29, 88, 209);" name="cannotdo"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">为了安全考虑,wireshark只能查看封包,而不能修改封包的内容,或者发送封包。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">Wireshark VS Fiddler<a style="color: rgb(29, 88, 209);" name="wiresharkfiddler"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Fiddler是在windows上运行的程序,专门用来捕获HTTP,HTTPS的。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">wireshark能获取HTTP,也能获取HTTPS,但是不能解密HTTPS,所以wireshark看不懂HTTPS中的内容</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">同类的其他工具<a style="color: rgb(29, 88, 209);" name="othertool"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">微软的network monitor</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">sniffer </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">什么人会用到wireshark<a style="color: rgb(29, 88, 209);" name="who"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">1. 网络管理员会使用wireshark来检查网络问题</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">2. 软件测试工程师使用wireshark抓包,来分析自己测试的软件</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">3. 从事socket编程的工程师会用wireshark来调试</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">4. 听说,华为,中兴的大部分工程师都会用到wireshark。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0);">总之跟网络相关的东西,都可能会用到wireshark.</span></p><p> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">wireshark 开始抓包<a style="color: rgb(29, 88, 209);" name="start"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">开始界面</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324817949.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">wireshark是捕获机器上的某一块网卡的网络包,当你的机器上有多块网卡的时候,你需要选择一个网卡。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">点击Caputre->Interfaces.. 出现下面对话框,选择正确的网卡。然后点击"Start"按钮, 开始抓包</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324809728.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">Wireshark 窗口介绍<a style="color: rgb(29, 88, 209);" name="mainui"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324332152.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">WireShark 主要分为这几个界面</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">1. Display Filter(显示过滤器), 用于过滤</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">2. Packet List Pane(封包列表), 显示捕获到的封包, 有源地址和目标地址,端口号。 颜色不同,代表</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">3. Packet Details Pane(封包详细信息), 显示封包中的字段</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">4. Dissector Pane(16进制数据)</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">5. Miscellanous(地址栏,杂项)</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">Wireshark 显示过滤<a style="color: rgb(29, 88, 209);" name="filter"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324285332.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">使用过滤是非常重要的, 初学者使用wireshark时,将会得到大量的冗余信息,在几千甚至几万条记录中,以至于很难找到自己需要的部分。搞得晕头转向。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">过滤器会帮助我们在大量的数据中迅速找到我们需要的信息。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">过滤器有两种,</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">一种是显示过滤器,就是主界面上那个,用来在捕获的记录中找到所需要的记录</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">一种是捕获过滤器,用来过滤捕获的封包,以免捕获太多的记录。 在Capture -> Capture Filters 中设置</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">保存过滤<a style="color: rgb(29, 88, 209);" name="savefilter"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">在Filter栏上,填好Filter的表达式后,点击Save按钮, 取个名字。比如"Filter 102",</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324559629.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Filter栏上就多了个"Filter 102" 的按钮。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324990511.png" style="border: 0px; max-width: 900px; height: auto;"/></p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">过滤表达式的规则<a style="color: rgb(29, 88, 209);" name="filterRegular"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">表达式规则</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> 1. 协议过滤</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">比如TCP,只显示TCP协议。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">2. IP 过滤</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">比如 ip.src ==192.168.1.102 显示源地址为192.168.1.102,</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">ip.dst==192.168.1.102, 目标地址为192.168.1.102</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">3. 端口过滤</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">tcp.port ==80, 端口为80的</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">tcp.srcport == 80, 只显示TCP协议的愿端口为80的。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">4. Http模式过滤</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">http.request.method=="GET", 只显示HTTP GET方法的。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">5. 逻辑运算符为 AND/ OR</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">常用的过滤表达式</p><table align="left" width="631" height="190"><tbody><tr class="firstRow"><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;">过滤表达式</td><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;">用途</td></tr><tr><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;">http</td><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;">只查看HTTP协议的记录</td></tr><tr><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;">ip.src ==192.168.1.102 or ip.dst==192.168.1.102</td><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;"> 源地址或者目标地址是192.168.1.102</td></tr><tr><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;"><br/></td><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;"><br/></td></tr><tr><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;"><br/></td><td style="border-color: silver; border-collapse: collapse; padding: 8px 14px;"><br/></td></tr></tbody></table><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">封包列表(Packet List Pane)<a style="color: rgb(29, 88, 209);" name="PacketList"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">封包列表的面板中显示,编号,时间戳,源地址,目标地址,协议,长度,以及封包信息。 你可以看到不同的协议用了不同的颜色显示。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">你也可以修改这些显示颜色的规则, View ->Coloring Rules.</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463324191901.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">封包详细信息 (Packet Details Pane)<a style="color: rgb(29, 88, 209);" name="packetDetails"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">这个面板是我们最重要的,用来查看协议中的每一个字段。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">各行信息分别为</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Frame: <span style="font-size: 12px;"><span style="color: rgb(255, 0, 0);">物理层的数据帧概况</span></span></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Ethernet II: <span style="color: rgb(255, 0, 0);"><span style="font-size: 12px;">数据链路层以太网帧头部信息</span></span></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Internet Protocol Version 4: <span style="font-size: 12px;"><span style="color: rgb(255, 0, 0);">互联网层IP包头部信息</span></span><br/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Transmission Control Protocol: <span style="font-size: 12px;"><span style="color: rgb(255, 0, 0);">传输层T的数据段头部信息,此处是TCP</span></span><br/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">Hypertext Transfer Protocol: <span style="color: rgb(255, 0, 0); font-size: 12px;">应用层的信息,此处是HTTP协议</span><br/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">wireshark与对应的OSI七层模型<a style="color: rgb(29, 88, 209);" name="osi"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325936835.png" style="border: 0px; max-width: 900px; height: auto;"/></p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">TCP包的具体内容<a style="color: rgb(29, 88, 209);" name="tcpdetails"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> 从下图可以看到wireshark捕获到的TCP包中的每个字段。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325728327.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><h1 id="tank_h1" style="font-size: 28px; line-height: 1.5; margin: 10px 0px; font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">实例分析TCP三次握手过程<a style="color: rgb(29, 88, 209);" name="threehand"></a></h1><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">看到这, 基本上对wireshak有了初步了解, 现在我们看一个TCP三次握手的实例</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> 三次握手过程为</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325235246.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">这图我都看过很多遍了, 这次我们用wireshark实际分析下三次握手的过程。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">打开wireshark, 打开浏览器输入 <a style="color: rgb(29, 88, 209);">http://www.cnblogs.com/tankxiao</a></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">在wireshark中输入http过滤, 然后选中GET /tankxiao HTTP/1.1的那条记录,右键然后点击"Follow TCP Stream",</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">这样做的目的是为了得到与浏览器打开网站相关的数据包,将得到如下图</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325211817.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">图中可以看到wireshark截获到了三次握手的三个数据包。第四个包才是HTTP的, 这说明HTTP的确是使用TCP建立连接的。</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> </p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">第一次握手数据包</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">客户端发送一个TCP,标志位为SYN,序列号为0, 代表客户端请求建立连接。 如下图</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325697707.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">第二次握手的数据包</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">服务器发回确认包, 标志位为 SYN,ACK. 将确认序号(Acknowledgement Number)设置为客户的I S N加1以.即0+1=1, 如下图</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325725039.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">第三次握手的数据包</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);">客户端再次发送确认包(ACK) SYN标志位为0,ACK标志位为1.并且把服务器发来ACK的序号字段+1,放在确定字段中发送给对方.并且在数据段放写ISN的+1, 如下图:</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><img alt="" src="/ueditor/php/upload/image/20181222/1545463325196138.png" style="border: 0px; max-width: 900px; height: auto;"/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"> 就这样通过了TCP三次握手,建立了连接</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><a href="http://www.cnblogs.com/TankXiao/archive/2012/10/10/2711777.html" style="color: rgb(29, 88, 209); text-decoration-line: none;">http://www.cnblogs.com/TankXiao/archive/2012/10/10/2711777.html</a></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><p><span style="color: rgb(174, 0, 174); font-size: 22px;">1.设置过滤条件</span></p><p><span style="color: rgb(243, 152, 0);">【1】http and ip.addr == 192.168.1.106 and tcp.port == 8080</span></p><p><span style="color: rgb(38, 38, 38);">【a】http:指定网络协议</span></p><p><span style="color: rgb(38, 38, 38);">【b】</span>ip.addr == <span style="color: rgb(89, 159, 254);">192.168.1.106:</span><span style="color: rgb(38, 38, 38);">指定服务器ip地址,请根据实际情况替换。</span></p><p><span style="color: rgb(38, 38, 38);">【c】</span>tcp.port ==<span style="color: rgb(89, 159, 254);"> 8080,</span><span style="color: rgb(38, 38, 38);">指定端口号,请根据实际情况替换。</span></p><p><img alt="" src="/ueditor/php/upload/image/20181222/1545463325638370.png" style="border: 0px; max-width: 900px; height: auto;"/><br/></p><p>图1 过滤条件</p><p><span style="color: rgb(243, 152, 0);">【2】点击apply</span></p><p> 点击apply之后可过滤得到两个数据包,分别是HTTP请求和HTTP响应。</p><p><img alt="" src="/ueditor/php/upload/image/20181222/1545463325428080.png" style="border: 0px; max-width: 900px; height: auto;"/><br/></p><p>图2 HTTP请求和响应</p><p><span style="color: rgb(174, 0, 174); font-size: 22px;">2.查看TCP数据流——Follow TCP Stream</span></p><p><span style="color: rgb(243, 152, 0);">【1】在任意数据包上右击,选择Follow TCP Stream</span></p><p> 该步骤可以过滤出和该HTTP数据包有关的TCP数据包,包括TCP 3次握手,TCP分片和组装等。</p><p><img alt="" src="/ueditor/php/upload/image/20181222/1545463326628063.png" style="border: 0px; max-width: 900px; height: auto;"/><br/></p><p>图3 选择Follow TCP Stream</p><p><span style="color: rgb(243, 152, 0);">【2】最终得到HTTP请求和响应</span></p><p>【a】红色背景字体为HTTP请求,蓝色背景字体为HTTP响应</p><p>【b】从User-Agent中可以看出,360浏览器兼容模式使用了IE8内核(该台计算机操作系统为XP,IE浏览器版本为8),这说明360浏览器使用了系统中的IE核。</p><p><img alt="" src="/ueditor/php/upload/image/20181222/1545463326607163.png" style="border: 0px; max-width: 900px; height: auto;"/><br/></p><p><img alt="" src="https://www.cnblogs.com/doit8791/p/5730595.html" style="border: 0px; max-width: 800px; height: auto; margin-top: 8px;"/></p><p>图4 HTTP请求和响应具体内容</p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><strong style="font-size: 10.5pt; padding: 0px; margin: 0px;">网络中明码传输的危险性</strong><br/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"> 通过明码传输的protocol和工具相当多,典型的就是telnet,ftp,http。我们拿telnet做这次实验。假设我以telnet方式登录到我的linux服务器,然后通过wireshark抓包,以抓取账号和密码信息。<br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">1、首先启动wireshark,并处于Capture状态。然后通过telnet远程登录我们的linux服务器。<br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/13/wKiom1PtxDOQimlAAACdwiZqfeE162.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img width="650" title="1.png" alt="wKiom1PtxDOQimlAAACdwiZqfeE162.jpg" src="/ueditor/php/upload/image/20181222/1545463330115957.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top; float: none;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">进入登录界面后,输入账号和密码登入系统。</p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M01/46/15/wKioL1PtxUvT0yksAACzkwdoI_Y013.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img width="650" title="2.png" alt="wKioL1PtxUvT0yksAACzkwdoI_Y013.jpg" src="/ueditor/php/upload/image/20181222/1545463331251166.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top; float: none;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">2、接下来停止wireshark的截取封包的操作,执行快捷方式的"Stop"即可。<br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"> 不过,捕获的信息非常多,这个时候可以利用Display Filter功能,过滤显示的内容,如下图所示,点击Expression,然后选择过滤表达式。这里,我们选择TELNET即可。<br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/14/wKiom1PtxVXjVpp9AAU8cd7PEgE073.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img width="650" title="1.png" alt="wKiom1PtxVXjVpp9AAU8cd7PEgE073.jpg" src="/ueditor/php/upload/image/20181222/1545463331475289.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">表达式确定之后,选择"Apply",就可以过滤出只包含TELNET的封包</p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/16/wKioL1Ptx42CAgvXAAYLelyRK58954.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img width="650" title="1.png" alt="wKioL1Ptx42CAgvXAAYLelyRK58954.jpg" src="/ueditor/php/upload/image/20181222/1545463331864615.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a>来,我们查看一下整个telnet会话的所有记录, wireshark可以记录会话记录(就像我们聊QQ时,"QQ聊天记录"一样),任意找到一个telnet封包,右键找到"Follow TCP Stream",wireshark就会返回整个会话记录。</p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/17/wKioL1PtyevSaTfJAASR__mwGZk771.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img width="650" title="1.png" alt="wKioL1PtyevSaTfJAASR__mwGZk771.jpg" src="/ueditor/php/upload/image/20181222/1545463331884547.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">OK, 我们看到以下这些数据信息,<span style="padding: 0px; margin: 0px; color: rgb(255, 0, 0);">红色的部分是我们发送出去的DATA,蓝色的部分是我们接收到的DATA。 <a href="http://img.baidu.com/hi/jx2/j_0061.gif" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img alt="j_0061.gif" src="/ueditor/php/upload/image/20181222/1545463331118414.gif" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a>, 告诉我, 你看到了什么</span><br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/16/wKiom1PtyVriu__WAAINWJKx1S0346.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img title="1.png" alt="wKiom1PtyVriu__WAAINWJKx1S0346.jpg" src="/ueditor/php/upload/image/20181222/1545463331386000.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">为了更准确的看清楚,我们再次仅筛选出我们发送出去的DATA。或者仅接收到的DATA。</p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;"><a href="http://s3.51cto.com/wyfs02/M02/46/18/wKioL1PtzA7D1_ewAAIm3rxMBZk668.jpg" target="_blank" style="color: rgb(80, 80, 80); text-decoration-line: none; padding: 0px; margin: 0px;"><img title="1.png" alt="wKioL1PtzA7D1_ewAAIm3rxMBZk668.jpg" src="/ueditor/php/upload/image/20181222/1545463331602462.jpg" style="border: medium none; max-width: 900px; height: auto; padding: 0px; margin: 0px; vertical-align: top;"/></a></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">从这里,我们可以确切的抓到账号和密码信息。login:wireshark Password:123456,除了这些,我们还可以更进一步知道别人在看什么网站,或是私人文件,隐私将毫无保障。<br style="padding: 0px; margin: 0px;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; clear: both; height: auto; overflow: hidden; color: rgb(80, 80, 80); font-family: 宋体, "Arial Narrow", arial, serif; line-height: 28px;">注:为了避免这些情况,防止有心人监测到重要信息,可以使用SSH,SSL,TSL,HTTPS等加密协议对重要数据进行加密,然后再到网络上传输,如果被人截取下来,看到的内容也是被加密的。</p><p><small> <<a href="http://skypegnu1.blog.51cto.com/8991766/1540728/" style="color: rgb(29, 88, 209); text-decoration-line: none;">http://skypegnu1.blog.51cto.com/8991766/1540728/</a><small>></small></small></p><p><span style="font-size:10px"><span style="line-height: 14px;"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;"><strong>常用到的过滤器规则:</strong></span></span></span></p><p><small><small><span style="margin: 0px; padding: 0px;"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">捕捉过滤器(CaptureFilters):</span></span><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">用于决定将什么样的信息记录在捕捉结果中。需要在开始捕捉前设置。</span><br style="margin: 0px; padding: 0px;"/><span style="margin: 0px; padding: 0px;"><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">显示过滤器(DisplayFilters):</span></span><span data-wiz-span="data-wiz-span" style="font-size: 11pt;">在捕捉结果中进行详细查找。他们可以在得到捕捉结果后随意修改。 </span></small></small></p><p><small><small><br/></small></small></p><p><strong>捕捉过滤器</strong></p><p> </p><p>Protocol(协议):</p><p>可能的值: ether, fddi, ip, arp, rarp, decnet, lat, sca, moprc, mopdl, tcp and udp.</p><p>如果没有特别指明是什么协议,则默认使用所有支持的协议。</p><p> </p><p>Direction(方向):</p><p>可能的值: src, dst, src and dst, src or dst</p><p>如果没有特别指明来源或目的地,则默认使用 “src or dst” 作为关键字。</p><p>例如,”host 10.2.2.2″与”src or dst host 10.2.2.2″是一样的。</p><p> </p><p>Host(s):</p><p>可能的值: net, port, host, portrange.</p><p>如果没有指定此值,则默认使用”host”关键字。</p><p>例如,”src 10.1.1.1″与”src host 10.1.1.1″相同。</p><p> </p><p>Logical Operations(逻辑运算):</p><p>可能的值:not, and, or.</p><p>否(“not”)具有最高的优先级。或(“or”)和与(“and”)具有相同的优先级,运算时从左至右进行。</p><p>例如,</p><p>“not tcp port 3128 and tcp port 23″与”(not tcp port 3128) and tcp port 23″相同。</p><p>“not tcp port 3128 and tcp port 23″与”not (tcp port 3128 and tcp port 23)”不同。</p><p> </p><p>例子:</p><p>tcp dst port 3128 //捕捉目的TCP端口为3128的封包。</p><p>ip src host 10.1.1.1 //捕捉来源IP地址为10.1.1.1的封包。</p><p>host 10.1.2.3 //捕捉目的或来源IP地址为10.1.2.3的封包。</p><p>ether host e0-05-c5-44-b1-3c //捕捉目的或来源MAC地址为e0-05-c5-44-b1-3c的封包。如果你想抓本机与所有外网通讯的数据包时,可以将这里的mac地址换成路由的mac地址即可。</p><p>src portrange 2000-2500 //捕捉来源为UDP或TCP,并且端口号在2000至2500范围内的封包。</p><p>not imcp //显示除了icmp以外的所有封包。(icmp通常被ping工具使用)</p><p>src host 10.7.2.12 and not dst net 10.200.0.0/16 //显示来源IP地址为10.7.2.12,但目的地不是10.200.0.0/16的封包。</p><p>(src host 10.4.1.12 or src net 10.6.0.0/16) and tcp dst portrange 200-10000 and dst net 10.0.0.0/8 //捕捉来源IP为10.4.1.12或者来源网络为10.6.0.0/16,目的地TCP端口号在200至10000之间,并且目的位于网络 10.0.0.0/8内的所有封包。</p><p>src net 192.168.0.0/24</p><p>src net 192.168.0.0 mask 255.255.255.0 //捕捉源地址为192.168.0.0网络内的所有封包。</p><p> </p><p> </p><p><strong>显示过滤器</strong></p><p>例子:</p><p>snmp || dns || icmp //显示SNMP或DNS或ICMP封包。</p><p>ip.addr == 10.1.1.1 //显示来源或目的IP地址为10.1.1.1的封包。</p><p>ip.src != 10.1.2.3 or ip.dst != 10.4.5.6 //显示来源不为10.1.2.3或者目的不为10.4.5.6的封包。</p><p>换句话说,显示的封包将会为:</p><p>来源IP:除了10.1.2.3以外任意;目的IP:任意</p><p>以及</p><p>来源IP:任意;目的IP:除了10.4.5.6以外任意</p><p>ip.src != 10.1.2.3 and ip.dst != 10.4.5.6 //显示来源不为10.1.2.3并且目的IP不为10.4.5.6的封包。</p><p>换句话说,显示的封包将会为:</p><p>来源IP:除了10.1.2.3以外任意;同时须满足,目的IP:除了10.4.5.6以外任意</p><p>tcp.port == 25 //显示来源或目的TCP端口号为25的封包。</p><p>tcp.dstport == 25 //显示目的TCP端口号为25的封包。</p><p>tcp.flags //显示包含TCP标志的封包。</p><p>tcp.flags.syn == 0×02 //显示包含TCP SYN标志的封包。</p><p>如果过滤器的语法是正确的,表达式的背景呈绿色。如果呈红色,说明表达式有误。</p><p><br/></p>
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 4 个查询,用时 0.0020902156829834 秒,PHP脚本用时 0.005819 秒,占用内存 0.855 MB,Gzip 已启用