FTP Server Setup and Analysis Guide
1. FTP Server Setup on Ubuntu
Step 1: Installing vsftpd
- Update package list:
sudo apt update
- Install vsftpd:
sudo apt install vsftpd
Step 2: Configuring vsftpd
- Open the vsftpd configuration file:
sudo nano /etc/[Link]
- Enable local user login and allow file upload/download by editing these lines:
local_enable=YES
write_enable=YES
- Chroot users to their home directories for security:
chroot_local_user=YES
Step 3: Create a test environment
- Create a user for FTP access:
sudo adduser ftpuser
- Set a password for the user and create a test directory:
sudo mkdir /home/ftpuser/ftp
sudo chown nobody:nogroup /home/ftpuser/ftp
sudo chmod a-w /home/ftpuser/ftp
Step 4: Restart the FTP service
- Restart the vsftpd service to apply changes:
sudo systemctl restart vsftpd
2. Connecting and Transferring Files from Windows
- Use an FTP client like FileZilla or Windows Command Line to connect to the Ubuntu FTP server.
- In FileZilla, enter the server's IP address, username (ftpuser), and password to connect.
- Perform basic operations such as uploading and downloading files to test the connection.
3. FTP Traffic Analysis Using Wireshark
- Open Wireshark on your Windows machine and start capturing traffic on the network interface.
- Use the filter 'ftp' to capture and analyze FTP traffic.
- Key points to observe:
* FTP commands (USER, PASS, RETR, STOR).
* Credentials transmitted in plaintext (highlighting a security risk).
- Test active and passive modes in the FTP client and observe the differences in connection
behavior.
4. Challenges and Solutions
Challenges:
- Connection issues due to firewall settings on the Ubuntu server.
- FTP credentials are transmitted in plaintext, making it insecure.
Solutions:
- Ensure that port 21 is open by allowing it through the firewall:
sudo ufw allow 21/tcp
- For secure file transfers, consider using SFTP (SSH File Transfer Protocol) or FTP over TLS.
5. Conclusion
This project demonstrated the successful setup of an FTP server on Ubuntu, connection from a
Windows client, and analysis of the FTP protocol with Wireshark. The analysis revealed the risks
associated with plaintext transmission of credentials and highlighted the importance of using secure
alternatives like SFTP or FTPS for file transfers.