注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
我爱下载的个人空间 https://home.eeworld.com.cn/space-uid-101026.html [收藏] [复制] [分享] [RSS]
日志

【得捷电子Follow me第4期】终极任务:使用外部存储器,组建简易FTP文件服务器,并...

已有 416 次阅读2024-2-18 10:06 |个人分类:产品评测

【得捷电子Follow me4期】终极任务:使用外部存储器,组建简易FTP文件服务器,并能正常上传下载文件

硬件环境

在入门任务的硬件基本上,构建了一个可以连接网络的局域网,局域网内有一台PC和W5500-EVB-Pico设备。为了扩展外部存储器,选择飞斯卡尔推出的MxDock扩展板,这个扩展板上集成了一个tf卡插槽。通过spi接口完成对tf卡的操作。

 

图1 硬件架构
图2 引脚连接关系图
硬件资源统计表:
I/O 引脚名称 描述
I GP16 连接到W5500的MISO
O GP17 连接到W5500的CSn
O GP18 连接到W5500的SCLK
O GP19 连接到W5500的MOSI
O GP20 连接到W5500的RSTn
I GP21 连接到W5500的INTn
I GP24 VBUS sense - high if VBUS is present, else low
O GP25 用户LED
I GP29 Used in ADC mode (ADC3) to measure VSYS/3
O GP15 连接到显示模块DI/TF卡MOSI
O GP14 连接到显示模块CLK/TF卡CLK
O GP13 连接到显示模块CS
I GP12 连接到TF卡MISO
O GP10 连接到TF卡CS

软件实现

终极任务依然以入门任务为基础,添加了sd卡支持。Adafruit库中继承了sd卡的操作库,我们可以直接采用这个库完成对于tf卡的操作,但是ftp server并没有提供相应的软件库,所以这个我们需要自己来移植。通过网络检索,发现micropython有相应的实现过程,所以下面会基于这个样例完成一个简单的ftp服务器的实现。。

SD卡和显示驱动

利用adafruit_sdcard库,通过spi接口完成tf卡的驱动,通过vfsfat文件系统挂载到系统中,tf卡的挂载路径为/sd 。
# Initialize SPI bus and control pins
spi = busio.SPI(board.GP14, MOSI=board.GP15, MISO=board.GP12)
scs = digitalio.DigitalInOut(board.GP10) # inverted chip select
dcs = digitalio.DigitalInOut(board.GP13) # inverted chip select
# pass in the display size, width and height, as well
display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, dcs, 144, 168)
# sd and storage
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

 

创建ftp服务器

利用adafruit_wiznet5k_socket库,移植ftp服务器到cirtuitpython上。引入wiznet5k以太网,使用adafruit_wiznet5k_socket创建socket,由于这个socket的功能不完整,所以有些功能不能使用,例如setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1),需要删除。
socket.set_interface(eth)
ftpsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
datasocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# ftpsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# datasocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
修改ip和端口绑定到世纪的地址。
# ftpsocket.bind(socket.getaddrinfo("0.0.0.0", port)[0][4])
# datasocket.bind(socket.getaddrinfo("0.0.0.0", DATA_PORT)[0][4])
ftpsocket.bind((eth.pretty_ip(eth.ip_address), port))
datasocket.bind((eth.pretty_ip(eth.ip_address), DATA_PORT))

 

ftp服务器信息显示

显示器作为ftp信息的显示终端,将通过ftp完成文件操作过程的信息展示在显示终端上,便于查看。
显示部分分为标题部分,本机ip和mac地址,客户端连接信息,ftp服务器信息等几个部分。其中ftp的服务信息为滚动显示,循环刷新。
def disp_ftphead():
    cst = "the final test"
    display.text(cst, 20, 0, 0)
    cst = "ip:" + eth.pretty_ip(eth.ip_address)
    display.text(cst, 0, 10, 0)
    cst = "mac:" + eth.pretty_mac(eth.mac_address)
    display.text(cst, 0, 20, 0)
    cst = "ftp message->"
    display.text(cst, 0, 50, 0)
    display.show()

 

