|
| 1 | +# CulhwchFarm |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + Language: <b>English</b> | <a href="https://github.com/arkiix/CulhwchFarm/blob/main/resources/READMEru.md">Русский</a> |
| 5 | +</p> |
| 6 | + |
| 7 | +CulhwchFarm is a flexible and convenient Attack/Defense CTF farm. Inspired by [DestructiveFarm](https://github.com/DestructiveVoice/DestructiveFarm) and [S4DFarm](https://github.com/C4T-BuT-S4D/S4DFarm). |
| 8 | + |
| 9 | +## Running |
| 10 | +- Change the password in [compose.yml](./compose.yml). (SERVER_PASSWORD) |
| 11 | +- Execute `docker compose up --build -d` or `make start` |
| 12 | +- After the build, the farm will be available at http://localhost:8893 |
| 13 | + |
| 14 | +## Scripts |
| 15 | +The farm's capabilities can be customized and expanded using scripts: protocols and validators. |
| 16 | + |
| 17 | +If additional parameters need to be added to a script, the first line should contain a comment with them, for example, `# params: SYSTEM_HOST, SYSTEM_PORT`. These parameters can be configured through the web interface, and the script can retrieve them from the configuration, for example, `host = config.get('SYSTEM_HOST')`. |
| 18 | + |
| 19 | +Culhwch automatically detects script changes and processes them when the settings are opened in the web interface. |
| 20 | + |
| 21 | +### Protocols |
| 22 | +[Protocols](./server/api/protocols) are used for the farm to work with the scoring system (flag submission). The protocol should implement the function `submit_flags(flags: list[Flag], config: dict)` that returns a generator. |
| 23 | + |
| 24 | +### Validators |
| 25 | +[Validators](./server/api/validators) are used to filter and modify flags entering the farm. The validator should implement an asynchronous function `async def validate_flags(flags: Iterator[Flag], app, config: dict)` that returns an asynchronous generator. |
| 26 | + |
| 27 | +## Web Interface |
| 28 | +### Flags |
| 29 | +The Flags page provides statistics on exploits and the ability to manually submit a flag. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +### Teams |
| 34 | +The Teams page allows managing teams: |
| 35 | +- Deleting teams |
| 36 | +- Adding teams |
| 37 | +- Generating teams |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +### Settings |
| 42 | +The Settings page allows managing farm settings: |
| 43 | +- Configuring default variables |
| 44 | +- Selecting and configuring protocols |
| 45 | +- Enabling/disabling validators and configuring their parameters |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +## API |
| 50 | +The farm API allows automating certain tasks, such as managing settings and the team list (e.g., [team_parsers](./client/team_parsers)). |
| 51 | + |
| 52 | +## Exploits |
| 53 | +Exploits are written to attack enemy teams, steal flags, and submit them to the farm. |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +To launch an exploit, use [start_sploit.py](./client/start_sploit.py), for example: |
| 58 | +> python3 start_sploit.py sploit.py |
| 59 | +
|
0 commit comments