A Capture The Flag competition featuring regular challenges and an advanced exam section with token-based mechanics.
This CTF consists of two main challenge types:
- Regular Challenges: Earn tokens and points by solving various categories of challenges
- Exam Challenges: Advanced challenges that require tokens to attempt
- Earning Tokens: Complete regular challenges to earn 1 token each
- Burning Tokens: Each exam challenge submission costs 1 token (whether correct or incorrect)
- Token Balance: Track your available and burned tokens
- Regular Challenges: Crypto, web, forensics, and other categories
- Exam Challenges: Advanced challenges with sequential progression
- Sequential Access: You can only access exam challenges in order
- Token Cost: Each submission (correct or incorrect) costs 1 token
- Progression: Complete one exam challenge to unlock the next
- No Points: Exam challenges don't award points, only tokens
- Points: Earned from regular challenges (varies by challenge difficulty) - helps gauge challenge difficulty
- Tokens: Used for exam challenges
- Ranking: Determined by the following criteria in order:
- Most exam challenges completed - Primary ranking factor
- Fastest completion time - Among users with same exam progress
- Most points - Tiebreaker for users with same exam progress and completion time
- User Aliases: Set custom aliases for leaderboard display
- History Logging: All attempts and completions are logged
- Slack Integration: Challenge completions posted to Slack
- File Downloads: Some challenges include downloadable assets
- Docker and Docker Compose
- AWS CLI configured (for asset storage)
- SSL certificates for HTTPS
-
Clone the repository
git clone <repository-url> cd folder
-
Configure environment variables
cd web-server/backend cp .env.example .env # Edit .env with your configuration
-
Set up SSL certificates
cd web-server/nginx_conf/certs # Place your SSL certificate files here # - cert.pem # - key.pem
-
Start the services
cd web-server docker-compose up -d -
Initialize the database
cd web-server/sql ./migrate-docker.sh ./migration.sql -
Access the application
- Frontend: https://your-domain.com
- API: https://your-domain.com/api
- Health check: https://your-domain.com/health
http:
port: 8080
rateLimit:
enabled: true
requestsPerSec: 4.0
burstSize: 20
auth:
expectedVerifiedAccessInstanceArn: "your-va-instance-arn"
expectedIssuer: "https://your-sso-provider.com"
awsRegion: "us-east-2"
database:
hostname: "postgres"
port: "50052"
user: "33ccdb2917"
database: "ctfservice"
awsConfig:
bucketName: "your-s3-bucket"
slack:
leaderboardInterval: "30m"# Database
POSTGRES_PASSWORD=your-db-password
# AWS
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=us-east-2
# Slack
SLACK_WEBHOOK_URL=your-slack-webhook
SLACK_BOT_TOKEN=your-slack-bot-token
# Auth
VA_INSTANCE_ARN=your-verified-access-instance-arn- Backend: Go web server with authentication and challenge management
- Database: PostgreSQL for user data and challenge tracking
- Frontend: Simple HTML/JS interface
- Nginx: Reverse proxy with SSL termination
- AWS S3: Asset storage for challenge files
- PostgreSQL: Database server (port 50052)
- Backend: Go API server (port 8080)
- Nginx: Web server with SSL (port 443)
POST /login- User loginPOST /logout- User logout
GET /user/- Get user profile and progressPOST /user/alias- Set user aliasDELETE /user/alias- Remove user alias
GET /challenges- List all regular challengesGET /challenges/{id}- Get specific challenge detailsPOST /challenges/submit- Submit challenge flag
GET /exam- List available exam challengesGET /exam/{id}- Get specific exam challengePOST /exam/submit- Submit exam challenge flag
challenges- Challenge definitions and metadataflags- Challenge flags and validation handlersusers- User tokens, points, and exam progressuser_challenges_completed- Challenge completion trackinguser_history_log- User activity logginguser_aliases- User alias management
tokens_available- Current token balancetokens_burned- Total tokens spent on exam challengespoints_achieved- Total points from regular challengesexam_challenges_solved- Number of completed exam challenges
- Insert challenge data into
challengestable - Add flag and validation handler to
flagstable - Upload challenge files to S3 bucket
- Update challenge metadata with file asset references
The system supports custom validation logic for flags:
exact- Exact string matchcase_insensitive- Case-insensitive matchregex- Regular expression match- Custom handlers can be implemented in the backend
- All challenge attempts are logged to
user_history_log - Slack notifications for challenge completions
- Rate limiting and security events logged
- 4 requests per second per client
- Burst allowance of 20 requests
- Maximum 512 concurrent clients
- AWS Verified Access integration
- SSO provider authentication
- Session management
- Flag sanitization and validation
- Challenge ID range validation (1-128)
- SQL injection prevention
# View all container logs
docker-compose logs
# View specific service logs
docker-compose logs backend
docker-compose logs postgres
docker-compose logs nginx