Skip to content

Repository files navigation

Security Training Platform

A Symfony-based Web Application Security Training Platform with CTF (Capture The Flag) challenges, learning modules, and user management.

Features

Student Features

  • 🔐 User Registration & Authentication
  • 🎯 View and solve CTF challenges
  • 💡 Access hints for challenges
  • 📚 Browse learning modules
  • 📊 Track progress and points
  • ✅ Submit flags and get instant feedback

Admin Features

  • 👥 User management (view, suspend/activate)
  • 🎮 Challenge management (CRUD operations)
  • 💡 Hint management for challenges
  • 📖 Learning module management
  • 📝 Review submission history
  • 📈 View platform statistics

Technical Features

  • Built with Symfony 6.4
  • MySQL database
  • Symfony Security component for authentication
  • Twig templating engine
  • Bootstrap 5 UI
  • Email notifications (Symfony Mailer)
  • Data fixtures for sample data

Requirements

  • PHP 8.1 or higher
  • MySQL 8.0 or higher
  • Composer
  • Symfony CLI (optional, for local development)

Installation

  1. Clone or navigate to the project directory:

    cd security-training-platform
  2. Install dependencies:

    composer install
  3. Configure environment variables:

    • Copy .env and create .env.local:
      cp .env .env.local
    • Update database credentials in .env.local:
      DATABASE_URL="mysql://username:password@127.0.0.1:3306/security_training?serverVersion=8.0&charset=utf8mb4"
      
    • Update APP_SECRET with a random string
  4. Create the database:

    php bin/console doctrine:database:create
  5. Run migrations:

    php bin/console doctrine:migrations:migrate
  6. Load sample data (optional):

    php bin/console doctrine:fixtures:load
  7. Start the development server:

    symfony server:start

    Or use PHP built-in server:

    php -S localhost:8000 -t public

Default Credentials

After loading fixtures, you can use these credentials:

Admin Account:

  • Email: admin@securitytraining.local
  • Password: admin123

Student Account:

  • Email: student@securitytraining.local
  • Password: student123

Project Structure

security-training-platform/
├── bin/                    # Console commands
├── config/                 # Configuration files
│   ├── packages/          # Package configurations
│   └── routes.yaml        # Routing configuration
├── migrations/            # Database migrations
├── public/                # Public web directory
│   └── index.php         # Front controller
├── src/
│   ├── Controller/        # Controllers
│   ├── Entity/           # Doctrine entities
│   ├── Form/             # Form types
│   ├── Repository/       # Doctrine repositories
│   └── DataFixtures/     # Sample data
├── templates/            # Twig templates
│   ├── admin/           # Admin templates
│   ├── student/         # Student templates
│   └── security/        # Auth templates
└── var/                 # Cache and logs

Entities

User

  • id, username, email, password, roles, status
  • Roles: ROLE_ADMIN, ROLE_STUDENT

Challenge

  • id, title, description, difficulty, category, flag, points, isPublished
  • Categories: web, crypto, reverse, binary, forensics, misc
  • Difficulties: easy, medium, hard, expert

ChallengeAttempt

  • id, user, challenge, timestamp, isCorrect, submittedFlag

Hint

  • id, challenge, text, orderNumber

LearningModule

  • id, title, content, category, orderNumber, isPublished

Usage

For Students

  1. Register an account or login
  2. Browse challenges from the dashboard
  3. View challenge details and attempt to solve them
  4. Submit flags to earn points
  5. Access hints when stuck
  6. Read learning modules to learn security concepts
  7. Track progress on the progress page

For Admins

  1. Login with admin credentials
  2. Create challenges with descriptions, flags, and points
  3. Add hints to help students
  4. Create learning modules with educational content
  5. Manage users - view, suspend, or activate accounts
  6. Review submissions to monitor student activity

Email Configuration

To enable email notifications, configure the MAILER_DSN in .env.local:

# For Gmail
MAILER_DSN=smtp://username:password@smtp.gmail.com:587

# For Mailtrap (development)
MAILER_DSN=smtp://username:password@smtp.mailtrap.io:2525

# For local testing
MAILER_DSN=smtp://localhost:1025

Security Considerations

  • Change default admin password immediately in production
  • Use strong APP_SECRET value
  • Enable HTTPS in production
  • Configure proper firewall rules
  • Regularly update dependencies
  • Implement rate limiting for flag submissions
  • Use environment variables for sensitive data

Future Enhancements

  • Sandbox environment integration for challenge testing
  • Real-time leaderboard
  • Advanced statistics and analytics
  • Team-based competitions
  • Docker containerization
  • API for external integrations

License

Proprietary - Security Training Platform

Author

Dhia Eddine Saïd

Support

For questions or issues, contact the platform administrator.

vulnlearn

About

a ctf learning platform with php

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages