mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
88e00f4a8d67e72dc7bcb315b76b116d860046e7
Created comprehensive Stage 0 scenario initialization for Mission 3: Mission Overview: - Title: "Ghost in the Machine" - Tier: Intermediate (Mission 3 of Season 1) - ENTROPY Cell: Zero Day Syndicate - SecGen Scenario: "Information Gathering: Scanning" - Playtime: 60-75 minutes - New Mechanic: RFID keycard cloning Key Features: ✅ Undercover operation at WhiteHat Security Services (Zero Day front company) ✅ RFID cloning mechanics (proximity-based, 10-second window) ✅ Network reconnaissance integration (nmap, netcat, distcc exploitation) ✅ Multi-encoding puzzle (ROT13, Hex, Base64, double-encoded) ✅ Major revelation: Zero Day sold M2 hospital ransomware exploit ✅ First direct mention of "The Architect" (campaign arc progression) ✅ Double agent vs. arrest moral choice Technical Challenges: - VM: Network scanning (nmap), banner grabbing (netcat), distcc CVE-2004-2687 - In-Game: RFID cloning, lockpicking, guard patrol, social engineering, multi-encoding - Hybrid: Dead drop system integrates VM flags with ERB narrative content CyBOK Areas: - NSS: Port scanning, service enumeration, banner grabbing - SS: distcc exploitation, legacy service targeting - ACS: ROT13, Hex, Base64 encoding, multi-stage decoding - SOC: Intelligence correlation, systematic investigation - HF: Undercover operations, social engineering - AB: Exploit marketplace economics, threat actor coordination 3-Act Structure: - Act 1 (20-30%): Undercover infiltration, daytime recon, clone RFID card - Act 2 (50-55%): Nighttime infiltration, network scan, evidence collection - Act 3 (20-25%): M2 connection reveal, Architect discovery, moral choice Key NPCs: - Victoria Sterling (Zero Day sales lead) - Professional, ideological, arrest/double agent target - James Park (Innocent pen tester) - Moral complexity, optional protection choice - "Cipher" (Cell leader) - Referenced but not seen, future villain setup - Agent 0x99 (Handler) - Briefing, tutorials, debrief LORE Fragments: 1. Zero Day Client List (Hex-encoded) - Shows all ENTROPY cells coordinating 2. Exploit Catalog (Safe, PIN 2010) - ProFTPD sale to Ghost for $12,500 3. The Architect's Requirements (Double-encoded) - First direct communication 4. Victoria's Manifesto (Whiteboard) - Free market ideology Campaign Connections: - M1: Social Fabric appears in client list - M2: ProFTPD exploit sold to Ghost revealed (MAJOR "aha moment") - M4: Critical Mass client, SCADA exploits referenced - M6: Crypto Anarchists mentioned in Architect's requirements - M7-9: The Architect introduction, coordination revealed Educational Objectives: - Network reconnaissance (port scanning, service enumeration) - Banner grabbing for intelligence gathering - Multi-stage encoding/decoding - Intelligence correlation (physical + digital evidence) - RFID security vulnerabilities Victory Conditions: - Full (100%): 4 VM flags, 4 encoded messages, 3 LORE, moral choices, stealth - Standard (80%): 3 VM flags, 3 encoded messages, 2 LORE, moral choices - Minimal (60%): 2 VM flags, 2 encoded messages, moral choice Moral Choices: 1. Victoria Sterling: Arrest (disrupt cell) vs. Double Agent (long-term intel) 2. James Park: Protect innocent vs. Focus on mission 3. Consequences tracked in global variables, reflected in debrief Critical Decisions Made: ✅ RFID cloning: Proximity (10s) + social engineering alternative ✅ Network scanning: Automated flags + educational tutorial ✅ Double agent: Long-term intelligence vs. immediate disruption ✅ Architect reveal: Name only (identity reserved for M7-9) ✅ Setting: WhiteHat Security corporate office ✅ Structure: Daytime recon → nighttime infiltration Next Steps: Stage 1 - Narrative Structure Development (scene-by-scene breakdown) Status: Stage 0 COMPLETE ✅
BreakEscape Rails Engine
Cybersecurity training escape room game as a mountable Rails Engine.
Features
- 24+ cybersecurity escape room scenarios
- Server-side progress tracking with 2-table schema
- Randomized passwords per game instance via ERB
- JIT Ink script compilation for NPC dialogue
- Polymorphic player support (User/DemoUser)
- Pundit authorization
- RESTful API for game state management
- Session-based state persistence
Installation
In your Gemfile:
gem 'break_escape', path: 'path/to/break_escape'
Then:
bundle install
rails break_escape:install:migrations
rails db:migrate
rails db:seed # Optional: creates missions from scenarios
Mounting in Host App
In your config/routes.rb:
mount BreakEscape::Engine => "/break_escape"
Usage
Standalone Mode (Development)
export BREAK_ESCAPE_STANDALONE=true
rails server
# Visit http://localhost:3000/break_escape/
Mounted Mode (Production)
Mount in Hacktivity or another Rails app. The engine will use the host app's current_user via Devise.
Configuration
# config/initializers/break_escape.rb
BreakEscape.configure do |config|
config.standalone_mode = false # true for development
config.demo_user_handle = 'demo_player'
end
Database Schema
break_escape_missions- Scenario metadata (name, display_name, published, difficulty)break_escape_games- Player state + scenario snapshot (JSONB)break_escape_demo_users- Standalone mode only (optional)
API Endpoints
GET /games/:id/scenario- Scenario JSON (ERB-generated)GET /games/:id/ink?npc=X- NPC script (JIT compiled from .ink)GET /games/:id/bootstrap- Initial game dataPUT /games/:id/sync_state- Sync player statePOST /games/:id/unlock- Validate unlock attemptPOST /games/:id/inventory- Update inventory
Architecture
ERB Scenario Generation
Scenarios are stored as .json.erb templates and rendered on-demand with randomized values:
<%= random_password %>- Generates unique password per game<%= random_pin %>- Generates unique 4-digit PIN<%= random_code %>- Generates unique hex code
JIT Ink Compilation
NPC dialogue scripts compile on first request (~300ms):
- Check if
.jsonexists and is newer than.ink - If needed, run
inklecateto compile - Cache compiled JSON for subsequent requests
State Management
Player state stored in JSONB column:
- Current room and unlocked rooms
- Inventory and collected items
- NPC encounters
- Global variables (synced with client)
- Health and minigame state
Testing
rails test
License
AGPL v3 - See LICENSE file for details
Documentation
See HACKTIVITY_INTEGRATION.md for integration guide.
Description
Languages
JavaScript
86.5%
Ink
7%
HTML
2.9%
CSS
2.5%
Ruby
0.9%
Other
0.2%