Lab 11: File Transfer Protocol Please read completely before you begin! This lab introduces the FTP protocol and command set. Review The File Transfer Protocol or FTP (RFC 959) is used to move files from one machine to another. Like email protocols, the protocol provides a simple command set that is used by FTP software. But in several ways, FTP can be more complex. Here are a few FTP commands Command USER user’s name PASS password SYST STAT HELP QUIT Description Log into host Supply user’s password Get a description of the remote system Find out the status of the connection List commands or get information about a specific command End the session Here is a slightly edited sample session using several FTP commands. This session was created by using TELNET to connect to the destination server at port 21. 220 nobody.nowhere.org FTP server (Version 6.00LS) ready. user joe 331 Password required for joe. pass hushhush 230 User joe logged in. syst 215 UNIX Type: L8 Version: BSD-199506 stat 211- nobody.nowhere.org FTP server status: Version 6.00LS Connected to joe (10.0.36.71) Logged in as joe TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: Stream No data connection 211 End of status help 214- The following commands are recognized (* =>'s unimplemented). USER PORT TYPE MLFL* MRCP* DELE SYST RMD STOU PASS LPRT STRU MAIL* ALLO CWD STAT XRMD SIZE ACCT* EPRT MODE MSND* REST XCWD HELP PWD MDTM SMNT* PASV RETR MSOM* RNFR LIST NOOP XPWD REIN* LPSV STOR MSAM* RNTO NLST MKD CDUP QUIT EPSV APPE MRSQ* ABOR SITE XMKD XCUP 214 Direct comments to ftp-bugs@nobody.nowhere.org. quit 221 Goodbye. This example shows an FTP login to nohow.nowhere.org. At first glance, this looks a lot like the email sessions. But if you try some of the other commands such as LIST, you’ll discover that most don’t work. The reason is that FTP opens separate connections to transfer information, something that a TELNET client can’t cope with. This means that we are going to have to turn to other tools to see how FTP works, specifically packet capture. (Still, using TELNET can be helpful. For example, it can be used to confirm that the FTP server is operational or to investigate which modes it will support.) Lab For each of the following steps describe your results, give the syntax of the command you used, and where appropriate, the output produced. Include screen captures as needed in your output. Be sure to label your results carefully and organize your results in the order the steps are given here and to answer each question in your report. With this project, you will capture output on your local machine and capture traffic with Ethereal. With Ethereal, traffic can be captured at either end of the connection. Use whichever is easier. As with previous labs, you will connect to the remote machine maud. 1. Use TELNET to connect to maud, capture the session, and include it in your report. Use your name and account editing out your password. Try some commands like HELP, NLST, PWD, etc. paying attention to the reply codes. The first digit indicates general success and failure while the second and third digits provide additional information. For example, a bad password will result in the reply code 530—a 5 for permanent negative completion, the 3 for authentication and accounting, and the 0 for the specific error. Summarize the possible values for the first digit in the return codes. (See RFC 959 for the details.) 2. Using an FTP client, download a small file. (See the documentation for FTP on your system if you aren’t familiar with it.) Capture the session using Ethereal. What filter do you need so that you only see traffic between the FTP client and server? Use the Follow TCP Stream option to display the session. Explain each command used in the session. 3. Include a screen capture in your report that shows all the packets that are exchanged. Explain in some detail the file transfer session from the previous step. 4. Stream, block, and compressed transfers are often used with FTP. However, not every implementation of FTP supports all three modes. You can discover which modes a server supports by simply trying to put it into the appropriate mode and seeing how it responds. TELNET to maud (port 21) and try the commands MODE B, MODE C, and MODE S. Which modes does maud support? 5. (Optional) Software tools like GetRight allow you to stop and, at a later time, resume an FTP connection. How does GetRight manage to resume a session? Please notice that some of these parts may ask several questions. Be sure you answer every question for every part. Copyright © 2003, Dr. Joseph D. Sloan