Skip to content
0xbenzo
Back to projects

EHAX CTF Platform

Platform Architecture

EHAX is a custom capture-the-flag platform developed to coordinate cyber-competitions. The primary architectural goals were high performance, instant grading, and real-time score updates using WebSockets.

[Clients] ---> [Cloudflare WAF] ---> [Reverse Proxy]
                                           |
                    +----------------------+----------------------+
                    |                                             |
              [React App]                                    [Golang API]
                                                                  |
                                              +---------+---------+---------+
                                              |         |                   |
                                            [Redis]  [PostgreSQL]    [Docker Daemon]
                                            (Cache)   (Database)     (Dynamic Sandbox)

Challenges & Solutions

  • Challenge: Mitigating grading system denial-of-service during high-frequency flag submissions.
  • Solution: Implemented a token bucket rate limiter in Go middleware paired with dynamic caching of flag hashes in Redis. Database calls are minimized, yielding sub-10ms grading times under simulated stress tests.
  • Challenge: Hosting dynamic, ephemeral challenges where players get isolated instances.
  • Solution: Developed a Docker integration that spawns micro-containers on-demand with automatic garbage collection hooks to dismantle expired sandboxes.