HTTP_Wireshark

HTTP

1. The Basic HTTP GET/response interaction

在这里插入图片描述在这里插入图片描述

Q&A
  • Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?
    浏览器使用的是HTTP 1.1,因为浏览器发出的GET请求标识了HTTP 1.1协议;服务器使用的也是HTTP 1.1,因为浏览器返回的OK消息标识了HTTP 1.1协议
  • What languages (if any) does your browser indicate that it can accept to the server?
    在Accept-Language一项中能够看到,接收到服务器的语言是zh-CN,zh,即简体中文
  • What is the IP address of your computer? Of the gaia.cs.umass.edu server?
    在上方packet-contents window中的Source一栏中可以看到,GET请求标识的本机IP是114.214.185.251,服务器返回的消息标识的服务器IP是128.119.245.12
  • What is the status code returned from the server to your browser?
    在Info一栏能够看到,服务器返回的状态码是200,表明请求成功且有返回请求的内容
  • When was the HTML file that you are retrieving last modified at the server?
    在服务器返回的消息中,可以找到"Last-Modified:Sun,22 Sep 2019 05:59:01 GMT",即格林尼治时间2019年9月22日05:59:01,星期日
  • How many bytes of content are being returned to your browser?
    在返回消息中能够找到,返回的File Data为128Bytes
  • 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.
    有,例如Content-Length

2. The HTTP CONDITIONAL GET/response interaction

在这里插入图片描述

Q&A
  • 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?
    第一条HTTP GET中没有出现
  • Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you tell?
    第一次服务器有显式返回的文件内容,因为第一次的返回消息中明确给出了Content-Type和Content-Length
  • 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?
    第二次HTTP GET中出现了:"If-Modified-Since: Sun, 22 Sep 2019 05:59:01 GMT\r\n"
  • 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.
    服务器返回"304 Not Modified"。而第二次服务器没有显式地返回文件内容,因为在返回消息中未涉及Content信息。缓存中已经存在,服务器不会再返回内容

3. Retrieving Long Documents

在这里插入图片描述

Q&A
  • How many HTTP GET request messages were sent by your browser?
    浏览器发出了一条GET请求
  • How many data-containing TCP segments were needed to carry the single HTTP response?
    在服务器返回消息的TCP栏中可以看到,共使用了4个Reassembled TCP Segments
  • What is the status code and phrase associated with the response to the HTTP GET request?
    200 OK
  • Are there any HTTP status lines in the transmitted data associated with a TCP induced “Continuation”?
    没有,数据包已经整合所有Segments的内容

4. HTML Documents with Embedded Objects

在这里插入图片描述

Q&A
  • How many HTTP GET request messages were sent by your browser? To which Internet addresses were these GET requests sent?
    浏览器共发出3条GET请求,请求的三条地址均为:128.119.245.12,但三个url不同
  • Can you tell whether your browser downloaded the two images serially, or whether they were downloaded from the two web sites in parallel? Explain.
    In parallel.两条请求独立地发出,独立地下载图片到本机浏览器。因为在第一条GET请求发出后,在第一张图片返回前,第二条GET请求已经发出去了,说明两个图片的请求下载是独立并行的

5. HTTP Authentication

在这里插入图片描述

Q&A
  • What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your browser?
    401 Unauthorized
  • When your browser’s sends the HTTP GET message for the second time, what new field is included in the HTTP GET message?
    第二次的请求信息中添加了Authorization项:
    Authorization: Basic d2lyZXNoYXJrLXN0dWRlbnRzOm5ldHdvcms=\r\n
        Credentials: wireshark-students:network
  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Wireshark是一款开源的网络协议分析工具,支持Windows、Linux和Mac等多个操作系统。它可以捕获和分析网络数据包,帮助用户了解网络通信的细节,包括协议、数据流和错误等。 Java_Wireshark是一个Java编写的Wireshark插件,可以在Wireshark中使用Java代码来处理捕获的数据包。使用Java_Wireshark需要先安装Wireshark和Java,在Wireshark的插件管理中添加Java_Wireshark插件,然后在Java_Wireshark中编写自己的处理逻辑。 下面是一个简单的Java_Wireshark示例,用于计算HTTP请求的数量: ```java import org.wireshark.api.*; import org.wireshark.api.annotations.*; import org.wireshark.api.plugins.*; @WiresharkPlugin(name = "HTTP Request Counter") public class HttpRequestCounter implements IPlugin { private int requestCount = 0; @Override public void run(final IPluginContext context) { final IPacketListener listener = new IPacketListener() { @Override public void onPacket(final IPacket packet) { if (packet.hasProtocol("HTTP")) { requestCount++; System.out.println(String.format("HTTP requests: %d", requestCount)); } } }; context.addPacketListener(listener); } } ``` 这个例子中,我们使用了Wireshark提供的IPacketListener接口来监听捕获的数据包,判断是否包含HTTP协议,并统计请求的数量。通过Wireshark的插件管理,我们可以将这个插件加载到Wireshark中,然后使用它来分析HTTP请求。 需要注意的是,Java_Wireshark是一个比较高级的功能,需要一定的Java编程经验和Wireshark的使用经验。如果您不熟悉Java和Wireshark,建议先学习基础知识再尝试使用Java_Wireshark

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值