运行输出

W5500初始化及FTP服务器运行

 

图3 通过thonny运行程序输出

 

图4 程序运行的显示输出

FTP客户端配置

这里测试使用开源ftp客户端filezilla,还必须选用明文方式访问和采用主动传输模式。
图5 Filezilla客户端配置

 

目录文件列表及wireshark抓包

图6 FTP登录成功后显示器上的显示输出
图7 FTP列表的抓包截图

 

 

登录和获取目录文件列表信息数据分析:
No. Time Source Destination Protocol Length Info
115 42.818028696 192.168.1.2 192.168.1.100 TCP 74 55804 → 21 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1632207458 TSecr=0 WS=128
Frame 115: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
116 42.818093122 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [SYN, ACK] Seq=0 Ack=1 Win=2048 Len=0 MSS=1460
Frame 116: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
117 42.818137615 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=1 Ack=1 Win=64240 Len=0
Frame 117: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
118 42.871300470 192.168.1.100 192.168.1.2 FTP 94 Response: 220 Hello, this is the W5500_EVB_PICO.
Frame 118: 94 bytes on wire (752 bits), 94 bytes captured (752 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 1, Ack: 1, Len: 40
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
119 42.871324698 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=1 Ack=41 Win=64200 Len=0
Frame 119: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 1, Ack: 41, Len: 0
No. Time Source Destination Protocol Length Info
128 45.232443762 192.168.1.2 192.168.1.100 FTP 70 Request: USER anonymous
Frame 128: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 1, Ack: 41, Len: 16
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
129 45.232516084 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=41 Ack=17 Win=2032 Len=0
Frame 129: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 41, Ack: 17, Len: 0
No. Time Source Destination Protocol Length Info
130 45.270146625 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=41 Ack=17 Win=2048 Len=0
Frame 130: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 41, Ack: 17, Len: 0
No. Time Source Destination Protocol Length Info
131 45.298579424 192.168.1.100 192.168.1.2 FTP 70 Response: 230 Logged in.
Frame 131: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 41, Ack: 17, Len: 16
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
132 45.298622541 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=17 Ack=57 Win=64184 Len=0
Frame 132: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 17, Ack: 57, Len: 0
No. Time Source Destination Protocol Length Info
133 45.298759194 192.168.1.2 192.168.1.100 FTP 60 Request: SYST
Frame 133: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 17, Ack: 57, Len: 6
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
134 45.298822189 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=57 Ack=23 Win=2042 Len=0
Frame 134: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 57, Ack: 23, Len: 0
No. Time Source Destination Protocol Length Info
137 45.630226809 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=57 Ack=23 Win=2048 Len=0
Frame 137: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 57, Ack: 23, Len: 0
No. Time Source Destination Protocol Length Info
138 45.656655564 192.168.1.100 192.168.1.2 FTP 73 Response: 215 UNIX Type: L8
Frame 138: 73 bytes on wire (584 bits), 73 bytes captured (584 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 57, Ack: 23, Len: 19
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
139 45.657070227 192.168.1.2 192.168.1.100 FTP 60 Request: FEAT
Frame 139: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 23, Ack: 76, Len: 6
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
140 45.657149690 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=76 Ack=29 Win=2042 Len=0
Frame 140: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 76, Ack: 29, Len: 0
No. Time Source Destination Protocol Length Info
141 45.937357124 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=76 Ack=29 Win=2048 Len=0
Frame 141: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 76, Ack: 29, Len: 0
No. Time Source Destination Protocol Length Info
142 45.963720769 192.168.1.100 192.168.1.2 FTP 71 Response: 211 no-features
Frame 142: 71 bytes on wire (568 bits), 71 bytes captured (568 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 76, Ack: 29, Len: 17
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
143 45.965199014 192.168.1.2 192.168.1.100 FTP 63 Request: CWD /sd
Frame 143: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 29, Ack: 93, Len: 9
File Transfer Protocol (FTP)
[Current working directory: ]
No. Time Source Destination Protocol Length Info
144 45.965271205 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=93 Ack=38 Win=2039 Len=0
Frame 144: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 93, Ack: 38, Len: 0
No. Time Source Destination Protocol Length Info
145 46.246417548 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=93 Ack=38 Win=2048 Len=0
Frame 145: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 93, Ack: 38, Len: 0
No. Time Source Destination Protocol Length Info
146 46.316157612 192.168.1.100 192.168.1.2 FTP 62 Response: 250 OK
Frame 146: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 93, Ack: 38, Len: 8
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
147 46.316516661 192.168.1.2 192.168.1.100 FTP 59 Request: PWD
Frame 147: 59 bytes on wire (472 bits), 59 bytes captured (472 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 38, Ack: 101, Len: 5
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
148 46.316592451 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=101 Ack=43 Win=2043 Len=0
Frame 148: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 101, Ack: 43, Len: 0
No. Time Source Destination Protocol Length Info
149 46.608291360 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=101 Ack=43 Win=2048 Len=0
Frame 149: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 101, Ack: 43, Len: 0
No. Time Source Destination Protocol Length Info
150 46.635518154 192.168.1.100 192.168.1.2 FTP 65 Response: 257 "/sd"
Frame 150: 65 bytes on wire (520 bits), 65 bytes captured (520 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 101, Ack: 43, Len: 11
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
151 46.639323113 192.168.1.2 192.168.1.100 FTP 62 Request: TYPE I
Frame 151: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 43, Ack: 112, Len: 8
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
152 46.639390419 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=112 Ack=51 Win=2040 Len=0
Frame 152: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 112, Ack: 51, Len: 0
No. Time Source Destination Protocol Length Info
153 46.913255567 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=112 Ack=51 Win=2048 Len=0
Frame 153: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 112, Ack: 51, Len: 0
No. Time Source Destination Protocol Length Info
154 46.941334188 192.168.1.100 192.168.1.2 FTP 77 Response: 200 Transfer mode set
Frame 154: 77 bytes on wire (616 bits), 77 bytes captured (616 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 112, Ack: 51, Len: 23
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
155 46.942002435 192.168.1.2 192.168.1.100 FTP 80 Request: PORT 192,168,1,2,227,165
Frame 155: 80 bytes on wire (640 bits), 80 bytes captured (640 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 51, Ack: 135, Len: 26
File Transfer Protocol (FTP)
[Current working directory: /sd]
[Command response frames: 0]
[Command response bytes: 0]
[Command response first frame: 0]
[Command response last frame: 0]
[Setup frame: 0]
No. Time Source Destination Protocol Length Info
156 46.942061240 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=135 Ack=77 Win=2022 Len=0
Frame 156: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 135, Ack: 77, Len: 0
No. Time Source Destination Protocol Length Info
159 47.226763430 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=135 Ack=77 Win=2048 Len=0
Frame 159: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 135, Ack: 77, Len: 0
No. Time Source Destination Protocol Length Info
162 47.283566158 192.168.1.100 192.168.1.2 TCP 60 51618 → 58277 [SYN] Seq=0 Win=2048 Len=0 MSS=1460
Frame 162: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
163 47.283608907 192.168.1.2 192.168.1.100 TCP 58 58277 → 51618 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460
Frame 163: 58 bytes on wire (464 bits), 58 bytes captured (464 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
164 47.283669692 192.168.1.100 192.168.1.2 TCP 60 51618 → 58277 [ACK] Seq=1 Ack=1 Win=2048 Len=0
Frame 164: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
165 47.294104442 192.168.1.100 192.168.1.2 FTP 62 Response: 200 OK
Frame 165: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 135, Ack: 77, Len: 8
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
166 47.294313898 192.168.1.2 192.168.1.100 FTP 60 Request: LIST
Frame 166: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 77, Ack: 143, Len: 6
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
167 47.294367853 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=143 Ack=83 Win=2042 Len=0
Frame 167: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 143, Ack: 83, Len: 0
No. Time Source Destination Protocol Length Info
168 47.895170704 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=143 Ack=83 Win=2048 Len=0
Frame 168: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 143, Ack: 83, Len: 0
No. Time Source Destination Protocol Length Info
169 47.922671786 192.168.1.100 192.168.1.2 FTP 93 Response: 150 Here comes the directory listing.
Frame 169: 93 bytes on wire (744 bits), 93 bytes captured (744 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 143, Ack: 83, Len: 39
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
170 47.963774367 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=83 Ack=182 Win=64059 Len=0
Frame 170: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 83, Ack: 182, Len: 0
No. Time Source Destination Protocol Length Info
171 47.996876813 192.168.1.100 192.168.1.2 TCP 111 51618 → 58277 [PSH, ACK] Seq=1 Ack=1 Win=2048 Len=57
Frame 171: 111 bytes on wire (888 bits), 111 bytes captured (888 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 1, Ack: 1, Len: 57
Data (57 bytes)
0000 2d 72 77 2d 72 2d 2d 72 2d 2d 20 20 20 20 31 20 -rw-r--r-- 1
0010 6f 77 6e 65 72 20 67 72 6f 75 70 20 20 20 20 20 owner group
0020 20 20 20 20 31 32 20 4a 61 6e 20 31 20 32 30 30 12 Jan 1 200
0030 30 20 31 2e 74 78 74 0d 0a 0 1.txt..
No. Time Source Destination Protocol Length Info
172 47.996940395 192.168.1.2 192.168.1.100 TCP 54 58277 → 51618 [ACK] Seq=1 Ack=58 Win=65535 Len=0
Frame 172: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 1, Ack: 58, Len: 0
No. Time Source Destination Protocol Length Info
175 48.025266901 192.168.1.100 192.168.1.2 TCP 111 51618 → 58277 [PSH, ACK] Seq=58 Ack=1 Win=2048 Len=57
Frame 175: 111 bytes on wire (888 bits), 111 bytes captured (888 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 58, Ack: 1, Len: 57
Data (57 bytes)
0000 2d 72 77 2d 72 2d 2d 72 2d 2d 20 20 20 20 31 20 -rw-r--r-- 1
0010 6f 77 6e 65 72 20 67 72 6f 75 70 20 20 20 20 20 owner group
0020 20 20 20 20 31 32 20 4a 61 6e 20 31 20 32 30 30 12 Jan 1 200
0030 30 20 32 2e 74 78 74 0d 0a 0 2.txt..
No. Time Source Destination Protocol Length Info
176 48.025297047 192.168.1.2 192.168.1.100 TCP 54 58277 → 51618 [ACK] Seq=1 Ack=115 Win=65535 Len=0
Frame 176: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 1, Ack: 115, Len: 0
No. Time Source Destination Protocol Length Info
177 48.053727502 192.168.1.100 192.168.1.2 TCP 111 51618 → 58277 [PSH, ACK] Seq=115 Ack=1 Win=2048 Len=57
Frame 177: 111 bytes on wire (888 bits), 111 bytes captured (888 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 115, Ack: 1, Len: 57
Data (57 bytes)
0000 2d 72 77 2d 72 2d 2d 72 2d 2d 20 20 20 20 31 20 -rw-r--r-- 1
0010 6f 77 6e 65 72 20 67 72 6f 75 70 20 20 20 20 20 owner group
0020 20 20 20 20 31 31 20 4a 61 6e 20 31 20 32 30 30 11 Jan 1 200
0030 30 20 33 2e 74 78 74 0d 0a 0 3.txt..
No. Time Source Destination Protocol Length Info
178 48.053772185 192.168.1.2 192.168.1.100 TCP 54 58277 → 51618 [ACK] Seq=1 Ack=172 Win=65535 Len=0
Frame 178: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 1, Ack: 172, Len: 0
No. Time Source Destination Protocol Length Info
179 48.112341854 192.168.1.100 192.168.1.2 TCP 131 51618 → 58277 [PSH, ACK] Seq=172 Ack=1 Win=2048 Len=77
Frame 179: 131 bytes on wire (1048 bits), 131 bytes captured (1048 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 172, Ack: 1, Len: 77
Data (77 bytes)
0000 64 72 77 78 72 2d 78 72 2d 78 20 20 20 20 31 20 drwxr-xr-x 1
0010 6f 77 6e 65 72 20 67 72 6f 75 70 20 20 20 20 20 owner group
0020 20 20 20 20 20 30 20 4a 61 6e 20 31 20 32 30 30 0 Jan 1 200
0030 30 20 53 79 73 74 65 6d 20 56 6f 6c 75 6d 65 20 0 System Volume
0040 49 6e 66 6f 72 6d 61 74 69 6f 6e 0d 0a Information..
No. Time Source Destination Protocol Length Info
180 48.112380279 192.168.1.2 192.168.1.100 TCP 54 58277 → 51618 [ACK] Seq=1 Ack=249 Win=65535 Len=0
Frame 180: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 1, Ack: 249, Len: 0
No. Time Source Destination Protocol Length Info
181 48.136302098 192.168.1.100 192.168.1.2 FTP 67 Response: 226 Listed.
Frame 181: 67 bytes on wire (536 bits), 67 bytes captured (536 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 182, Ack: 83, Len: 13
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
182 48.136353251 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=83 Ack=195 Win=64059 Len=0
Frame 182: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 83, Ack: 195, Len: 0
No. Time Source Destination Protocol Length Info
183 48.152893990 192.168.1.100 192.168.1.2 TCP 60 51618 → 58277 [FIN, ACK] Seq=249 Ack=1 Win=2048 Len=0
Frame 183: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 249, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
184 48.153145230 192.168.1.2 192.168.1.100 TCP 54 58277 → 51618 [FIN, ACK] Seq=1 Ack=250 Win=65535 Len=0
Frame 184: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 58277, Dst Port: 51618, Seq: 1, Ack: 250, Len: 0
No. Time Source Destination Protocol Length Info
185 48.153202442 192.168.1.100 192.168.1.2 TCP 60 51618 → 58277 [ACK] Seq=250 Ack=2 Win=2048 Len=0
Frame 185: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 51618, Dst Port: 58277, Seq: 250, Ack: 2, Len: 0

 

文件删除的抓包截图和分析

图8 通过FTP客户端删除服务器文件抓包截图

 

数据分析:
No. Time Source Destination Protocol Length Info
846 231.995494452 192.168.1.2 192.168.1.100 FTP 66 Request: DELE 1.txt
Frame 846: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 83, Ack: 195, Len: 12
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
847 231.995561427 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=195 Ack=95 Win=2036 Len=0
Frame 847: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 195, Ack: 95, Len: 0
No. Time Source Destination Protocol Length Info
848 232.055795186 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=195 Ack=95 Win=2048 Len=0
Frame 848: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 195, Ack: 95, Len: 0
No. Time Source Destination Protocol Length Info
849 232.121405449 192.168.1.100 192.168.1.2 FTP 62 Response: 250 OK
Frame 849: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 195, Ack: 95, Len: 8
File Transfer Protocol (FTP)
[Current working directory: /sd]

 

文件上传及抓包分析

图9 通过客户端上传文件到服务器抓包截图

 

数据分析:
No. Time Source Destination Protocol Length Info
871 250.304154129 192.168.1.2 192.168.1.100 FTP 66 Request: STOR 1.txt
Frame 871: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 129, Ack: 234, Len: 12
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
872 250.304187145 192.168.1.100 192.168.1.2 TCP 60 61642 → 33511 [ACK] Seq=1 Ack=14 Win=2036 Len=0
Frame 872: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 61642, Dst Port: 33511, Seq: 1, Ack: 14, Len: 0
No. Time Source Destination Protocol Length Info
873 250.304233417 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=234 Ack=141 Win=2036 Len=0
Frame 873: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 234, Ack: 141, Len: 0
No. Time Source Destination Protocol Length Info
874 250.905215420 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=234 Ack=141 Win=2048 Len=0
Frame 874: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 234, Ack: 141, Len: 0
No. Time Source Destination Protocol Length Info
875 250.933875845 192.168.1.100 192.168.1.2 FTP 76 Response: 150 Ok to send data.
Frame 875: 76 bytes on wire (608 bits), 76 bytes captured (608 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 234, Ack: 141, Len: 22
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
876 250.975700634 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=141 Ack=256 Win=64059 Len=0
Frame 876: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 141, Ack: 256, Len: 0
No. Time Source Destination Protocol Length Info
877 251.016273091 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 61642 → 33511 [ACK] Seq=1 Ack=14 Win=2048 Len=0
Frame 877: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 61642, Dst Port: 33511, Seq: 1, Ack: 14, Len: 0
No. Time Source Destination Protocol Length Info
878 251.087726793 192.168.1.100 192.168.1.2 FTP 78 Response: 226 Transfer complete.
Frame 878: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 256, Ack: 141, Len: 24
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
879 251.087780682 192.168.1.2 192.168.1.100 TCP 54 55804 → 21 [ACK] Seq=141 Ack=280 Win=64059 Len=0
Frame 879: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 141, Ack: 280, Len: 0
No. Time Source Destination Protocol Length Info
880 251.104433791 192.168.1.100 192.168.1.2 TCP 60 61642 → 33511 [FIN, ACK] Seq=1 Ack=14 Win=2048 Len=0
Frame 880: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 61642, Dst Port: 33511, Seq: 1, Ack: 14, Len: 0

 

文件下载及抓包分析

图10 通过客户端下载文件到本地抓包截图

 

数据分析:
No. Time Source Destination Protocol Length Info
892 267.929114582 192.168.1.2 192.168.1.100 FTP 66 Request: RETR 2.txt
Frame 892: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 55804, Dst Port: 21, Seq: 167, Ack: 288, Len: 12
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
893 267.929167053 192.168.1.100 192.168.1.2 TCP 60 21 → 55804 [ACK] Seq=288 Ack=179 Win=2036 Len=0
Frame 893: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 288, Ack: 179, Len: 0
No. Time Source Destination Protocol Length Info
894 268.529090822 192.168.1.100 192.168.1.2 TCP 60 [TCP Window Update] 21 → 55804 [ACK] Seq=288 Ack=179 Win=2048 Len=0
Frame 894: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 288, Ack: 179, Len: 0
No. Time Source Destination Protocol Length Info
895 268.557584497 192.168.1.100 192.168.1.2 FTP 84 Response: 150 Opening data connection.
Frame 895: 84 bytes on wire (672 bits), 84 bytes captured (672 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 21, Dst Port: 55804, Seq: 288, Ack: 179, Len: 30
File Transfer Protocol (FTP)
[Current working directory: /sd]
No. Time Source Destination Protocol Length Info
896 268.601385497 192.168.1.100 192.168.1.2 TCP 66 62009 → 34193 [PSH, ACK] Seq=1 Ack=1 Win=2048 Len=12
Frame 896: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface enp2s0, id 0
Ethernet II, Src: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed), Dst: WistronI_45:7c:1d (54:ee:75:45:7c:1d)
Internet Protocol Version 4, Src: 192.168.1.100, Dst: 192.168.1.2
Transmission Control Protocol, Src Port: 62009, Dst Port: 34193, Seq: 1, Ack: 1, Len: 12
Data (12 bytes)
0000 31 32 33 34 35 36 37 38 39 30 0d 0a 1234567890..
No. Time Source Destination Protocol Length Info
897 268.601453263 192.168.1.2 192.168.1.100 TCP 54 34193 → 62009 [ACK] Seq=1 Ack=13 Win=65535 Len=0
Frame 897: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface enp2s0, id 0
Ethernet II, Src: WistronI_45:7c:1d (54:ee:75:45:7c:1d), Dst: de:ad:be:ef:fe:ed (de:ad:be:ef:fe:ed)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.100
Transmission Control Protocol, Src Port: 34193, Dst Port: 62009, Seq: 1, Ack: 13, Len: 0

 

本文来自论坛,点击查看完整帖子内容。

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章