Skip to content

A secure FTP server and client implementation in Python featuring a custom TCP/IP stack, built-in file system with SQLite backend, and interactive command-line interfaces.

License

Notifications You must be signed in to change notification settings

Miaad2004/FTP-Implementation-With-Custom-TCP-IP-Stack

Repository files navigation

SwiftFile: FTP Server With Custom TCP/IP Stack

A secure FTP server and client implementation in Python featuring a custom TCP/IP stack, built-in file system with SQLite backend, and interactive command-line interfaces.

Features

Core Features

  • Standard FTP command support (RFC 959)
  • TLS/SSL encryption (FTPS)
  • User authentication and access control
  • File system permissions management
  • Passive mode data transfers
  • Compatible with FileZilla and other standard FTP clients

Built-in File System

  • SQLite-backed virtual file system
  • File ownership management
  • Access control
  • Interactive file system CLI

Client Features

  • Interactive command-line client
  • TLS/FTPS support

Custom TCP/IP Stack

  • Raw socket TCP implementation
  • Connection establishment (3-way handshake)
  • Keep-Alive
  • TCP flags, sequence numbers, window sizing

Supported FTP Commands

Authentication Commands

  • USER - Login username
  • PASS - Login password
  • REIN - Reinitialize session
  • QUIT - End session

File Operations

  • RETR - Download file
  • STOR - Upload file
  • DELE - Delete file
  • RNFR - Rename from (source)
  • RNTO - Rename to (destination)

Directory Operations

  • LIST - List files
  • MLSD - Machine list directory
  • PWD - Print working directory
  • CWD - Change working directory
  • CDUP - Change to parent directory
  • MKD - Create directory
  • RMD - Remove directory

Settings & Info

  • TYPE - Set transfer type
  • OPTS - Set options
  • FEAT - Get features
  • SYST - Get system info
  • HELP - Show help
  • NOOP - No operation

Security Commands

  • AUTH TLS - Initialize TLS
  • PBSZ - Protection buffer size
  • PROT - Data channel protection level

File System CLI Commands

  • login <user> <pass> - Login to system
  • logout - Logout from system
  • ls [path] - List directory contents
  • cd <path> - Change directory

pwd

  • Print working directory

mkdir

  • Create directory

rmdir

  • Remove directory

touch

  • Create empty file
  • rm <file> - Remove file

chmod

  • Change permissions

rename

  • Rename file/directory

Installation

Starting the Server

# Linux
./deploy_server.sh

# Windows 
.\deploy_server.ps1

Or manually:

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
pip install -r requirements.txt
python start_server.py

Using the FTP Client

python src/ftp_client/start_client.py

Using the File System CLI

python file_system_cli.py -i

Configuration

Server settings in server_config.json

{
    "ftp_host": "127.0.0.1", 
    "ftp_port": 229,
    "use_custom_transport": false,
    "support_FTPS": true
}

Contributors

About

A secure FTP server and client implementation in Python featuring a custom TCP/IP stack, built-in file system with SQLite backend, and interactive command-line interfaces.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages