feat: challenge registry-driven platform + XVI/XVII imports + admin toggle + domain rename

- Rename repo/domain: attack-defense-platform / attackdefense.imrnes.team (all refs replaced)
- challenge_registry.json: single source of truth (28 challs across gemastik18/xvi/xvii)
- teams.py: registry-driven CHALLENGES, set_challenge_enabled, sync_challenge_runtime
  (apply enable/disable to live teams: build/up or stop/remove + receiver restart)
- compose_gen.py: render per-team compose from canonical per-challenge templates
  (image reuse, per-team ports 30xxx, flag mounts, passwords)
- gen_canonical_composes.py: canonical docker-compose.yml for all services
- import_new_challenges.py: import XVI/XVII services + EOL base image fixes
  (debian:buster→bookworm, node:14→20, python:3.7-slim→3.11)
- receiver: xvi package (10 checkers) + xvii package (12 generic checkers),
  Challenge base reads PASSWORD_<team_port> from env; gen_receiver_main.py
  generates per-team main.py from registry
- main.py: /api/challenges returns full registry; PATCH /api/challenges/<name>
  toggles enabled + applies to live teams
- index.html: 🏗️ Challenge Manager tab (toggle per challenge, grouped by set)
- SLA bonus now dynamic (all enabled challenges, not hardcoded 6)
This commit is contained in:
MythEclipse committed 2026-09-25 14:04:33 +08:00
1 parent c35b23a37f
commit c6fd9ec268
1317 files changed
+306586 -128

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
FROM ruby:3.2-slim-bookworm
ARG PASSWORD
RUN echo root:${PASSWORD} | chpasswd
COPY apt-insecure.conf /etc/apt/apt.conf.d/99gemastik-insecure
RUN apt-get -o Acquire::AllowInsecureRepositories=true update && apt-get install -y openssh-server curl
RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN service ssh start
WORKDIR /ctf/art/
RUN useradd -m ctf
RUN chown -R root:root /ctf/art/
COPY Gemfile .
COPY app.rb .
COPY start.sh .
RUN bundle install
RUN touch /flag.txt
RUN chmod +x start.sh
CMD ./start.sh
+4
View File
@@ -0,0 +1,4 @@
source "http://rubygems.org"
gem "sinatra"
gem "slim"
+14
View File
@@ -0,0 +1,14 @@
require "sinatra"
require "slim"
set :port, 8080
set :bind, '0.0.0.0'
set :environment, :production
get '/' do
redirect '/art/gemastik'
end
get '/art/:word' do
return Slim::Template.new{ '<iframe height="100%" width="100%" frameborder="0" src=https://asciified.thelicato.io/api/v2/ascii?text=' + params[:word] + '></iframe>' }.render
end
+3
View File
@@ -0,0 +1,3 @@
Acquire::AllowInsecureRepositories "true";
Acquire::AllowDowngradeToInsecureRepositories "true";
Apt::Get::AllowUnauthenticated "true";
+18
View File
@@ -0,0 +1,18 @@
services:
art:
container_name: art_container
hostname: art
restart: always
build:
context: .
args:
- PASSWORD=$PASSWORD_10000
volumes:
- ../receiver/flags/art.txt:/flag.txt:ro
- ../utils/bashrc:/root/.bashrc:ro
- ../utils/preexec.sh:/root/.preexec.sh:ro
ports:
- "10000:8080"
- "10022:22"
extra_hosts:
- "host.docker.internal:host-gateway"
+5
View File
@@ -0,0 +1,5 @@
# run sshd
/usr/sbin/sshd -D &
# run the command
su ctf -c "bundle install"
su ctf -c "ruby /ctf/art/app.rb"