Skip to content

Commit 98bb501

Browse files
arkiixarkiix
arkiix
authored and
arkiix
committed
Publication
1 parent f5a5682 commit 98bb501

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+16343
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
__pycache__

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.PHONY: start stop down restart clean reset logs
2+
3+
4+
start:
5+
docker compose up --build -d
6+
7+
stop:
8+
docker compose stop
9+
10+
down:
11+
docker compose down -v
12+
13+
restart:
14+
docker compose restart
15+
16+
clean:
17+
rm -rf /culhwch/farm
18+
19+
reset: down clean
20+
21+
logs:
22+
docker compose logs -f

README.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
![flags](resources/flags.png)
32+
33+
### Teams
34+
The Teams page allows managing teams:
35+
- Deleting teams
36+
- Adding teams
37+
- Generating teams
38+
39+
![teams](resources/teams.png)
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+
![settings](resources/settings.png)
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+
![diagram](resources/diagram.png)
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

Comments
 (0)