rctf-bloodwatch from redpwn but in Python. The only additional feature is selecting specific divisions to count (to exclude admins, for example).
argument | environment | required | default | type | description |
---|---|---|---|---|---|
-u / --url |
RCTF_URL |
yes | (none) | string | rCTF URL to monitor |
-t / --token |
RCTF_TOKEN |
yes | (none) | string | rCTF API token |
-d / --division |
RCTF_DIVISION |
no | all divisions | string | rCTF division(s) to include |
-w / --discord-webhook |
DISCORD_WEBHOOK |
yes | (none) | string | Discord webhook URL |
-m / --message |
BLOOD_MESSAGE |
yes | (none) | string | Message to send to webhook |
-i / --interval |
BLOOD_INTERVAL |
no | 60 | integer | Seconds between checks |
-l / --log-level |
LOG_LEVEL |
no | INFO |
NOTSET | DEBUG | INFO | WARNING | ERROR | CRITICAL |
Log level |
--division
can be specified multiple times to include multiple divisions. Alternatively, specify a space-separated list in RCTF_DIVISION
.
--message
is a template string with these variables available:
challenge
(challenge object)blooder
(solve object)
See rCTF for the shape of these objects. Here's an example message:
Congratulations to [`{{ blooder.userName | replace("`", "") }}`](<https://ctf.tjcsec.club/profile/{{ blooder.userId }}>) for first blood on `{{ challenge.name }}`!
This sends a message that looks like this:
version: '3'
services:
blood:
image: ghcr.io/tjcsec/rctf-bloodwatch
restart: always
environment:
- RCTF_TOKEN=sice
- DISCORD_WEBHOOK=deets
command: ['-u', 'http://rctf/', '-m', 'Congratulations to [`{{ blooder.userName | replace("`", "") }}`](<https://rctf/profile/{{ blooder.userId }}>) for first blood on `{{ challenge.category }}/{{ challenge.name }}`!']