Wireshark TS | Packet Challenge 之 DHCP 案例分析

前言

来自于 Sharkfest Packet Challenge 中的一个数据包案例,Sharkfest 是 Wireshark 官方组织的一年一度的大会,致力于在 Wireshark 开发人员和用户社区之间分享知识、经验和最佳实践。印象中早期是一年一次,近几年发展成一年两次,一次貌似固定在美国,一次会在其他地区,像是欧洲或亚洲。Packet Challenge 是大会其中一个比较有意思的活动环节,通过一系列数据包案例设置关卡,参会人员进行分析挑战,测试综合分析能力。


题目信息

本次案例为 Sharkfest 2019 EU Packet Challenge 中的第二个题目 Bad Address,数据包跟踪文件为 BadAddress.pcapng

主要描述如下:

Everybody wants an IP address…

  1. How many unique non-broadcast MAC addresses can be found in the trace?
  2. Why does the filter expression “bootp” give you a warning in Wireshark 3.x and higher?
  3. What is the IP address offered to the client?
  4. Is the IP address accepted?
  5. Why does the client keep requesting an IP address?

数据包信息

数据包跟踪文件基本信息如下:

λ capinfos BadAddress.pcapng                                                          
File name:           BadAddress.pcapng                                                
File type:           Wireshark/... - pcapng                                           
File encapsulation:  Ethernet                                                         
File timestamp precision:  microseconds (6)                                           
Packet size limit:   file hdr: (not set)                                              
Number of packets:   36                                                               
File size:           10 kB                                                            
Data size:           8869 bytes                                                       
Capture duration:    24.192910 seconds                                                
First packet time:   2018-11-24 01:54:36.582252                                       
Last packet time:    2018-11-24 01:55:00.775162                                       
Data byte rate:      366 bytes/s                                                      
Data bit rate:       2932 bits/s                                                      
Average packet size: 246.36 bytes                                                     
Average packet rate: 1 packets/s                                                      
SHA256:              a7b9dd06fc2ae3ec1df76bb67782ec8853130a6a01af9dcd8eecae480f3a9f25 
RIPEMD160:           445dba317fa16d90a6430cdb68f59baa7eb56e7f                         
SHA1:                266f7a89d3887db47da585ac9bd87967c5d141c6                         
Strict time order:   True                                                             
Capture application: Editcap (Wireshark) 3.0.6 (v3.0.6-0-g908c8e357d0f)               
Number of interfaces in file: 1                                                       
Interface #0 info:                                                                    
                     Encapsulation = Ethernet (1 - ether)                             
                     Capture length = 65535                                           
                     Time precision = microseconds (6)                                
                     Time ticks per second = 1000000                                  
                     Number of stat entries = 0                                       
                     Number of packets = 36                                           

通过 Wireshark 捕获,无截断,捕获数据包数量 36 个,捕获持续时间为 24.19 秒,平均速率 2932 bps ,并经过 Editcap 工具编辑过。

会话信息和协议信息显示如下,包括UDP 会话,广播流量,以及 DHCP、ARP 等协议信息。

image.png

image.png

专家信息如下,可以看到 Warning 告警级别信息 Duplicate IP address configured ,说明有冲突 IP 问题。

image.png


数据包分析

展开数据包文件信息,如下,主要为 DHCP 和 ARP 数据包 。

image.png

也可以通过统计 - DHCP(BOOTP) 信息查看 DHCP 消息类型和数量。

image.png

1. How many unique non-broadcast MAC addresses can be found in the trace?

在跟踪文件中可以找到多少个唯一的非广播 MAC 地址?

分析步骤

统计 - Endpoints 信息如下,可知 MAC 地址数量。

image.png

分析答案

在跟踪文件中可以找到多少个唯一的非广播 MAC 地址:3个 。


2. Why does the filter expression “bootp” give you a warning in Wireshark 3.x and higher?

为什么在 Wireshark 3.x 和更高版本下过滤表达式 “bootp” 会给一个警告提示?

分析步骤

显示过滤表达式 bootp 会以黄色显示 。黄色一般表示过滤表达式被接受,但可能无法按预期工作。

image.png

此处其实在状态栏会给出解释,bootp 已经被 dhcp 替代。

image.png

6.4.8. Sometimes Fields Change Names
As protocols evolve they sometimes change names or are superseded by newer standards. For example, DHCP extends and has largely replaced BOOTP and TLS has replaced SSL. If a protocol dissector originally used the older names and fields for a protocol the Wireshark development team might update it to use the newer names and fields. In such cases they will add an alias from the old protocol name to the new one in order to make the transition easier.
For example, the DHCP dissector was originally developed for the BOOTP protocol but as of Wireshark 3.0 all of the “bootp” display filter fields have been renamed to their “dhcp” equivalents. You can still use the old filter names for the time being, e.g., “bootp.type” is equivalent to “dhcp.type” but Wireshark will show the warning ““bootp” is deprecated” when you use it. Support for the deprecated fields may be removed in the future.

显示过滤表达式 dhcp 会以绿色显示,语法正确。

image.png

分析答案

为什么在 Wireshark 3.x 和更高版本下过滤表达式 “bootp” 会给一个警告提示?bootp 协议更新为 dhcp 。


3. What is the IP address offered to the client?

提供给客户端的 IP 地址是什么?

分析步骤

DHCP Offer 信息里可查看到提供给客户端的 IP 地址信息。

image.png

分析答案

提供给客户端的 IP 地址是:172.16.0.100。


4. Is the IP address accepted?

IP 地址是否被接受?

分析步骤

熟悉 DHCP 原理过程和报文的,会清楚客户端并没有接受 IP 地址,原因自然是 IP 地址冲突。

image.png

DHCP DECLINE :当客户端发现服务器分配的 IP 地址无法使用(如 IP 地址冲突时),将发出此报文,通知服务器禁止使用该 IP 地址。

分析答案

IP 地址是否被接受:没有接受。


5. Why does the client keep requesting an IP address?

为什么客户端一直在请求 IP 地址?

分析步骤

和 4 题重复 。。。由于 DHCP 服务器所分配的 IP 地址冲突的原因,客户端没有接受该 IP,因此在持续请求。

image.png

客户端的 MAC 地址:ca:5e:00:00:ca:5e

冲突IP的 MAC 地址:00:0c:29:fd:e3:23

image.png

分析答案

为什么客户端一直在请求 IP 地址?:IP 地址冲突。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值