wireshark 实验 HTTP

wireshark 实验 HTTP
wireshark 实验 HTTP

Wireshark Lab: HTTP

Version: 2.0 (Sept. 2009)

? 2009 J.F. Kurose, K.W. Ross. All Rights Reserved Computer Networking: A Top-

down Approach, 5th edition .

Having gotten our feet wet with the Wireshark packet sniffer in the introductory lab, we’re now ready to use Wireshark to investigate protocols in operation. In this lab, we’ll explore several aspects of the HTTP protocol: the basic GET/response interaction, HTTP message formats, retrieving large HTML files, retrieving HTML files with embedded objects, and HTTP authentication and security. Before beginning these labs, you might want to review Section 2.2 of the text.

1. The Basic HTTP GET/response interaction

Let’s begin our exploration of HTTP by downloading a very simple HTML file - one that is very short, and contains no embedded objects. Do the following:

1. Start up your web browser.

2. Start up the Wireshark packet sniffer, as described in the Introductory lab (but don’t yet begin packet capture). Enter “http” (just the letters, not the quotation marks) in the display-filter-specification window, so that only captured HTTP messages will be displayed later in the packet-listing window. (We’re only interested in the HTTP protocol here, and don’t want to see the clutter of all captured packets).

3. Wait a bit more than one minute (we’ll see why shortly), and then begin Wireshark packet capture.

4. Enter the following to your browser https://www.360docs.net/doc/1716171856.html,/wireshark-labs/HTTP-wireshark-file1.html

Your browser should display the very simple, one-line HTML file.

5. Stop Wireshark packet capture.

Your Wireshark window should look similar to the window shown in Figure 1. If you are unable to run Wireshark on a live network connection, you can download a packet trace that was created when the steps above were followed.1

1

Download the zip file https://www.360docs.net/doc/1716171856.html,/wireshark-labs/wireshark-traces.zip and extract the file http-ethereal-trace-1. The traces in this zip file were collected by Wireshark running on one of the author’s

Figure 1: Wireshark Display after https://www.360docs.net/doc/1716171856.html,/wireshark-labs/ HTTP-wireshark-file1.html has been retrieved by your browser

