![Page 1: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/1.jpg)
Understanding FTP
BUPT/QMUL2013-05-03
![Page 2: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/2.jpg)
2
Part1: Using telnet to learn FTP operations in passive mode
Steps:1. Using telnet to connect to given FTP server
$ telnet ftp.mayan.cn 21 2. login using username “mayan” and password “bupt”3. Input command “PASV”, calculate port number for data connections: port= p1×256+p2, p1 and p2 are taken from the server’s reply4. Using another terminal to set up data connection
$ telnet ftp.mayan.cn port5. Input command “LIST”
![Page 3: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/3.jpg)
3
Part1: Using telnet to learn FTP operations in passive mode
c:\>telnet ftp.mayan.cn 21
In another command window, setting up data connection 30*256+251
![Page 4: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/4.jpg)
4
In control connection:
In data connection:
![Page 5: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/5.jpg)
5
in control connection
in data connection
Change to lab directory and list
![Page 6: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/6.jpg)
6
Download lab2.pdf
in control connection
in data connection
![Page 7: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/7.jpg)
7
FTP commands to try
USER PASS PWD CWD LIST RETR STOR (trying on local FTP server) TYPE QUIT …
![Page 8: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/8.jpg)
8
Part2: Capture FTP commands and replies
Starting wiresharkset capture filter: tcp port 21 display filter: ftp
In your browser ftp://ftp.mayan.cnDownload a file, study the FTP commands and replies captured.
Active mode is used
![Page 9: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/9.jpg)
9
Part3: Learn to use FTP user command(1)
![Page 10: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/10.jpg)
10
Learn to use FTP user command(2)
![Page 11: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/11.jpg)
11
User commands used-example D:\ftp-test> ftp ftp.mayan.cn 21
Input user name and password ftp> ls ftp> get fork.c ftp> ren fork.c fork.txt ftp> ls ftp> binary ftp> ascii ftp> quit
![Page 12: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/12.jpg)
12
Control commands and replies used when logging in
![Page 13: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/13.jpg)
13
Commands and replies used for ls
Commands and replies used for get
One data connection persists for one file transfer
![Page 14: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/14.jpg)
14
The procedure of ls• Data connection establishment• Data transmission• Data connection close
![Page 15: Understanding FTP BUPT/QMUL 2013-05-03. 2 Part1: Using telnet to learn FTP operations in passive mode Steps: 1. Using telnet to connect to given FTP server](https://reader034.vdocuments.site/reader034/viewer/2022051401/5697c0121a28abf838ccc43e/html5/thumbnails/15.jpg)
15
Rename fork.c fork.txt
ls
binaryascii
Release control connection