feat: multi-team orchestrator - topology UI, team management, flag randomizer, public submit + leaderboard
- panel/teams.py: create/start/stop teams with isolated ports+creds, per-team receivers with CHALLENGE_PORT/CONTAINER env, flag randomization, submit validation + leaderboard
- panel/main.py: /api/teams, /api/teams/{idx}/randomize, /api/flag/submit, /api/leaderboard, /api/public/teams, /submit page
- panel/static/submit.html: public flag submission UI for teams
- receiver: _ch_port/_ch_container read .env per team, container name overrides
- .gitignore: exclude teams/, .venv, __pycache__
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import io
|
||||
import re
|
||||
import time
|
||||
@@ -29,7 +30,7 @@ class Blogpost(Challenge):
|
||||
flag_location = 'flags/blogpost.txt' # Host copy (used by your orchestrator)
|
||||
history_location = 'history/blogpost.txt'
|
||||
container_flag_path = '/flag.txt'
|
||||
container_name = 'blogpost_container' # <-- set to your actual container name
|
||||
container_name = os.environ.get('CHALLENGE_CONTAINER_BLOGPOST', 'blogpost_container') # <-- set to your actual container name
|
||||
|
||||
# Heuristics to recognize ExifTool output
|
||||
_exif_markers = (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import io
|
||||
import re
|
||||
import random
|
||||
@@ -26,7 +27,7 @@ class CDN(Challenge):
|
||||
flag_location = 'flags/cdn.txt' # host copy (written by your orchestrator)
|
||||
history_location = 'history/cdn.txt'
|
||||
container_flag_path = '/flag.txt'
|
||||
container_name = 'cdn_container' # adjust if your container name differs
|
||||
container_name = os.environ.get('CHALLENGE_CONTAINER_CDN', 'cdn_container') # adjust if your container name differs
|
||||
|
||||
# Canonical ExifTool markers (NO app fallbacks allowed)
|
||||
_exif_must_have = (
|
||||
|
||||
@@ -11,7 +11,7 @@ class Carbeat(Challenge):
|
||||
flag_location = 'flags/carbeat.txt'
|
||||
history_location = 'history/carbeat.txt'
|
||||
|
||||
_CONTAINER = "carbeat_container"
|
||||
_CONTAINER = os.environ.get("CHALLENGE_CONTAINER_CARBEAT", "carbeat_container")
|
||||
_SERVICE_CMD = ["docker", "exec", "-i", _CONTAINER, "/home/ctfuser/chall/mybini"]
|
||||
_HEX_RE = re.compile(r'^[0-9a-fA-F]+$')
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Phew(Challenge):
|
||||
flag_location = 'flags/phew.txt'
|
||||
history_location = 'history/phew.txt'
|
||||
|
||||
_CONTAINER = "phew_container"
|
||||
_CONTAINER = os.environ.get("CHALLENGE_CONTAINER_PHEW", "phew_container")
|
||||
_SERVICE_CMD = ["docker", "exec", "-i", _CONTAINER, "python3", "/home/ctfuser/chall/src/chall.py"]
|
||||
_HEX_RE = re.compile(r'^[0-9a-fA-F]+$')
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Sheesh(Challenge):
|
||||
flag_location = 'flags/sheesh.txt'
|
||||
history_location = 'history/sheesh.txt'
|
||||
|
||||
_CONTAINER = "sheesh_container"
|
||||
_CONTAINER = os.environ.get("CHALLENGE_CONTAINER_SHEESH", "sheesh_container")
|
||||
_SERVICE_CMD = ["docker", "exec", "-i", _CONTAINER, "python3", "/home/ctfuser/chall/src/chall.py"]
|
||||
_HEX_RE = re.compile(r'^[0-9a-fA-F]+$')
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from .Challenge import Challenge
|
||||
|
||||
import os
|
||||
import io
|
||||
import requests
|
||||
import random
|
||||
@@ -30,7 +31,7 @@ class Warmup(Challenge):
|
||||
with open(self.flag_location, 'r') as f:
|
||||
host_flag = f.read().strip()
|
||||
container_flag = subprocess.run([
|
||||
"docker", "exec", "warmup_container", "cat", "/flag.txt"
|
||||
"docker", "exec", os.environ.get("CHALLENGE_CONTAINER_WARMUP", "warmup_container"), "cat", "/flag.txt"
|
||||
], capture_output=True, text=True).stdout.strip()
|
||||
assert host_flag == container_flag, 'Flag mismatch between host and container'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user