Skip to content

A modern educational platform for learning Web CTF challenges step-by-step with a built-in simulator, progress tracking, and global leaderboard. Designed for hackers in mind with a clean, elegant interface.

License

Notifications You must be signed in to change notification settings

ogtamimi/OGTHG-Hacking-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Project Banner

๐Ÿ›ก๏ธ OGTHG - Web CTF Platform

Author React Gemini License

OGTHG (OGT Hacking Game) is a world-class, educational playground for aspiring security researchers., it bridges the gap between theoretical security concepts and practical exploitation through high-fidelity simulations, gamified progression, and real-time AI mentorship.


๐Ÿ“ธ Screenshots

Landing Page

Landing Page

Challenges Dashboard

Challenges

Academy Learning Platform

Academy


๐Ÿš€ Key Features

๐Ÿ–ฅ๏ธ High-Fidelity Simulators

  • Browser Sandbox: A custom-built virtual browser that allows inspecting source code, manipulating cookies, and executing XSS/SQLi payloads in a safe, isolated environment.
  • Terminal Nexus: A simulated Linux-style bash environment for practicing command injection and directory traversal.

๐Ÿค– AI Mentor: Operative Omar

  • Integrated with Google Gemini 3 Flash, Omar acts as a "simple-speaking" hacker mentor.
  • Provides contextual hints based on the specific challenge.
  • Explains the "Why" behind vulnerabilities to ensure deep conceptual learning.

๐Ÿ“š Comprehensive Academy

  • 12 detailed modules covering the full spectrum of modern web attacks, including SQLi, XSS, SSRF, JWT, and SSTI.

๐Ÿ† Gamified Mastery

  • Dashboard: Track your XP, Clearance Level, and skill analysis.
  • Leaderboard: Compete with other operatives in the Hall of Fame.

๐Ÿ› ๏ธ Tech Stack


๐Ÿ“ Project Structure

OGTHG-Hacking-Game/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ deploy.yml              # GitHub Actions workflow for auto-deployment
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ public/                      # Static assets served as-is
โ”‚   โ””โ”€โ”€ assets/                     # Images and media files
โ”‚       โ”œโ”€โ”€ academic.png           # Academy page screenshot
โ”‚       โ”œโ”€โ”€ challenges.png         # Challenges page screenshot
โ”‚       โ””โ”€โ”€ login.png              # Landing page screenshot
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ src/                         # Source code directory
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ components/              # Reusable React components
โ”‚   โ”‚   โ”œโ”€โ”€ BrowserSimulator.tsx   # Virtual browser for web exploitation
โ”‚   โ”‚   โ”œโ”€โ”€ Sidebar.tsx            # Navigation sidebar component
โ”‚   โ”‚   โ””โ”€โ”€ TerminalSimulator.tsx  # Virtual terminal for command injection
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ pages/                   # Application pages/routes
โ”‚   โ”‚   โ”œโ”€โ”€ Academy.tsx            # Learning modules and tutorials
โ”‚   โ”‚   โ”œโ”€โ”€ ChallengePage.tsx      # Individual challenge interface
โ”‚   โ”‚   โ”œโ”€โ”€ ChallengesList.tsx     # All challenges overview
โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx          # User stats and progress tracking
โ”‚   โ”‚   โ”œโ”€โ”€ LandingPage.tsx        # Welcome/login page
โ”‚   โ”‚   โ”œโ”€โ”€ Leaderboard.tsx        # Global rankings
โ”‚   โ”‚   โ”œโ”€โ”€ Profile.tsx            # User profile and achievements
โ”‚   โ”‚   โ””โ”€โ”€ Settings.tsx           # Application settings
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ services/                # External API integrations
โ”‚   โ”‚   โ””โ”€โ”€ geminiService.ts       # Google Gemini AI service
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ utils/                   # Utility functions (empty, ready for expansion)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ App.tsx                     # Main application component & routing
โ”‚   โ”œโ”€โ”€ constants.tsx               # Challenge data, modules, and constants
โ”‚   โ”œโ”€โ”€ index.tsx                   # Application entry point
โ”‚   โ”œโ”€โ”€ store.ts                    # Global state management (Zustand)
โ”‚   โ””โ”€โ”€ types.ts                    # TypeScript type definitions
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ .env.local                   # Environment variables (not in git)
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore                   # Git ignore rules
โ”œโ”€โ”€ ๐Ÿ“„ CODE_OF_CONDUCT.md          # Community guidelines
โ”œโ”€โ”€ ๐Ÿ“„ CONTRIBUTING.md             # How to contribute
โ”œโ”€โ”€ ๐Ÿ“„ DEPLOYMENT.md               # Deployment instructions
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                      # MIT License
โ”œโ”€โ”€ ๐Ÿ“„ package.json                 # Dependencies and scripts
โ”œโ”€โ”€ ๐Ÿ“„ README.md                    # Project documentation
โ”œโ”€โ”€ ๐Ÿ“„ SECURITY.md                  # Security policy
โ”œโ”€โ”€ ๐Ÿ“„ tsconfig.json               # TypeScript configuration
โ””โ”€โ”€ ๐Ÿ“„ vite.config.ts              # Vite build configuration

๐Ÿ“‹ Directory Descriptions

/public

Contains static assets that are served directly without processing. Files here are accessible at the root URL.

  • index.html: The main HTML template with meta tags, fonts, and the root div
  • assets/: Images, screenshots, and media files

/src

The heart of the application - all TypeScript/React source code.

