How destructivevoice/destructivefarm works
Main Components
a. Exploit Scripts: Represented by sample scripts such as client/spl_example.py. They are written by participants and are “plugged into” the client.
b. Farm Client: The client (client/start_sploit.py) acts as the local runner. It periodically executes exploits, collects their results (flags), and forwards these to the farm server.
c. Farm Server: Located in the server directory, this is the central hub. It contains:
• API endpoints (server/api.py) – the interface that accepts flags from farm clients.
• Authentication and configuration (server/auth.py and server/config.py).
• Database integration (server/database.py, schema.sql, and models.py) to store flags and track statistics.
• Protocol adapters (inside server/protocols, e.g., forcad_tcp.py, ructf_http.py, etc.) that likely handle communication with external systems (like the checksystem).
• A web interface using Flask (templates and static assets) which shows the flags stats (with assets in server/static/css, server/static/js, and server/templates).
Relationships and Data Flow
• Internally within the Farm Server, show the interaction between:
• The API and authentication modules (ensuring secure flag submissions).
• The database (via models/database files) where the flag persistence and statistics are stored.
• The protocol modules which process and format data before sending out to the Checksystem.
• How static assets and templates form the web interface for administrative viewing.
• A label showing that exploits (written separately by participants) are used as plug-ins that get executed by the client.
Architectural Patterns and Key Design Principles
• The design follows a clear separation of concerns:
• The client and server roles are distinct. The client is responsible for running user-created exploits, while the server handles aggregation, processing, and interfacing with other systems.
• Inside the server, the separation is visible between API logic, authentication, data modeling, and protocol handling.
• Recognize it as a full-stack-like design (for the server) but with distributed external interactions (client to server to checksystem).
Technologies and Frameworks
• Python is the main language.
• Flask is used for the web service.
• Likely a relational database (given the presence of schema.sql and database modules).
• The protocol modules indicate custom implementations for interacting with various CTF protocols or checksystems.