linux---FTP

1.使用tcpdump抓取FTP执行过程中的数据包: 

mali@mali:~/ftp$ sudo tcpdump -i any -w ftp.pcap
tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes

2.执行FTP相关指令

mali@mali:~/ftp$ ftp 112.74.93.163
Connected to 112.74.93.163.
220-FileZilla Server version 0.9.41 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
Name (112.74.93.163:mali): tmf
331 Password required for tmf
Password:
230 Logged on
Remote system type is UNIX.
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
-rw-r--r-- 1 ftp ftp        1262872 Aug 26 15:18 111111.txt
-rw-r--r-- 1 ftp ftp         327680 Aug 26 17:20 32KB.txt
drwxr-xr-x 1 ftp ftp              0 Aug 22 19:26 767E
drwxr-xr-x 1 ftp ftp              0 Aug 13 16:29 certs
drwxr-xr-x 1 ftp ftp              0 Aug 21 15:56 MA
drwxr-xr-x 1 ftp ftp              0 Aug 23 18:08 ModemT
-rw-r--r-- 1 ftp ftp             19 Aug 27 09:49 t6.txt
drwxr-xr-x 1 ftp ftp              0 Aug 26 15:46 TEST7
drwxr-xr-x 1 ftp ftp              0 Aug 19 10:54 WHAT
226 Transfer OK
ftp> pwd
257 "/" is current directory.
ftp> ls ModemT
200 Port command successful
150 Opening data channel for directory list.
drwxr-xr-x 1 ftp ftp              0 Aug 23 16:38 download
-rw-r--r-- 1 ftp ftp              5 Aug 23 19:44 t1.txt
drwxr-xr-x 1 ftp ftp              0 Aug 23 09:26 testdir1
drwxr-xr-x 1 ftp ftp              0 Aug 23 19:19 upload
drwxr-xr-x 1 ftp ftp              0 Aug 26 10:18 uploads
226 Transfer OK
ftp> cd ModemT
250 CWD successful. "/ModemT" is current directory.
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
drwxr-xr-x 1 ftp ftp              0 Aug 23 16:38 download
-rw-r--r-- 1 ftp ftp              5 Aug 23 19:44 t1.txt
drwxr-xr-x 1 ftp ftp              0 Aug 23 09:26 testdir1
drwxr-xr-x 1 ftp ftp              0 Aug 23 19:19 upload
drwxr-xr-x 1 ftp ftp              0 Aug 26 10:18 uploads
226 Transfer OK
ftp> pwd
257 "/ModemT" is current directory.
ftp> type
Using ascii mode to transfer files.
ftp> cd ..
250 CWD successful. "/" is current directory.
ftp> pwd
257 "/" is current directory.
ftp> get 32KB.txt
local: 32KB.txt remote: 32KB.txt
200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
327680 bytes received in 1.76 secs (181.7357 kB/s)
ftp> put test.txt /
local: test.txt remote: /
200 Port command successful
550 Filename invalid
ftp> put test.txt ./
local: test.txt remote: ./
200 Port command successful
550 Filename invalid
ftp> rename t1.txt t2.txt
550 file/directory not found
ftp> pwd
257 "/" is current directory.
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
-rw-r--r-- 1 ftp ftp        1262872 Aug 26 15:18 111111.txt
-rw-r--r-- 1 ftp ftp         327680 Aug 26 17:20 32KB.txt
drwxr-xr-x 1 ftp ftp              0 Aug 22 19:26 767E
drwxr-xr-x 1 ftp ftp              0 Aug 13 16:29 certs
drwxr-xr-x 1 ftp ftp              0 Aug 21 15:56 MA
drwxr-xr-x 1 ftp ftp              0 Aug 23 18:08 ModemT
-rw-r--r-- 1 ftp ftp             19 Aug 27 09:49 t6.txt
drwxr-xr-x 1 ftp ftp              0 Aug 26 15:46 TEST7
drwxr-xr-x 1 ftp ftp              0 Aug 19 10:54 WHAT
226 Transfer OK
ftp> rename t6.txt t6_rename.txt
350 File exists, ready for destination name.
450 Internal error renaming the file
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
-rw-r--r-- 1 ftp ftp        1262872 Aug 26 15:18 111111.txt
-rw-r--r-- 1 ftp ftp         327680 Aug 26 17:20 32KB.txt
drwxr-xr-x 1 ftp ftp              0 Aug 22 19:26 767E
drwxr-xr-x 1 ftp ftp              0 Aug 13 16:29 certs
drwxr-xr-x 1 ftp ftp              0 Aug 21 15:56 MA
drwxr-xr-x 1 ftp ftp              0 Aug 23 18:08 ModemT
-rw-r--r-- 1 ftp ftp             19 Aug 27 09:49 t6.txt
drwxr-xr-x 1 ftp ftp              0 Aug 26 15:46 TEST7
drwxr-xr-x 1 ftp ftp              0 Aug 19 10:54 WHAT
226 Transfer OK
ftp> status
Connected to 112.74.93.163.
No proxy connection.
Connecting using address family: any.
Mode: stream; Type: ascii; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: on; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Quote control characters: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
Tick counter printing: off
ftp> system
215 UNIX emulated by FileZilla
ftp> put test.txt /ModemT
local: test.txt remote: /ModemT
200 Port command successful
550 Filename invalid
ftp> put ~/ftp/test.txt /
local: /home/mali/ftp/test.txt remote: /
200 Port command successful
550 Filename invalid
ftp> bye
221 Goodbye
mali@mali:~/ftp$ 

3.FTP执行后:

mali@mali:~/ftp$ ls -l
total 11148
-rw-rw-r-- 1 mali mali   327665 8月  27 11:03 32KB.txt
-rw-r--r-- 1 root root 11071488 8月  27 11:21 ftp.pcap
-rw-rw-r-- 1 mali mali    15576 8月  27 11:00 test.txt
mali@mali:~/ftp$ 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值