/src/components

Reusable UI components used across multiple pages:

  • BrowserSimulator: Simulates a web browser for XSS/SQLi challenges
  • TerminalSimulator: Simulates a Linux terminal for command injection
  • Sidebar: Main navigation component

/src/pages

Full-page components mapped to routes:

  • LandingPage: Entry point with authentication
  • Dashboard: User progress, XP, and skill analysis
  • Academy: 12 learning modules covering web vulnerabilities
  • ChallengesList: Browse all available CTF challenges
  • ChallengePage: Interactive challenge interface with simulators
  • Leaderboard: Global rankings and competition
  • Profile: User achievements and statistics
  • Settings: Application preferences

/src/services

External API integrations:

  • geminiService: Handles communication with Google Gemini AI for the AI mentor feature

/src/utils

Utility functions and helpers (currently empty, ready for expansion)

Root Configuration Files

  • index.html: The main HTML template (Vite entry point)
  • vite.config.ts: Vite bundler configuration with GitHub Pages base path
  • tsconfig.json: TypeScript compiler options
  • package.json: Project metadata, dependencies, and npm scripts

๐Ÿ”ง Key Files Explained

src/App.tsx

The main application component that sets up:

  • React Router for navigation
  • Layout structure with Sidebar
  • Route definitions
  • Global state initialization

src/constants.tsx

Contains all static data:

  • Challenge definitions (12 challenges across 4 categories)
  • Academy module content (SQLi, XSS, SSRF, etc.)
  • Leaderboard data
  • Configuration constants

src/store.ts

Global state management using Zustand:

  • User profile (username, XP, level)
  • Challenge completion status
  • Progress tracking
  • Persistent storage in localStorage

src/types.ts

TypeScript type definitions for:

  • Challenge structure
  • User profile
  • Academy modules
  • Leaderboard entries

๐Ÿš€ Build Output

When you run npm run build, Vite creates a dist/ directory:

dist/
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ index-[hash].js      # Bundled JavaScript
โ”‚   โ”œโ”€โ”€ index-[hash].css     # Bundled CSS
โ”‚   โ””โ”€โ”€ [images]             # Optimized images
โ””โ”€โ”€ index.html               # Production HTML

This dist/ folder is what gets deployed to GitHub Pages.


๐Ÿ“ฆ Dependencies Overview

Production Dependencies

  • react & react-dom: UI framework
  • react-router-dom: Client-side routing
  • @google/genai: AI mentor integration
  • framer-motion: Smooth animations
  • lucide-react: Icon library
  • recharts: Data visualization for dashboard

Development Dependencies

  • vite: Fast build tool and dev server
  • typescript: Type safety
  • @vitejs/plugin-react: React support for Vite
  • gh-pages: GitHub Pages deployment utility

๐ŸŽฏ Adding New Features

Adding a New Page

  1. Create src/pages/NewPage.tsx
  2. Add route in src/App.tsx
  3. Add navigation link in src/components/Sidebar.tsx

Adding a New Challenge

  1. Add challenge object to src/constants.tsx
  2. Update types in src/types.ts if needed
  3. Challenge will automatically appear in the UI

Adding a New Component

  1. Create component in src/components/
  2. Import and use in relevant pages
  3. Keep components reusable and focused


๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Gemini API Key (Get it from Google AI Studio)

Installation

  1. Clone the repository

    git clone https://github.com/ogtamimi/OGTHG-Hacking-Game.git
    cd OGTHG-Hacking-Game
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    GEMINI_API_KEY=your_api_key_here
  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000


๐Ÿ—๏ธ Build & Deploy

Build for Production

npm run build

This creates an optimized production build in the dist/ directory.

Preview Production Build

npm run preview

Deploy to GitHub Pages

  1. Update the base path in vite.config.ts to match your repository name:

    base: '/YOUR-REPO-NAME/',
  2. Deploy

    npm run deploy

This will build the project and deploy it to GitHub Pages automatically.


๐ŸŽฎ How to Use

  1. Start Learning: Visit the Academy to learn about web vulnerabilities
  2. Practice Challenges: Apply your knowledge in realistic CTF scenarios
  3. Get AI Help: Use Operative Omar for hints and explanations
  4. Track Progress: Monitor your XP and skill development on the Dashboard
  5. Compete: Check the Leaderboard to see how you rank

๐Ÿ” Security Features

  • All exploits run in isolated sandboxes
  • No actual vulnerabilities in the platform itself
  • Educational content reviewed by security professionals
  • Safe environment for learning offensive security

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“š Documentation


๐Ÿ›ก๏ธ Security Disclaimer

This platform is intended strictly for educational purposes. All "exploits" are performed within a simulated sandbox environment. The goal is to train white-hat security professionals and improve the overall security posture of the web.

Do not use the knowledge gained here for malicious purposes.


๐Ÿ“ง Contact & Support


๐Ÿ“ License

Version 1.1
Licensed under the MIT License.
ยฉ 2024-2026 OGTHG Platform. Built for the next generation of security researchers.


๐ŸŒŸ Acknowledgments

  • Google Gemini AI for powering the AI mentor
  • The cybersecurity community for inspiration
  • All contributors and supporters of this project

Made with โค๏ธ by OGT (Omar Al Tamimi)
Empowering the next generation of ethical hackers

About

A modern educational platform for learning Web CTF challenges step-by-step with a built-in simulator, progress tracking, and global leaderboard. Designed for hackers in mind with a clean, elegant interface.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks