前言
来自于 Sharkfest Packet Challenge 中的一个数据包案例,Sharkfest 是 Wireshark 官方组织的一年一度的大会,致力于在 Wireshark 开发人员和用户社区之间分享知识、经验和最佳实践。印象中早期是一年一次,近几年发展成一年两次,一次貌似固定在美国,一次会在其他地区,像是欧洲或亚洲。Packet Challenge 是大会其中一个比较有意思的活动环节,通过一系列数据包案例设置关卡,参会人员进行分析挑战,测试综合分析能力。
题目信息
本次案例为 Sharkfest 2019 EU Packet Challenge 中的第一个题目 Some HTTP,数据包跟踪文件为 SomeHTTP.pcapng 。
主要描述如下:
Something to get you warmed up.
- What is the server IP address?
- What is the hostname of the website requested by the browser?
- What is the HTTP status code given by the web server?
- What is the FQDN of the location the web server redirects to?
- How many packets have a FIN flag set?
确实如 Something to get you warmed up 形容,本题真的挺简单。
数据包信息
数据包跟踪文件基本信息如下:
λ capinfos SomeHTTP.pcapng
File name: SomeHTTP.pcapng
File type: Wireshark/... - pcapng
File encapsulation: Ethernet
File timestamp precision: microseconds (6)
Packet size limit: file hdr: (not set)
Number of packets: 8
File size: 1708 bytes
Data size: 1105 bytes
Capture duration: 2.409586 seconds
First packet time: 2014-03-04 01:19:57.323591
Last packet time: 2014-03-04 01:19:59.733177
Data byte rate: 458 bytes/s
Data bit rate: 3668 bits/s
Average packet size: 138.13 bytes
Average packet rate: 3 packets/s
SHA256: 59c3cb5bf2b529696e719088935b9911ba8b2666d4cb8c878317c0db8d6ba8b6
RIPEMD160: 5bba0f38317692a8ff1e5efe4430450366fe1c51
SHA1: 7315e55f08c58a06ba142f12c020055ecb5bd62b
Strict time order: True
Capture comment: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9848
Number of interfaces in file: 1
Interface #0 info:
Name = \Device\NPF_{1859BC84-0689-4EE4-9F7F-85D093A8F58B}
Encapsulation = Ethernet (1 - ether)
Capture length = 65535
Time precision = microseconds (6)
Time ticks per second = 1000000
Time resolution = 0x06
Operating system = 32-bit Windows 7 Service Pack 1, build 7601
Number of stat entries = 1
Number of packets = 8
Winows 7 系统上直接通过 Wireshark 捕获,无截断,捕获数据包数量 8 个,捕获持续时间为 2.4 秒,平均速率 3668 bps 。
会话信息和专家信息显示如下,仅一条 TCP 流 0 ,服务端 HTTP 80 端口,无告警级别信息,基本正常。
数据包分析
展开数据包文件信息,如下,
1. What is the server IP address?
服务器 IP 地址是什么?
分析步骤
步骤无,答案一目了然。
分析答案
服务器 IP 地址是:212.58.246.91 。
2. What is the hostname of the website requested by the browser?
浏览器请求的网站的主机名是什么?
分析步骤
客户端 No.4 HTTP GET 请求,展开数据包细节如下
λ tshark -r SomeHTTP.pcapng -Y "http.host"
4 0.806199 10.0.2.4 → 212.58.246.91 HTTP 499 GET / HTTP/1.1
λ tshark -r SomeHTTP.pcapng -Y "http.host" -T fields -e http.host
www.bbc.co.uk
分析答案
浏览器请求的网站的主机名是:www.bbc.co.uk 。
3. What is the HTTP status code given by the web server?
Web 服务器给出的 HTTP 状态码是什么?
分析步骤
服务器端 No.5 HTTP Response 响应,展开数据包细节如下
λ tshark -r SomeHTTP.pcapng -Y "http.response.code"
5 1.609608 212.58.246.91 → 10.0.2.4 HTTP 252 HTTP/1.1 302 Found (text/html)
λ tshark -r SomeHTTP.pcapng -Y "http.response.code" -T fields -e http.response.code
302
分析答案
Web 服务器给出的 HTTP 状态码是:302 。
4. What is the FQDN of the location the web server redirects to?
Web 服务器重定向到的位置的 FQDN 是什么?
分析步骤
同样还是服务器端 No.5 HTTP Response 响应,展开数据包细节如下
λ tshark -r SomeHTTP.pcapng -Y "http.location"
5 1.609608 212.58.246.91 → 10.0.2.4 HTTP 252 HTTP/1.1 302 Found (text/html)
λ tshark -r SomeHTTP.pcapng -Y "http.location" -T fields -e http.location
https://hotspot.inmarsat.com/index?origUrl=http%3A%2F%2Fwww.bbc.co.uk%2F
λ tshark -r SomeHTTP.pcapng -Y "http.location" -T fields -e http.location | awk -F "/" '{print $3}'
hotspot.inmarsat.com
分析答案
Web 服务器重定向到的位置的 FQDN 是:hotspot.inmarsat.com。
5. How many packets have a FIN flag set?
有多少数据包设置了 FIN 标志位?
分析步骤
通过显示过滤表达式 tcp.flags.fin==1
可知
λ tshark -r SomeHTTP.pcapng -Y "tcp.flags.fin==1" | wc -l
2
分析答案
有多少数据包设置有 FIN 标志位:2 个。