Files
attack-defense-platform/services/cdn/flag_seed.py
T

8 lines
350 B
Python

# Convenience: reseed flag once without starting server
import hashlib, secrets, os
FLAG_PATH = os.path.join(os.path.dirname(__file__), "flag.txt")
sha = hashlib.sha256(secrets.token_bytes(32)).hexdigest()
with open(FLAG_PATH, "w", encoding="utf-8") as fh:
fh.write(f"GEMASTIK{{{sha}}}\n")
print("Flag reseeded:", open(FLAG_PATH).read().strip())