๐ Live Demo: https://cyberarena-77a96.web.app
CyberArena is an immersive, gamified web-based platform designed to transform users from digital novices into "Elite Guardians." Through high-stakes simulations, neon-drenched missions, and real-time threat detection, users learn to defend against the most sophisticated cyber attacks of the modern age.
Missions are grouped into three categories on the Hub:
- Adaptive Difficulty: Timer adjusts based on your XP rank โ 30s (Novice), 27s (Specialist), 25s (Elite Guardian). Difficulty badge shown in the AI label.
- Timed Scenarios: Countdown per question across 5 curated + 1 AI-generated scenario.
- Header Inspection: Click the sender address to reveal raw
Authentication-ResultsandX-Original-Senderheaders. - Hover-to-Reveal: Preview destination URLs to spot domain spoofing (e.g.,
amaz0n.invsamazon.in). - Credential Trap: Clicking a phishing link opens a fake login modal โ entering credentials costs XP.
- AI Scenario Engine: Dynamically generates a new phishing scenario via the OpenRouter API (Mistral-7B) or falls back to a local engine if no API key is set. Set your key from the browser console:
setAIKey('your-key'). - Safety Protocols: Actionable security tips shown at mission end.
- Adaptive Difficulty: Specialist/Elite players face extra manipulation steps (authority spoofing + urgency tactics) beyond the base flow.
- Chat-Based Flow: Engage with a simulated attacker posing as "IT Support" through a multi-step conversation.
- Trust Meter: A real-time gauge tracks psychological manipulation. Reaching 100 trust = breach; reaching 0 = victory.
- Typing Indicator: Simulates realistic attacker response delays.
- Safety Protocols: Actionable security tips and Deep Dive shown at mission end.
- Deepfake Detection: Analyze a "CEO Video Call" scenario requesting an urgent money transfer.
- Clue Investigation: Select up to 2 anomalies (Tone, Language, Context, Identity) before rendering a verdict.
- Flag or Trust: Decide if the content is AI-generated or legitimate.
- Deep Dive: Real-world case study on the 2024 $25M deepfake CFO fraud shown on correct answer.
- XP Lock: Requires 75 XP to unlock.
- Incident Response: Manage "System Health" during an active ransomware outbreak.
- Terminal Interface: Type commands (
isolate-network,run-antivirus,restore-backup, etc.) into a live console with a clearly separated Execute button. - Command History: Use โ/โ arrow keys to navigate previous commands; Tab for auto-complete.
- Glitch Effect: The UI visually degrades when System Health drops below 40.
- Safety Protocols: Actionable security tips shown at mission end.
- Strength Analysis: Real-time entropy calculation and "Time to Crack" estimation (assuming 10B guesses/sec).
- Brute-Force Visualizer: Animated character scrambler shows a simulated cracking attempt.
- MFA Simulation: Experience a standard MFA code verification workflow.
- MFA Fatigue Attack: Simulates rapid push notification bombardment โ deny 3 times to win; approving costs -50 XP.
- Completion Screen: Deep Dive (LinkedIn 2012 breach, Uber MFA fatigue 2022) and safety protocols shown at mission end.
- Breach Database Search: Query simulated corporate leaks by domain (e.g.,
corp.com,secure.net). - Risk Assessment: Evaluate the severity of leaked data (Plaintext vs. SHA-256 Hashed) to determine threat level and earn XP.
- Completion Screen: Deep Dive (Adobe 2013 breach, Collection #1 2019) and safety protocols shown at mission end.
- XP Lock: Requires 50 XP to unlock.
- Branching Scenario Tree: Navigate a realistic multi-step corporate breach โ from a phishing email through credential theft, ransomware deployment, and regulatory reporting.
- Consequence Engine: Every decision has an immediate consequence shown before the next scene loads. Wrong calls add to the Breach Damage meter.
- Breach Damage Meter: A 0โ100% damage bar tracks cumulative harm from poor decisions across the scenario.
- Progress Dots: Visual step tracker shows good (green), bad (red), and current (cyan) decisions.
- Three Outcomes: Full Breach (๐), Breach Contained with Damage (
โ ๏ธ ), or Zero Data Loss (๐ก๏ธ) โ each with a detailed summary and lesson. - Safety Protocols: 4 actionable incident response protocols shown at mission end.
- XP Lock: Requires 100 XP to unlock.
- One Question Per Day: A single scenario-based question drawn from a 12-question pool (Phishing, Social Engineering, Password, Malware, Smishing, MFA, Dark Web, Quishing) โ seeded deterministically so every player gets the same question each day.
- 30-Second Timer: Faster correct answers earn more XP (up to 30 XP; wrong answers earn 5 XP).
- Daily Leaderboard: Top-10 scores for the current day stored in Firestore under
dailyScores/{dateKey}/players. - Already-Played State: Shows a live countdown to the next challenge if you've already completed today's question.
- Explanation Panel: After answering, the correct answer and a detailed explanation are revealed.
- Two-Column Layout: Phone frame on the left, Scam/Safe drop bins and feedback on the right โ everything visible without scrolling.
- Drag-and-Drop: Drag SMS bubbles into "Scam" or "Safe" bins, or click the bins directly.
- Quishing (QR Phishing): Some messages contain mock QR codes โ click "๐ Click to reveal hidden URL" to inspect the destination before deciding. Safe links show
https://, scam links usehttp://or suspicious domains. - Completion Screen: Replaces the game layout entirely โ shows score, grade, collapsible Deep Dive (FluBot 2021, USPS scam wave), and safety protocols. Title updates to "๐ฑ Smishing Simulation Complete".
- Custom Scenario Builder: Fill in Sender, Subject, Body, and Link fields with a live email preview pane.
- Educational Breakdown: After generating JSON, a "Why This Scenario Works" panel analyses your inputs and explains the red flags (spoofed sender, urgency language, suspicious TLDs).
- JSON Export: Generate and copy a structured JSON payload to share custom phishing scenarios with others.
- XP Lock: Requires 150 XP to unlock.
- Knowledge Base: Reference articles on Phishing, Smishing, Quishing, Ransomware, Social Engineering, MFA, and Cryptography โ each in a consistent 4-part structure: Definition โ Common Tactics/Key Concepts โ How to Stay Safe โ Real-World Cases.
- Interactive Tooltips: Hover over key terms (e.g., SHA-256, Entropy, Pretexting) for inline definitions.
- Quick Navigation: Jump-links to each section at the top of the page.
- Frontend: HTML5, CSS3 (Retro-Cyberpunk aesthetic with CRT effects, scanlines, and neon animations). Fully responsive with mobile media queries (
<600px,601โ900px). - Database & Auth: Firebase (Firestore for XP/Leaderboard/Daily Scores and Firebase Auth for Email/Password + Google Sign-In).
- Audio Engine: Web Audio API โ procedurally generated success, error, and click sounds, plus two selectable ambient music tracks (Cyberpunk and Dark Ambient) with reverb, arpeggios, kick/hihat rhythm, and LFO modulation.
- Logic: Modular ES6+ JavaScript.
- AI Integration: OpenRouter API (Mistral-7B) for live phishing scenario generation with a local fallback engine.
- Adaptive Learning:
adaptive.jsengine delivers difficulty scaling (timer, extra steps) and actionable safety protocols based on user XP rank.
| Mechanic | Description |
|---|---|
| XP & Leaderboard | Earn XP for every successful mission and climb the global top-5 ranks (stored in Firestore). |
| Rank System | Novice (0 XP) โ Specialist (100 XP) โ Elite Guardian (500 XP), with a progress bar. |
| Adaptive Difficulty | Timer and scenario complexity scale with XP rank. Novice: 30s timer. Specialist: 27s + extra social engineering steps. Elite: 25s + extra steps. |
| Achievements / Badges | Unlock badges: ๐ฐ Rookie (0 XP), ๐ Detective (50 XP), ๐ก๏ธ Shield (200 XP), ๐ Elite (500 XP). |
| Mission Locks | Dark Web (50 XP), AI Crime Lab (75 XP), Incident Response (100 XP), Mission Creator (150 XP). Locked missions show a ๐ overlay with the required XP. |
| ๐ Notification Bell | When you earn enough XP to unlock a mission or feature, a red badge appears on the ๐ bell icon in the top bar. Click it to see all unlocks โ no intrusive popups. Mark all as read to clear the badge. |
| Hard Mode | Unlocked at 300 XP โ all missions run at Elite difficulty. |
| Mission Completion Tracker | Profile page shows โ /โฌ status for all 10 missions. |
| Unlocks Panel | Progress bars in the profile show how close you are to each locked mission/feature. |
| Daily Challenge | One question per day from a 12-scenario pool. Faster answers earn more XP. Daily leaderboard resets at midnight. |
| System Health | Visual health bar during Malware Escape; triggers glitch effects at low health. |
| Trust Level | Real-time gauge of psychological manipulation in Social Engineering. |
| Breach Damage Meter | Tracks cumulative damage from poor decisions in Incident Response. |
| Safety Protocols | Actionable, real-world security tips shown at mission end for all mission categories. |
| Deep Dives | Real-world case studies shown on mission completion screens (Phishing, Social, AI, Malware, Password, Dark Web, Smishing). |
| Onboarding Tour | 6-step guided tour on first login with spotlight overlay, progress dots, and skip/back/next controls. Replay anytime via the ๐งญ Tour button. |
| How to Play Guide | Modal shown on first login with mission overview, key features, and pro tips. Accessible anytime via the ๐ฎ Guide button. |
| ๐ค Profile Page | Dedicated profile page (profile.html) with XP, rank, badges, mission tracker, unlocks progress, and global leaderboard โ accessible via the ๐ค Profile button in the top bar. |
| Share Score | Share your rank, XP, and missions completed via the Web Share API or clipboard copy. |
| Activity Ticker | Live scrolling feed on the Hub simulating global community activity. |
| High Contrast Mode | Accessibility toggle persisted via localStorage. |
| โ๏ธ Settings Panel | Gear icon (fixed, top-right) opens a panel with Font Size (Small/Medium/Large dropdown), Music Track selector, Volume slider, Mute button, and Music ON/OFF toggle. All settings persisted via localStorage. |
| Music Tracks | Two selectable ambient tracks: โก Cyberpunk (120 BPM minor pentatonic arpeggio + kick/hihat + reverb) and ๐ Dark Ambient (slow evolving pads + sub-bass + occasional deep thuds). |
| Audio Controls | Volume slider, mute button, music toggle, and track selector โ all inside the โ๏ธ Settings panel. |
| Breadcrumbs | Auto-injected navigation trail on all mission pages. |
| Personalized Greeting | Hub shows "Hi, [name]!" using displayName for Google users or the part before @ for email/password users. |
| ARIA & Accessibility | aria-live, role="progressbar", role="alert", role="toolbar", aria-label attributes throughout. focus-visible styles and prefers-reduced-motion support in CSS. |
CyberArena/
โโโ hub.html # Mission Hub โ missions only, top bar with Profile & Bell
โโโ profile.html # Dedicated Profile page โ XP, rank, badges, missions, unlocks, leaderboard
โโโ index.html # Firebase Auth Portal (Email/Password + Google)
โโโ phishing.html # Phishing Detective Mission
โโโ social.html # Social Engineering Simulator
โโโ ai.html # AI Crime Lab (Deepfake Detection)
โโโ malware.html # Malware Escape (Terminal Interface)
โโโ password.html # Password Strength, Entropy & MFA Lab
โโโ darkweb.html # Breach Search & Risk Assessment Simulator
โโโ smishing.html # Mobile SMS & QR (Quishing) Simulator โ two-column layout
โโโ incident.html # Incident Response Simulator (branching scenario tree)
โโโ daily.html # Daily Challenge (one question/day + daily leaderboard)
โโโ creator.html # Custom Phishing Mission Builder
โโโ wiki.html # Cyber-Wiki Knowledge Base
โโโ css/
โ โโโ style.css # Neon-Cyberpunk UI Framework + mobile media queries + tour styles + settings panel
โโโ js/
โโโ firebase.js # Firebase Config & Initialization
โโโ auth.js # Authentication Logic โ shows "Hi, name!" greeting on login
โโโ xp.js # XP & Firestore Data Management (updateXP, getUserData)
โโโ common.js # Shared Navigation, Breadcrumbs, High Contrast, โ๏ธ Settings Panel & Audio Engine
โโโ audio.js # Standalone Audio Module (ES6 export)
โโโ adaptive.js # Adaptive Difficulty Engine โ timerSeconds (30/27/25), extraSteps, safetyProtocols
โโโ tour.js # 6-step Onboarding Tour โ spotlight overlay, dots, localStorage persistence
โโโ unlocks.js # Mission/Feature Lock System โ XP thresholds, lock overlays, ๐ notification bell
โโโ guard.js # Mission Guard โ redirects or blocks page if XP threshold not met
โโโ daily.js # Daily Challenge Engine โ seeded pool, Firestore score submission, leaderboard
โโโ phishing.js # Phishing Detective Logic + AI Scenario Engine
โโโ social.js # Social Engineering Chat Flow + adaptive hard steps
โโโ ai.js # AI Crime Lab Logic
โโโ malware.js # Malware Escape Terminal Logic
โโโ password.js # Password Analysis, MFA & Fatigue Simulation + completion screen
โโโ darkweb.js # Breach Database Search, Risk Assessment + completion screen
โโโ smishing.js # SMS/QR Phishing Simulator โ two-column layout, completion screen
โโโ creator.js # Custom Mission Builder, JSON Export & educational breakdown
- Clone the Repository
git clone https://github.com/your-username/CyberArena.git
- Firebase Setup
- The project is pre-configured with a demo Firebase project (
cyberarena-77a96). To use your own, updatejs/firebase.jswith your project credentials.
- The project is pre-configured with a demo Firebase project (
- Run Locally
- Open
index.htmlin any modern web browser. A local server (e.g., VS Code Live Server) is recommended for Firebase ES modules to load correctly.
- Open
- Or visit the live hosted version directly at https://cyberarena-77a96.web.app
- (Optional) Enable Live AI Scenarios
- Get a free API key from OpenRouter.
- Open the Phishing Detective mission in your browser, press F12 to open DevTools, and click the Console tab.
- Paste the following and press Enter โ do not run this in a terminal:
setAIKey('your-openrouter-api-key')
- You'll see a confirmation alert. Reload the page โ the AI label will show AI Mode: Live API in green.
| Key | Purpose |
|---|---|
cyberarena_tour_done |
Prevents onboarding tour from re-running after first completion |
cyberarena_guide_seen |
Prevents "How to Play" modal from re-showing after first view |
high-contrast |
High contrast mode toggle state |
muted |
Audio mute state |
volume |
Master volume level (0โ1) |
musicOn |
Ambient music on/off state |
musicTrack |
Selected music track (cyberpunk or dark) |
fontSize |
Font size class (font-sm, font-md, font-lg) |
settingsPanelOpen |
Whether the โ๏ธ settings panel is open or closed |
openrouter_api_key |
OpenRouter API key for live AI phishing scenarios |
seenUnlocks |
Array of unlock IDs already processed โ prevents duplicate bell notifications |
unlockNotifications |
Array of unlock notification objects { id, label, description, read } for the ๐ bell |
CyberArena isn't just a game โ it's a training ground for the digital age. By simulating the psychological and technical tactics of hackers, we empower users to become the strongest link in the security chain.
Built for Hackathons, Designed for Learning.