标签:
分析所用软件下载:Wireshark-win32-1.10.2.exe
阅读导览
1. 分析应用TCP协议,以及TCP链接管理
2. 分析应用UDP协议
分析要求
(1)TCP部分:
(2)UDP部分:
分析内容
(1)TCP部分:
下载安装3CDaemon软件并配置FTP服务器部分
使用3CDaemon 系统内置的匿名帐户 "anonymous"登陆FTP 服务器以获取TCP报文
分析见第四部分
(2)UDP部分:
配置Cisco TFTP Server
使用Windows 命令行模式下的TFTP 客户端命令连接TFTP服务器,下载f1.txt文件:
TFTP –i 172.18.3.188 GET f1.txt
上传f2.txt文件:
TFTP -i 172.18.3.188 PUT f2.txt
同时抓包以获取UDP报文
分析见第四部分
分析结果及总结
1. 获取并分析tcp报文
(1)登录ftp服务器:172.18.3.154建立TCP连接的SYN报文:
07a200151ea58e8f000000008002ffff5ad20000020405b40103030301010402
源端口:07a2
Source port: abr-api (1954)
目的端口:0015
Destination port: ftp (21)
序号:1e a5 8e 8f
Sequence number: 0 (relative sequence number)
首部长度:8
Header length: 32 bytes
码元比特:02
Flags: 0x002 (SYN)
窗口:ff ff
Window size value: 65535
Calculated window size: 65535
校验和:5ad2
Checksum: 0x5ad2 [validation disabled]
选项:02 04 05 b4 01 03 03 03 01 01 04 02
Options: (12 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), SACK permitted
(2)登录ftp服务器:172.18.3.154建立TCP连接的SYN+ACK报文:
00e04c512b4e00e04c500ff9080045000034287040004006b2fcac12039aac120399001507a263bcdaf71ea58e908012ffff1c0d0000020405b40103030301010402
源端口:00 15
Source port: ftp (21)
目的端口:07 a2
Destination port: abr-api (1954)
序号:63 bc da f7
Sequence number: 0 (relative sequence number)
确认号:1e a5 8e 90
Acknowledgment number: 1 (relative ack number)
首部长度:8
Header length: 32 bytes
码元比特:12
Flags: 0x012 (SYN, ACK)
窗口:ff ff
Window size value: 65535
Calculated window size: 65535
校验和:1c 0d
Checksum: 0x1c0d [validation disabled]
选项:020405b40103030301010402
Options: (12 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), SACK permitted
(3)登录ftp服务器:172.18.3.154建立TCP连接的第二个ACK报文:
07a200151ea58e9063bcdaf85010b5c9a7110000
源端口:07a2
Source port: abr-api (1954)
目的端口:0015
Destination port: ftp (21)
序号:1e a5 8e 90
Sequence number: 1 (relative sequence number)
确认号:63 bc da f8
Acknowledgment number: 1 (relative ack number)
首部长度:5
Header length: 20 bytes
码元比特:10
Flags: 0x010 (ACK)
窗口:b5 c9
Window size value: 46537
Calculated window size: 372296
Window size scaling factor: 8
校验和:a7 11
Checksum: 0xa711 [validation disabled]
(4)ftp服务器:172.18.3.154断开TCP连接的FIN+ACK seq=x报文:
00e04c512b4e00e04c500ff908004500002854fb40004006867dac12039aac12039900150966cb76f9c531de53865011b5b846a70000000000000000
源端口:00 15
Source port: ftp (21)
目的端口:09 66
Destination port: jediserver (2406)
序号:cb 76 f9 c5
Sequence number: 437 (relative sequence number)
确认号:31 de 53 86
Acknowledgment number: 135 (relative ack number)
首部长度:5
Header length: 20 bytes
码元比特:11
Flags: 0x011 (FIN, ACK)
窗口:b5 b8
Window size value: 46520
Calculated window size: 372160
Window size scaling factor: 8
校验和:46 a7
Checksum: 0x46a7 [validation disabled]
(5)ftp服务器:172.18.3.154断开TCP连接的ACK x+1报文:
0966001531de5386cb76f9c65010b59346cc0000
源端口:09 66
Source port: jediserver (2406)
目的端口:00 15
Destination port: ftp (21)
序号:31 de 53 86
Sequence number: 135 (relative sequence number)
确认号:cb 76 f9 c6
Acknowledgment number: 438 (relative ack number)
首部长度:5
Header length: 20 bytes
码元比特:10
Flags: 0x010 (ACK)
窗口:b5 93
Window size value: 46483
Calculated window size: 371864
Window size scaling factor: 8
校验和:46 cc
Checksum: 0x46cc [validation disabled]
(6)ftp服务器:172.18.3.154断开TCP连接的FIN seq =y ,ACK +1报文:
0966001531de5386cb76f9c65011b59346cb0000
源端口:09 66
Source port: jediserver (2406)
目的端口:00 15
Destination port: ftp (21)
序号:31 de 53 86
Sequence number: 135 (relative sequence number)
确认号:cb 76 f9 c6
Acknowledgment number: 438 (relative ack number)
首部长度:5
Header length: 20 bytes
码元比特:11
Flags: 0x011 (FIN, ACK)
窗口:b5 93
Window size value: 46483
Calculated window size: 371864
Window size scaling factor: 8
校验和:46 cb
Checksum: 0x46cb [validation disabled]
(7)ftp服务器:172.18.3.154断开TCP连接的ACK y+1报文:
00e04c512b4e00e04c500ff908004500002854fc40004006867cac12039aac12039900150966cb76f9c631de53875010b5b846a60000000000000000
源端口:00 15
Source port: ftp (21)
目的端口:09 66
Destination port: jediserver (2406)
序号:cb 76 f9 c6
Sequence number: 438 (relative sequence number)
确认号:31 de 53 87
Acknowledgment number: 136 (relative ack number)
首部长度:5
Header length: 20 bytes
码元比特:10
Flags: 0x010 (ACK)
窗口:b5 b8
Window size value: 46520
Calculated window size: 372160
Window size scaling factor: 8
校验和:46 a6
Checksum: 0x46a6 [validation disabled]
对于TCP连接建立过程:
客户端发送序号为x的SYN报文,服务器接收后发送序号为y的SYN与序号为x+1 的ACK 报文,客户端接收后,发送序号为y+1的ACK报文,TCP以此顺序建立三次握手。
对于TCP连接的正常关闭:
网点1发送序号为x的FIN报文,网点2接收后发送序号为x+1的ACK 报文,网点2再发送序号为y的FIN与序号为x+1的ACK报文,网点1接收后发送序号为y+1的ACK报文,网点2接收该报文,连接正常关闭,此为改进的三次握手方法。
2. 获取并分析UDP报文
(1)TFTP –i 172.18.3.188 GET f1.txt的第一个UDP报文:
0c3e00450017bd5c
源端口:0c 3e
Source Port: 3134 (3134)
目的端口:0045
Destination Port: 69 (69)
报文长度:00 17
Length: 23
校验和:bd 5c
Checksum: 0xbd5c [validation disabled]
数据为TFTP报文
(2)TFTP –i 172.18.3.188 GET f1.txt的第二个UDP报文:
09f30c3e001b8124
源端口:09 f3
Source Port: 2547 (2547)
目的端口:0c3e
Destination Port: 3134 (3134)
报文长度:00 1b
Length: 27
校验和:81 24
Checksum: 0x8124 [validation disabled]
数据为TFTP报文
(3)TFTP –i 172.18.3.188 GET f1.txt的第三个UDP报文:
0c3e09f3000c8a32
源端口:0c 3e
Source Port: 3134 (3134)
目的端口:09 f3
Destination Port: 2547 (2547)
报文长度:00 0c
Length: 12
校验和:8a 32
Checksum: 0x8a32 [validation disabled]
数据为TFTP报文
(4)TFTP –i 172.18.3.188 PUT f2.txt的第一个UDP报文:
0d1d00450017bc7b
源端口:0d 1d
Source Port: 3357 (3357)
目的端口:00 45
Destination Port: 69 (69)
报文长度:00 17
Length: 23
校验和:bc 7b
Checksum: 0xbc7b [validation disabled]
数据为TFTP报文
(5)TFTP –i 172.18.3.188 PUT f2.txt的第二个UDP报文:
0b410d1d000c8806
源端口:0b 41
Source Port: 2881 (2881)
目的端口:0d 1d
Destination Port: 3357 (3357)
报文长度:00 0c
Length: 12
校验和:88 06
Checksum: 0x8806 [validation disabled]
数据为TFTP报文
(6)TFTP –i 172.18.3.188 PUT f2.txt的第三个UDP报文:
0d1d0b4100138b61
源端口:0d 1d
Source Port: 3357 (3357)
目的端口:0b 41
Destination Port: 2881 (2881)
报文长度:00 13
Length: 19
校验和:8b 61
Checksum: 0x8b61 [validation disabled]
数据为TFTP报文
(7)TFTP –i 172.18.3.188 PUT f2.txt的第四个UDP报文:
0b410d1d000c8805
源端口:0b 41
Source Port: 2881 (2881)
目的端口:0d 1d
Destination Port: 3357 (3357)
报文长度:00 0c
Length: 12
校验和:88 05
Checksum: 0x8805 [validation disabled]
数据为TFTP报文
UDP 报文与TCP 报文有何不同:
UDP报文比TCP报文简短,且不用建立连接,TCP是可靠传输协议,UDP是不可靠传输协议。UDP传输速度比TCP快,适用于一些对速度要求高,精确度要求较低的连接。
标签:
原文地址:http://www.cnblogs.com/leftshine/p/5698867.html