The example in Figure 1 shows in the packet-listing window that two HTTP messages were captured: the GET message (from your browser to the https://www.360docs.net/doc/1716171856.html, web server) and the response message from the server to your browser. The packet-contents window shows details of the selected message (in this case the HTTP GET message, which is highlighted in the packet-listing window). Recall that since the HTTP message was carried inside a TCP segment, which was carried inside an IP datagram, which was carried within an Ethernet frame, Wireshark displays the Frame, Ethernet, IP, and TCP packet information as well. We want to minimize the amount of non-HTTP data

computers, while performing the steps indicated in the Wireshark lab. Once you have downloaded the trace, you can load it into Wireshark and view the trace using the File pull down menu, choosing Open, and

then selecting the http-ethereal-trace-1 trace file. The resulting display should look just like Figure 1.

displayed (we’re interested in HTTP here, and will be investigating these other protocols is later labs), so make sure the boxes at the far left of the Frame, Ethernet, IP and TCP information have a plus sign (which means there is hidden, undisplayed information), and the HTTP line has a minus sign (which means that all information about the HTTP message is displayed).

(Note: You should ignore any HTTP GET and response for favicon.ico. If you see a reference to this file, it is your browser automatically asking the server if it (the server) has a small icon file

that should be displayed next to the displayed URL in your browser. We’ll ignore references to

this pesky file in this lab.).

By looking at the information in the HTTP GET and response messages, answer the following questions. When answering the following questions, you should print out the GET and response messages (see the introductory Wireshark lab for an explanation of how to do this) and indicate where in the message you’ve found the information that answers the following questions.

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

server running?

2.What languages (if any) does your browser indicate that it can accept to the

server?

3.What is the IP address of your computer? Of the https://www.360docs.net/doc/1716171856.html, server?

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

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

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

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.

In your answer to question 5 above, you might have been surprised to find that the document you just retrieved was last modified within a minute before you downloaded the document. That’s because (for this particular file), the https://www.360docs.net/doc/1716171856.html, server is setting the file’s last-modified time to be the current time, and is doing so once per minute. Thus, if you wait a minute between accesses, the file will appear to have been recently modified, and hence your browser will download a “new” copy of the document.

2. The HTTP CONDITIONAL GET/response interaction

Recall from Section 2.2.6 of the text, that most web browsers perform object caching and thus perform a conditional GET when retrieving an HTTP object. Before performing the steps below, make sure your browser’s cache is empty. (To do this under Firefox, select Tools->Clear Private Data, or for Internet Explorer, select Tools->Internet Options-

>Delete File; these actions will remove cached files from your browser’s cache.) Now do the following:

?Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.

?Start up the Wireshark packet sniffer

?Enter the following URL into your browser

https://www.360docs.net/doc/1716171856.html,/wireshark-labs/HTTP-wireshark-file2.html

Your browser should display a very simple five-line HTML file.

?Quickly enter the same URL into your browser again (or simply select the refresh button on your browser)

?Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP messages will be displayed later in the

packet-listing window.

?(Note: If you are unable to run Wireshark on a live network connection, you can use the http-ethereal-trace-2 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

Answer the following questions:

8.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?

9.Inspect the contents of the server response. Did the server explicitly return the

contents of the file? How can you tell?

10.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?

11.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.

3. Retrieving Long Documents

In our examples thus far, the documents retrieved have been simple and short HTML files. Let’s next see what happens when we download a long HTML file. Do the following:

?Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.

?Start up the Wireshark packet sniffer

?Enter the following URL into your browser

https://www.360docs.net/doc/1716171856.html,/wireshark-labs/HTTP-wireshark-file3.html

Your browser should display the rather lengthy US Bill of Rights.

?Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP messages will be displayed.

?(Note: If you are unable to run Wireshark on a live network connection, you can use the http-ethereal-trace-3 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

In the packet-listing window, you should see your HTTP GET message, followed by a multiple-packet response to your HTTP GET request. This multiple-packet response deserves a bit of explanation. Recall from Section 2.2 (see Figure 2.9 in the text) that the HTTP response message consists of a status line, followed by header lines, followed by a blank line, followed by the entity body. In the case of our HTTP GET, the entity body in the response is the entire requested HTML file. In our case here, the HTML file is rather long, and at 4500 bytes is too large to fit in one TCP packet. The single HTTP response message is thus broken into several pieces by TCP, with each piece being contained within a separate TCP segment (see Figure 1.24 in the text). Each TCP segment is recorded as a separate packet by Wireshark, and the fact that the single HTTP response was fragmented across multiple TCP packets is indicated by the “Continuation” phrase displayed by Wireshark. We stress here that there is no “Continuation” message in HTTP!

Answer the following questions:

12.How many HTTP GET request messages were sent by your browser?

13.How many data-containing TCP segments were needed to carry the single HTTP

response?

14.What is the status code and phrase associated with the response to the HTTP GET

request?

15.Are there any HTTP status lines in the transmitted data associated with a TCP-

induced “Continuation”?

4. HTML Documents with Embedded Objects

Now that we’ve seen how Wireshark displays the captured packet traffic for large HTML files, we can look at what happens when your browser downloads a file with embedded objects, i.e., a file that includes other objects (in the example below, image files) that are stored on another server(s).

Do the following:

?Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.

?Start up the Wireshark packet sniffer

?Enter the following URL into your browser

https://www.360docs.net/doc/1716171856.html,/wireshark-labs/HTTP-wireshark-file4.html

Your browser should display a short HTML file with two images. These two

images are referenced in the base HTML file. That is, the images themselves are not contained in the HTML; instead the URLs for the images are contained in the downloaded HTML file. As discussed in the textbook, your browser will have to retrieve these logos from the indicated web sites. Our publisher’s logo is

retrieved from the https://www.360docs.net/doc/1716171856.html, web site. The image of our book’s cover is

stored at the https://www.360docs.net/doc/1716171856.html, server.

?Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP messages will be displayed.

?(Note: If you are unable to run Wireshark on a live network connection, you can use the http-ethereal-trace-4 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

Answer the following questions:

16.How many HTTP GET request messages were sent by your browser? To which

Internet addresses were these GET requests sent?

17.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

Finally, let’s try visiting a web site that is password-protected and examine the sequence of HTTP message exchanged for such a site. The URL

https://www.360docs.net/doc/1716171856.html,/wireshark-labs/protected_pages/HTTP-wireshark-file5.html is password protected. The username is “wireshark-students” (without the quotes), and the password is “network” (again, without the quotes). So let’s access this “secure” password-protected site. Do the following:

?Make sure your browser’s cache is cleared, as discussed above, and close down your browser. Then, start up your browser

?Start up the Wireshark packet sniffer

?Enter the following URL into your browser

https://www.360docs.net/doc/1716171856.html,/wireshark-labs/protected_pages/HTTP-wireshark-

file5.html

Type the requested user name and password into the pop up box.

?Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP messages will be displayed later in the

packet-listing window.

?(Note: If you are unable to run Wireshark on a live network connection, you can use the http-ethereal-trace-5 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

Now let’s examine the Wireshark output. You might want to first read up on HTTP authentication by reviewing the easy-to-read material on “HTTP Access Authentication Framework” at https://www.360docs.net/doc/1716171856.html,/stories/storyReader$2159

Answer the following questions:

18.What is the server’s response (status code and phrase) in response to the initial

HTTP GET message from your browser?

19.When your browser’s sends the HTTP GET message for the second time, what

new field is included in the HTTP GET message?

The username (wirehsark-students) and password (network) that you entered are encoded in the string of characters (d2lyZXNoYXJrLXN0dWRlbnRzOm5ldHdvcms=) following the “Authorization: Basic” header in the client’s HTTP GET message. While it may appear that your username and password are encrypted, they are simply encoded in a format known as Base64 format. The username and password are not encrypted! To see this, go to https://www.360docs.net/doc/1716171856.html,/tools/base64.php and enter the base64-encoded string d2lyZXNoYXJrLXN0dWRlbnRz and press decode. Voila! You have translated from Base64 encoding to ASCII encoding, and thus should see your username! To view the password, enter the remainder of the string Om5ldHdvcms= and press decode. Since anyone can download a tool like Wireshark and sniff packets (not just their own) passing by their network adaptor, and anyone can translate from Base64 to ASCII (you just did

it!), it should be clear to you that simple passwords on WWW sites are not secure unless additional measures are taken.

Fear not! As we will see in Chapter 7, there are ways to make WWW access more secure. However, we’ll clearly need something that goes beyond the basic HTTP authentication framework!

Wireshark抓包实验报告.

第一次实验:利用Wireshark软件进行数据包抓取 1.3.2 抓取一次完整的网络通信过程的数据包实验 一,实验目的: 通过本次实验,学生能掌握使用Wireshark抓取ping命令的完整通信过程的数据包的技能,熟悉Wireshark软件的包过滤设置和数据显示功能的使用。 二,实验环境: 操作系统为Windows 7,抓包工具为Wireshark. 三,实验原理: ping是用来测试网络连通性的命令,一旦发出ping命令,主机会发出连续的测试数据包到网络中,在通常的情况下,主机会收到回应数据包,ping采用的是ICMP协议。 四,验步骤: 1.确定目标地址:选择https://www.360docs.net/doc/1716171856.html,作为目标地址。 2.配置过滤器:针对协议进行过滤设置,ping使用的是ICMP协议,抓包前使用捕捉过滤器,过滤设置为icmp,如图 1- 1

图 1-1 3.启动抓包:点击【start】开始抓包,在命令提示符下键入ping https://www.360docs.net/doc/1716171856.html,, 如图 1-2

图 1-2 停止抓包后,截取的数据如图 1-3 图 1-3 4,分析数据包:选取一个数据包进行分析,如图1- 4

图1-4 每一个包都是通过数据链路层DLC协议,IP协议和ICMP协议共三层协议的封装。DLC协议的目的和源地址是MAC地址,IP协议的目的和源地址是IP地址,这层主要负责将上层收到的信息发送出去,而ICMP协议主要是Type和Code来识别,“Type:8,Code:0”表示报文类型为诊断报文的请求测试包,“Type:0,Code:0”表示报文类型为诊断报文类型请正常的包。ICMP提供多种类型的消息为源端节点提供网络额故障信息反馈,报文类型可归纳如下: (1)诊断报文(类型:8,代码0;类型:0代码:0); (2)目的不可达报文(类型:3,代码0-15); (3)重定向报文(类型:5,代码:0--4); (4)超时报文(类型:11,代码:0--1); (5)信息报文(类型:12--18)。

实验一-Wireshark的安装与使用

一、实验目的 1、熟悉并掌握Wireshark的基本使用; 2、了解网络协议实体间进行交互以及报文交换的情况。 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。 三、预备知识 要深入理解网络协议,需要观察它们的工作过程并使用它们,即观察两个协议实体之间交换的报文序列,探究协议操作的细节,使协议实体执行某些动作,观察这些动作及其影响。这种观察可以在仿真环境下或在因特网这样的真实网络环境中完成。 观察正在运行的协议实体间交换报文的基本工具被称为分组嗅探器(packet sniffer),又称分组捕获器。顾名思义,分组嗅探器捕获(嗅探)你的计算机发送和接收的报文。 图显示了一个分组嗅探器的结构。 图分组嗅探器的结构 图右边是计算机上正常运行的协议和应用程序(如:Web浏览器和FTP客户端)。分组嗅探器(虚线框中的部分)主要有两部分组成:第一是分组捕获器,其功能是捕获计算机发送和接收的每一个链路层帧的拷贝;第二个组成部分是分组分析器,其作用是分析并显示协议报文所有字段的内容(它能识别目前使用的各种网络协议)。 Wireshark是一种可以运行在Windows, UNIX, Linux等操作系统上的分组

嗅探器,是一个开源免费软件,可以从下载。 运行Wireshark 程序时,其图形用户界面如图所示。最初,各窗口中并无数据显示。Wireshark 的界面主要有五个组成部分: 命令和菜单 协议筛选框 捕获分组 列表 选定分组 首部明细 分组内容 左:十六进制 右:ASCII码 图 Wireshark 主界面 命令菜单(command menus):命令菜单位于窗口的最顶部,是标准的下拉式菜单。 协议筛选框(display filter specification):在该处填写某种协议的名称,Wireshark据此对分组列表窗口中的分组进行过滤,只显示你需要的分组。 捕获分组列表(listing of captured packets):按行显示已被捕获的分组内容,其中包括:分组序号、捕获时间、源地址和目的地址、协议类型、协议信息说明。单击某一列的列名,可以使分组列表按指定列排序。其中,协议类型是发送或接收分组的最高层协议的类型。 分组首部明细(details of selected packet header):显示捕获分组列表窗口中被选中分组的首部详细信息。包括该分组的各个层次的首部信息,需要查看哪层信息,双击对应层次或单击该层最前面的“+”即可。 分组内容窗口(packet content):分别以十六进制(左)和ASCII码(右)两种格式显示被捕获帧的完整内容。

wireshark抓包分析实验报告

Wireshark抓包分析实验 若惜年 一、实验目的: 1.学习安装使用wireshark软件,能在电脑上抓包。 2.对抓出包进行分析,分析得到的报文,并与学习到的知识相互印证。 二、实验内容: 使用抓包软件抓取HTTP协议通信的网络数据和DNS通信的网络数据,分析对应的HTTP、TCP、IP协议和DNS、UDP、IP协议。 三、实验正文: IP报文分析: 从图中可以看出: IP报文版本号为:IPV4 首部长度为:20 bytes 数据包长度为:40 标识符:0xd74b 标志:0x02 比特偏移:0 寿命:48 上层协议:TCP 首部校验和:0x5c12 源IP地址为:119.75.222.18 目的IP为:192.168.1.108

从图中可以看出: 源端口号:1891 目的端口号:8000 udp报文长度为:28 检验和:0x58d7 数据长度:20 bytes UDP协议是一种无需建立连接的协议,它的报文格式很简单。当主机中的DNS 应用程序想要惊醒一次查询时,它构造一个DNS查询报文段并把它给UDP,不需要UDP之间握手,UDP为报文加上首部字段,将报文段交给网络层。

第一次握手: 从图中看出: 源端口号:56770 目的端口号:80 序列号为:0 首部长为: 32 bytes SYN为1表示建立连接成功当fin为1时表示删除连接。

第二次握手: 从图中看出: 源端口号是:80 目的端口号为:56770 序列号为:0 ack为:1 Acknowledgement为1表示包含确认的报文Syn为1表示建立连接。

第三次握手: 从图中看出: 源端口:56770 目的端口:80 序列号为:1 ACK为:1 首部长为:20bytes Acknowledgement为1表示包含确认的报文 所以,看出来这是TCP连接成功了 Tcp是因特网运输层的面向连接的可靠的运输协议,在一个应用进程可以开始向另一个应用进程发送数据前,这两个进程必须先握手,即它们必须相互发送预备文段,建立确保传输的参数。

计算机网络实验Wireshark

计算机网络实验指导书

目录 实验一Wireshark的安装与使用 (3) 实验二使用Wireshark分析以太网帧与ARP协议 (7) 实验三使用Wireshark分析IP协议 (11) 实验四利用Wireshark分析ICMP (19) 实验五使用Wireshark分析UDP协议 (25) 实验六使用Wireshark分析TCP协议 (29) 实验七利用Wireshark分析协议HTTP (35) 实验八利用Wireshark分析DNS协议 (40) 实验九使用Wireshark分析FTP协议(选作) (44) 实验十使用Wireshark分析SMTP与POP3协议(选作) (48)

实验一Wireshark的安装与使用 一、实验目的 1、熟悉并掌握Wireshark的基本使用; 2、了解网络协议实体间进行交互以及报文交换的情况。 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。 三、预备知识 要深入理解网络协议,需要观察它们的工作过程并使用它们,即观察两个协议实体之间交换的报文序列,探究协议操作的细节,使协议实体执行某些动作,观察这些动作及其影响。这种观察可以在仿真环境下或在因特网这样的真实网络环境中完成。 观察正在运行的协议实体间交换报文的基本工具被称为分组嗅探器(packet sniffer),又称分组捕获器。顾名思义,分组嗅探器捕获(嗅探)您的计算机发送与接收的报文。 图1显示了一个分组嗅探器的结构。 图1 图1右边就是计算机上正常运行的协议与应用程序(如:Web浏览器与FTP客户端)。分组嗅探器(虚线框中的部分)主要有两部分组成:第一就是分组捕获器,其功能就是捕获计算机发送与接收的每一个链路层帧的拷贝;第二个组成部分就是分组分析器,其作用就是分析并显示协议报文所有字段的内容(它能识别目前使用的各种网络协议)。 Wireshark就是一种可以运行在Windows, UNIX, Linux等操作系统上的分组嗅探器,就是一个开源免费软件,可以从、wireshark、org下载。

实验一 wireshark抓包工具使用

实验一wireshark抓包工具使用[实验目的] 学习wireshark抓包工具的使用 了解wireshark抓包工具的功能 通过学习,进一步理解协议及网络体系结构思想 [实验原理] Wireshark是网络包分析工具。网络包分析工具的主要作用是尝试捕获网络包,并尝试显示包的尽可能详细的情况。 主要应用: 网络管理员用来解决网络问题 网络安全工程师用来检测安全隐患 开发人员用来测试协议执行情况 用来学习网络协议 [实验内容] 下载WIRESHARK,学习工具的使用和功能。

Wireshark 是网络包分析工具。网络包分析工具的主要作用是尝试捕获网络包,并尝试显示包的尽可能详细的情况。 你可以把网络包分析工具当成是一种用来测量有什么东西从网线上进出的测量工具,就好像使电工用来测量进入电信的电量的电度表一样。(当然比那个更高级) 过去的此类工具要么是过于昂贵,要么是属于某人私有,或者是二者兼顾。 Wireshark出现以后,这种现状得以改变。 Wireshark可能算得上是今天能使用的最好的开元网络分析软件。 工作流程 (1)确定Wireshark的位置。如果没有一个正确的位置,启动Wireshark后会花费很长的时间捕获一些与自己无关的数据。 (2)选择捕获接口。一般都是选择连接到Internet网络的接口,这样才可以捕获到与网络相关的数据。否则,捕获到的其它数据对自己也没有任何帮助。 (3)使用捕获过滤器。通过设置捕获过滤器,可以避免产生过大的捕获文件。这样用户在分析数据时,也不会受其它数据干扰。而且,还可以为用户节约大量的时间。 (4)使用显示过滤器。通常使用捕获过滤器过滤后的数据,往往还是很复杂。为了使过滤的数据包再更细致,此时使用显示过滤器进行过滤。 (5)使用着色规则。通常使用显示过滤器过滤后的数据,都是有用的数据包。如果想更加突出的显示某个会话,可以使用着色规则高亮显示。 (6)构建图表。如果用户想要更明显的看出一个网络中数据的变化情况,使用图表的 形式可以很方便的展现数据分布情况。

wireshark 实验 DHCP

Wireshark Lab: DHCP Version: 2.0 ? 2007 J.F. Kurose, K.W. Ross. All Rights Reserved Computer Networking: A Top-down Approach, 4th edition. In this lab, we’ll take a quick look at DHCP. Recall that DHCP is used extensively in corporate, university and home-network wired and wireless LANs to dynamically assign IP addresses to hosts (as well as to configure other network configuration information). This lab is brief, as we’ll only examine the DHCP packets captured by a host. If you also have administrative access to your DHCP server, you may want to repeat this lab after making some configuration changes (such as the lease time). If you have a router at home, you most likely can configure your DHCP server. Because many linux/Unix machines (especially those that serve many users) have a static IP address and because manipulating DHCP on such machines typically requires super-user privileges, we’ll only present a Windows version of this lab below. DHCP Experiment In order to observe DHCP in action, we’ll perform several DHCP-related commands and capture the DHCP messages exchanged as a result of executing these commands. Do the following1: 1.Begin by opening the Windows Command Prompt application (which can be found in your Accessories folder). As shown in Figure 1, enter “ipconfig /release”. The executable for ipconfig is in C:\windows\system32. This command releases your current IP address, so that your host’s IP address becomes 0.0.0.0. 1If you are unable to run Wireshark live on a computer, you can download the zip file https://www.360docs.net/doc/1716171856.html,/wireshark-labs/wireshark-traces.zip and extract the file dhcp-ethereal-trace-1. The traces in this zip file were collected by Wireshark running on one of the author’s computers, while performing the steps indicated in the Wireshark lab. Once you have downloaded the trace, you can load it into Wireshark and view the trace using the File pull down menu, choosing Open, and then selecting the dhcp-ethereal-trace-1 trace file. You can then use this trace file to answer the questions below.

wireshark 实验 HTTP

Wireshark Lab: HTTP Version: 2.0 (Sept. 2009) ? 2009 J.F. Kurose, K.W. Ross. All Rights Reserved Computer Networking: A Top- down Approach, 5th edition . Having gotten our feet wet with the Wireshark packet sniffer in the introductory lab, we’re now ready to use Wireshark to investigate protocols in operation. In this lab, we’ll explore several aspects of the HTTP protocol: the basic GET/response interaction, HTTP message formats, retrieving large HTML files, retrieving HTML files with embedded objects, and HTTP authentication and security. Before beginning these labs, you might want to review Section 2.2 of the text. 1. The Basic HTTP GET/response interaction Let’s begin our exploration of HTTP by downloading a very simple HTML file - one that is very short, and contains no embedded objects. Do the following: 1. Start up your web browser. 2. Start up the Wireshark packet sniffer, as described in the Introductory lab (but don’t yet begin packet capture). Enter “http” (just the letters, not the quotation marks) in the display-filter-specification window, so that only captured HTTP messages will be displayed later in the packet-listing window. (We’re only interested in the HTTP protocol here, and don’t want to see the clutter of all captured packets). 3. Wait a bit more than one minute (we’ll see why shortly), and then begin Wireshark packet capture. 4. Enter the following to your browser https://www.360docs.net/doc/1716171856.html,/wireshark-labs/HTTP-wireshark-file1.html Your browser should display the very simple, one-line HTML file. 5. Stop Wireshark packet capture. Your Wireshark window should look similar to the window shown in Figure 1. If you are unable to run Wireshark on a live network connection, you can download a packet trace that was created when the steps above were followed.1 1 Download the zip file https://www.360docs.net/doc/1716171856.html,/wireshark-labs/wireshark-traces.zip and extract the file http-ethereal-trace-1. The traces in this zip file were collected by Wireshark running on one of the author’s

Wireshark抓包实验报告

西安郵電學院 计算机网络技术及应用实验 报告书 系部名称:管理工程学院学生姓名:xxx 专业名称:信息管理 班级:10xx 学号:xxxxxxx 时间:2012 年x 月x 日

实验题目Wireshark抓包分析实验 一、实验目的 1、了解并会初步使用Wireshark,能在所用电脑上进行抓包 2、了解IP数据包格式,能应用该软件分析数据包格式 3、查看一个抓到的包的内容,并分析对应的IP数据包格式 二、实验内容 1、安装Wireshark,简单描述安装步骤。 2、打开wireshark,选择接口选项列表。或单击“Capture”,配置“option” 选项。 3、设置完成后,点击“start”开始抓包,显示结果。 4、选择某一行抓包结果,双击查看此数据包具体结构。 5、捕捉IP数据报。 ①写出IP数据报的格式。 ②捕捉IP数据报的格式图例。 ③针对每一个域所代表的含义进行解释。 三、实验内容(续,可选) 1、捕捉特定内容 捕捉内容:http 步骤:①在wireshark软件上点开始捕捉。 ②上网浏览网页。 ③找到包含http格式的数据包,可用Filter进行设置,点击 中的下拉式按钮,选择http。 ④在该数据帧中找到Get 的内容。 实验体会

Wireshark抓包分析实验报告 一.实验目的 1.了解并初步使用Wireshark,能在所用电脑上进行抓包。 2.了解IP数据包格式,能应用该软件分析数据包格式。 3.查看一个抓到的包的内容,并分析对应的IP数据包格式。 二.主要仪器设备 协议分析软件Wireshark,联网的PC机。 三.实验原理和实验内容 1 安装WireShark。这个不用说了,中间会提示安装WinPcap,一切都是默认的了

wireshark 实验 Getting Started

Wireshark Lab: Getting Started Version: 2.0 ? 2007 J.F. Kurose, K.W. Ross. All Rights Reserved Computer Networking: A Top-down Approach, 4th edition. “Tell me and I forget. Show me and I remember. Involve me and I understand.” Chinese proverb One’s understanding of network protocols can often be greatly deepened by “seeing protocols in action” and by “playing around with protocols” – observing the sequence of messages exchanged between two protocol entities, delving down into the details of protocol operation, and causing protocols to perform certain actions and then observing these actions and their consequences. This can be done in simulated scenarios or in a “real” network environment such as the Internet. The Java applets that accompany this text take the first approach. In these Wireshark labs1, we’ll take the latter approach. You’ll be running various network applications in different scenarios using a computer on your desk, at home, or in a lab. You’ll observe the network protocols in your computer “in action,” interacting and exchanging messages with protocol entities executing elsewhere in the Internet. Thus, you and your computer will be an integral part of these “live” labs. You’ll observe, and you’ll learn, by doing. The basic tool for observing the messages exchanged between executing protocol entities is called a packet sniffer. As the name suggests, a packet sniffer captures (“sniffs”) messages being sent/received from/by your computer; it will also typically store and/or display the contents of the various protocol fields in these captured messages. A packet sniffer itself is passive. It observes messages being sent and received by applications and protocols running on your computer, but never sends packets itself. Similarly, received packets are never explicitly addressed to the packet sniffer. Instead, a packet sniffer receives a copy of packets that are sent/received from/by application and protocols executing on your machine. 1 Earlier versions of these labs used the Ethereal packet analyzer. In May 2006, the developer of Ethereal joined a new company, and had to leave the Ethereal? trademarks behind. He then created the Wireshark network protocol analyzer, a successor to Ethereal?. Since Ethereal? is no longer being actively maintained or developed, we have thus switched these labs over to Wireshark with the 4th edition of our text.

实验1_ Wireshark使用

实验一Wireshark使用 一、实验目的 1、熟悉并掌握Wireshark的基本使用; 2、了解网络协议实体间进行交互以及报文交换的情况。 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。 三、预备知识 要深入理解网络协议,需要观察它们的工作过程并使用它们,即观察两个协议实体之间交换的报文序列,探究协议操作的细节,使协议实体执行某些动作,观察这些动作及其影响。这种观察可以在仿真环境下或在因特网这样的真实网络环境中完成。 观察正在运行的协议实体间交换报文的基本工具被称为分组嗅探器(packet sniffer),又称分组捕获器。顾名思义,分组嗅探器捕获(嗅探)你的计算机发送和接收的报文。 图1显示了一个分组嗅探器的结构。 图1 图1右边是计算机上正常运行的协议和应用程序(如:Web浏览器和FTP客户端)。分组嗅探器(虚线框中的部分)主要有两部分组成:第一是分组捕获器,其功能是捕获计算机发送和接收的每一个链路层帧的拷贝;第二个组成部分是分组分析器,其作用是分析并显示协议报文所有字段的内容(它能识别目前使用的各种网络协议)。 Wireshark是一种可以运行在Windows, UNIX, Linux等操作系统上的分组嗅探器,是一个开源免费软件,可以从https://www.360docs.net/doc/1716171856.html,下载。

运行Wireshark 程序时,其图形用户界面如图2所示。最初,各窗口中并无数据显示。Wireshark 的界面主要有五个组成部分: 图2 ● 命令菜单(command menus ):命令菜单位于窗口的最顶部,是标准的下拉式菜单。 ● 协议筛选框(display filter specification ):在该处填写某种协议的名称,Wireshark 据此对分组列表窗口中的分组进行过滤,只显示你需要的分组。 ● 捕获分组列表(listing of captured packets ):按行显示已被捕获的分组内容,其中包括:分组序号、捕获时间、源地址和目的地址、协议类型、协议信息说明。单击某一列的列名,可以使分组列表按指定列排序。其中,协议类型是发送或接收分组的最高层协议的类型。 ● 分组首部明细(details of selected packet header ):显示捕获分组列表窗口中被选中分组的首部详细信息。包括该分组的各个层次的首部信息,需要查看哪层信息,双击对应层次或单击该层最前面的“+”即可。 ● 分组内容窗口(packet content ):分别以十六进制(左)和ASCII 码(右)两种格式显示被捕获帧的完整内容。 四、实验步骤 命令和菜单 协议筛选框 捕获分组 列表 选定分组 首部明细 分组内容 左:十六进制 右:ASCII 码

实验一、Wireshark报文捕捉实验---

实验一Wireshark报文捕捉实验 一、实验目的 1.掌握Wireshark抓包软件的基本使用方法; 2.使用Wireshark抓取Telnet的数据报,分析IP头结构; 3.使用Wireshark抓取Telnet的数据报,分析TCP头的结构、分析TCP的“三 次握手”和“四次挥手”的过程。 二、实验环境 1.运行Windows的PC机; 2.Wireshark软件; 3.Winpcap软件。 三、实验原理 1.IP头结构; IP包头长度(Header Length):长度4比特。这个字段的作用是为了描述IP包头的长度,因为在IP包头中有变长的可选部分。该部分占4个bit位,单位为32bit(4个字节),即本区域值= IP头部长度(单位为bit)/(8*4),因此,一个IP包头的长度最长为“1111”,即15*4=60个字节。IP包头最小长度为20字节。 2.TCP的“三次握手”和“四次挥手”的过程。 TCP三次握手 所谓三次握手(Three-way Handshake),是指建立一个TCP连接时,需要客户端和服务器总共发送3个包。 三次握手的目的是连接服务器指定端口,建立TCP连接,并同步连接双方的序列号和确认号并交换TCP 窗口大小信息.在socket编程中,客户端执行connect()时。将触发三次握手。

?第一次握手: 客户端发送一个TCP的SYN标志位置1的包指明客户打算连接的服务器的端口,以及初始序号X,保存在包头的序列号(Sequence Number)字段里。 ?第二次握手: 服务器发回确认包(ACK)应答。即SYN标志位和ACK标志位均为1同时,将确认序号(Acknowledgement Number)设置为客户的I S N加1以.即X+1。 ?第三次握手. 客户端再次发送确认包(ACK) SYN标志位为0,ACK标志位为1.并且把服务器发来ACK的序号字段+1,放在确定字段中发送给对方.并且在数据段放写ISN的+1 TCP 四次挥手

实验六_利用Wireshark分析协议HTTP

实验六利用Wireshark分析协议HTTP 一、实验目的 分析HTTP协议 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。 三、实验步骤 1、利用Wireshark俘获HTTP分组 (1)在进行跟踪之前,我们首先清空Web 浏览器的高速缓存来确保Web网页是从网络中获取的,而不是从高速缓冲中取得的。之后,还要在客户端清空DNS高速缓存,来确保Web服务器域名到IP地址的映射是从网络中请求。在WindowsXP机器上,可在命令提示行输入ipconfig/flushdns(清除DNS解析程序缓存)完成操作。 (2)启动Wireshark 分组俘获器。 (3)在Web 浏览器中输入:https://www.360docs.net/doc/1716171856.html, (4)停止分组俘获。 图1.1 利用Wireshark俘获的HTTP分组 在URL https://www.360docs.net/doc/1716171856.html,中,https://www.360docs.net/doc/1716171856.html,是一个具体的web 服务器的域名。最前面有两个DNS分组。第一个分组是将域名https://www.360docs.net/doc/1716171856.html,

转换成为对应的IP 地址的请求,第二个分组包含了转换的结果。这个转换是必要的,因为网络层协议——IP协议,是通过点分十进制来表示因特网主机的,而不是通过https://www.360docs.net/doc/1716171856.html,这样的域名。当输入URL http://https://www.360docs.net/doc/1716171856.html, 时,将要求Web服务器从主机https://www.360docs.net/doc/1716171856.html,上请求数据,但首先Web浏览器必须确定这个主机的IP地址。 随着转换的完成,Web浏览器与Web服务器建立一个TCP连接。最后,Web 浏览器使用已建立好的TCP连接来发送请求“GET/HTTP/1.1”。这个分组描述了要求的行为(“GET”)及文件(只写“/”是因为我们没有指定额外的文件名),还有所用到的协议的版本(“HTTP/1.1”)。 2、HTTP GET/response交互 (1)在协议框中,选择“GET/HTTP/1.1” 所在的分组会看到这个基本请求行后跟随着一系列额外的请求首部。在首部后的“\r\n”表示一个回车和换行,以此将该首部与下一个首部隔开。 “Host”首部在HTTP1.1版本中是必须的,它描述了URL中机器的域名,本例中是https://www.360docs.net/doc/1716171856.html,。这就允许了一个Web服务器在同一时间支持许多不同的域名。有了这个数不,Web服务器就可以区别客户试图连接哪一个Web服务器,并对每个客户响应不同的内容,这就是HTTP1.0到1.1版本的主要变化。 User-Agent首部描述了提出请求的Web浏览器及客户机器。 接下来是一系列的Accpet首部,包括Accept(接受)、Accept-Language (接受语言)、Accept-Encoding(接受编码)、Accept-Charset(接受字符集)。它们告诉Web服务器客户Web浏览器准备处理的数据类型。Web服务器可以将数据转变为不同的语言和格式。这些首部表明了客户的能力和偏好。 Keep-Alive及Connection首部描述了有关TCP连接的信息,通过此连接发送HTTP请求和响应。它表明在发送请求之后连接是否保持活动状态及保持多久。大多数HTTP1.1连接是持久的(persistent),意思是在每次请求后不关闭TCP 连接,而是保持该连接以接受从同一台服务器发来的多个请求。 (2)我们已经察看了由Web浏览器发送的请求,现在我们来观察Web服务器的回答。响应首先发送“HTTP/1.1 200 ok”,指明它开始使用HTTP1.1版本来发送网页。同样,在响应分组中,它后面也跟随着一些首部。最后,被请求的实际数据被发送。

实验使用Wireshark分析UDP

实验六使用W i r e s h a r k分析U D P 一、实验目的 比较TCP和UDP协议的不同 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。 三、实验步骤 1、打开两次TCP流的有关跟踪记录,保存在tcp_2transmit.cap中,并打开两次UDP 流中的有关跟踪文件udp_2transmit.cap 。如图所示: 图1:TCP 流跟踪记录 图2:UDP流跟踪记录 2、分析此数据包: (1)TCP传输的正常数据: tcp_2transmit.cap文件的分组1到13中显示了TCP连接。这个流中的大部分信息与前面的实验相同。我们在分组1到分组3中看到了打开连接的三次握手。分组10到分组13显示的则是连接的终止。我们看到分组10既是一个带有FIN标志的请求终止连接的分组,又是一个最后1080个字节的(序号是3921—5000)的重传。 TCP将应用程序写入合并到一个字节流中。它并不会尝试维持原有应用程序写人的边界值。我们注意到TCP并不会在单个分组中传送1000字节的应用程序写入。前1000个字节会在分组4种被发送,而分组5则包含了1460个字节的数据-----一些来自第二个缓冲区,而另一些来自第三个缓冲区。分组7中含有1460个字节而分组8中则包含剩余的1080个字节。(5000-1000-1460-1460=1080) 我们注意到实际报告上的2.48秒是从初始化连接的分组1开始到关闭连接的分组10结束。分组11—13未必要计入接收端应用程序的时间内,因为一旦接收到第一个FIN,TCP 层便马上发送一个关闭连接的信号。分组11—13只可能由每台计算机操作系统得TCP层后台传输。 如果我们注意到第一个包含数据的分组4和最后一个分组8之间的时间,我们就大约计算出和由UDP接收端所报告的0.01秒相同的时间。这样的话,增加TCP传输时间的主

wireshark 实验 TCP

Wireshark Lab: TCP Version: 2.0 ? 2007 J.F. Kurose, K.W. Ross. All Rights Reserved Computer Networking: A Top-down Approach, 4th edition. In this lab, we’ll investigate the behavior of TCP in detail. We’ll do so by analyzing a trace of the TCP segments sent and received in transferring a 150KB file (containing the text of Lewis Carrol’s Alice’s Adventures in Wonderland) from your computer to a remote server. We’ll study TCP’s use of sequence and acknowledgement numbers for providing reliable data transfer; we’ll see TCP’s congestion control algorithm – slow start and congestion avoidance – in action; and we’ll look at TCP’s receiver-advertised flow control mechanism. We’ll also briefly consider TCP connection setup and we’ll investigate the performance (throughput and round-trip time) of the TCP connection between your computer and the server. Before beginning this lab, you’ll probably want to review sections 3.5 and 3.7 in the text.1 1. Capturing a bulk TCP transfer from your computer to a remote server Before beginning our exploration of TCP, we’ll need to use Wireshark to obtain a packet trace of the TCP transfer of a file from your computer to a remote server. You’ll do so by accessing a Web page that will allow you to enter the name of a file stored on your computer (which contains the ASCII text of Alice in Wonderland), and then transfer the file to a Web server using the HTTP POST method (see section 2.2.3 in the text). We’re using the POST method rather than the GET method as we’d like to transfer a large amount of data from your computer to another computer. Of course, we’ll be running Wireshark during this time to obtain the trace of the TCP segments sent and received from your computer. 1 All references to the text in this lab are to Computer Networking: A Top-down Approach, 4th edition.

相关文档
最新文档