Wireshark Lab 2:HTTP详解

本文最后更新于:1 年前

Wireshark Lab 2:HTTP详解

写在前面

上一个lab初次接触了wireshark,这一节应该就是对http进行一些抓包加深一下学习。下面的问题我直接用的原文档内容,没翻译,看起来不算吃力。

1. The Basic HTTP GET/response interaction

按照文档中的步骤一步步执行就行,下面放个抓包完成的截图。

图为wireshark界面

1.1 Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?

浏览器和服务器的HTTP版本都是1.1。

1.2 What languages (if any) does your browser indicate that it can accept to the server?

Accept-Language:zh-CN,zh。

1.3 What is the IP address of your computer? Of the gaia.cs.umass.edu server?

计算机的IP地址是192.168.31.101,服务器的IP地址是128.119.245.12。

1.4 What is the status code returned from the server to your browser?

状态码 Status Code: 200

1.5 When was the HTML file that you are retrieving last modified at the server?

问的是文件上次修改的时间 Last-Modified: Thu, 11 Aug 2022 05:59:01 GMT。

1.6 How many bytes of content are being returned to your browser?

返回的字节长度 Content length: 128

1.7 By inspecting the raw data in the packet content window, do you see any headers within the data that are not displayed in the packet-listing window? If so, name one.

有很多header,不列举了。

2. The HTTP CONDITIONAL GET/response interaction

图为wireshark界面

2.1 Inspect the contents of the first HTTP GET request from your browser to the server. Do you see an “IF-MODIFIED-SINCE” line in the HTTP GET?

这一行出现在第二个get请求中,用来表示缓存的。第一个get请求没有。

2.2 Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you tell?

返回文件内容了,data-text-lines里面有显示。

2.3 Now inspect the contents of the second HTTP GET request from your browser to the server. Do you see an “IF-MODIFIED-SINCE:” line in the HTTP GET? If so, what information follows the “IF-MODIFIED-SINCE:” header?

这个前面也提了,出现了。If-Modified-Since: Sun, 14 Aug 2022 05:59:01 GMT\r\n

2.4 What is the HTTP status code and phrase returned from the server in response to this second HTTP GET? Did the server explicitly return the contents of the file? Explain.

Status Code: 304;Response Phrase: Not Modified。没返回文件内容,因为浏览器直接用的上一次的缓存。

3. Retrieving Long Documents 、

图为wireshark界面

3.1 How many HTTP GET request messages did your browser send? Which packet number in the trace contains the GET message for the Bill or Rights?

图上显示是三条,但是第一条是有道的get请求??那应该是1条吧。中间那条是有信息的,是128.119.245.12发出来的。不知道数据包号是什么,答案给的是8。

3.2 Which packet number in the trace contains the status code and phrase associated with the response to the HTTP GET request?

就是与上一问那条get请求相对应的返回请求。答案给的是10。

3.3 What is the status code and phrase in the response?

Status Code: 200;Response Phrase: OK。

3.4 How many data-containing TCP segments were needed to carry the single HTTP response and the text of the Bill of Rights?

没看明白,答案给的三个,分别是10、11、13。

4. HTML Documents with Embedded Objects

图为wireshark界面

4.1 How many HTTP GET request messages did your browser send? To which Internet addresses were these GET requests sent?

从图上看是3条,但是不知为何有两条处于OK状态,这三条应该是一条文字,两条图片。发送给了128.119.245.12和178.79.137.164。

4.2 Can you tell whether your browser downloaded the two images serially, or whether they were downloaded from the two web sites in parallel? Explain.

应该是连续的而不是同时,这样能够提升响应速度。

5. HTTP Authentication

图为wireshark界面

5.1 What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your browser?

输入错误是状态码是401,输入正确时是200。

5.2 When your browser’s sends the HTTP GET message for the second time, what new field is included in the HTTP GET message?

多了认证Authorization和If-Modified。

写在后面

本章就到此结束啦。