Companion material for the empirical security analysis of the Hackless CTF platform. All code here has comments removed. Secret values are redacted.
scripts/ guards.py Extracted input validation layer (deployed/fixed version). run_eval.py Adversarial + legitimate corpus harness. Imports guards.py, reports blocked/passed counts and proves RCE with a benign marker (the identity command via echo). chal_srv.py Minimal challenge service used as the spawn target for T5. t5_bench.py Spawn overhead benchmark: process sandbox vs Docker, N runs each, startup latency and RSS. Run on a Linux host with a Docker daemon: python3 t5_bench.py 30
results/ run_eval_before.txt Guard with the vulnerable URL character class: 3/7 malicious blocked, 4 confirmed RCE. run_eval_after.txt Guard with the fixed URL character class: 7/7 malicious blocked, 0 RCE, 8/8 legitimate passed. t5_process.txt Process sandbox half, measured (this environment has no Docker daemon). t5_summary.txt Process vs Docker summary (Docker measured on a Linux host): about 22x slower startup, comparable memory.
modified/ Changed source files, before (vulnerable) vs after (fixed). terminal-server/ server.before.js / server.after.js Env spread -> allowlist (F1), ulimit wrapper and PS1 (F3). Dockerfile.before / Dockerfile.after ca-certificates and iptables added. entrypoint.after.sh New: best effort egress firewall (F5). docker-agent/ main.before.py / main.after.py setrlimit (F3) and uid drop (F4). kali-mcp/ kali_mcp_server.before.py / .after.py URL character class tightened and proxy interpolation quoted (F2). requirements.before.txt / .after.txt Dependency pinning.