-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario_select.html
388 lines (348 loc) · 14.6 KB
/
scenario_select.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Office Adventure Game - Scenario Selection</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #333;
font-family: Arial, sans-serif;
color: white;
}
.container {
width: 80%;
max-width: 800px;
background: rgba(0, 0, 0, 0.7);
border-radius: 10px;
padding: 30px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}
h1 {
text-align: center;
margin-bottom: 30px;
color: #3498db;
}
.scenario-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
}
.scenario-card {
background: #444;
border-radius: 5px;
padding: 20px;
transition: all 0.3s ease;
cursor: pointer;
border: 1px solid #555;
}
.scenario-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
background: #4a4a4a;
}
.scenario-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
color: #3498db;
}
.scenario-description {
font-size: 14px;
color: #ccc;
margin-bottom: 15px;
line-height: 1.4;
}
.scenario-difficulty {
display: inline-block;
padding: 3px 8px;
border-radius: 3px;
font-size: 12px;
font-weight: bold;
}
.difficulty-easy {
background: #2ecc71;
color: #fff;
}
.difficulty-medium {
background: #f39c12;
color: #fff;
}
.difficulty-hard {
background: #e74c3c;
color: #fff;
}
.back-button {
display: block;
margin: 30px auto 0;
padding: 10px 20px;
background: #3498db;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s;
}
.back-button:hover {
background: #2980b9;
}
.scenario-cybok {
margin-top: 10px;
margin-bottom: 15px;
font-size: 12px;
color: #aaa;
}
.cybok-title {
font-weight: bold;
margin-bottom: 5px;
color: #3498db;
}
.cybok-list {
margin: 0;
padding-left: 20px;
}
.cybok-list li {
margin-bottom: 3px;
}
.scenario-cybok-badges {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: 10px;
margin-bottom: 15px;
}
.cybok-badge {
display: inline-block;
padding: 3px 8px;
border-radius: 3px;
font-size: 11px;
font-weight: bold;
background: #2c3e50;
color: #fff;
cursor: help;
position: relative;
}
.cybok-badge:hover .cybok-tooltip {
display: block;
}
.cybok-tooltip {
display: none;
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.9);
color: #fff;
padding: 10px;
border-radius: 5px;
width: 250px;
z-index: 100;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
font-weight: normal;
font-size: 11px;
margin-bottom: 5px;
}
.cybok-tooltip:after {
content: '';
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}
.cybok-tooltip-title {
font-weight: bold;
margin-bottom: 5px;
color: #3498db;
}
.cybok-tooltip-list {
margin: 0;
padding-left: 15px;
list-style-type: disc;
}
.cybok-tooltip-list li {
margin-bottom: 2px;
}
</style>
</head>
<body>
<div class="container">
<h1>Select a Scenario</h1>
<div class="scenario-list" id="scenario-list">
<!-- Scenarios will be loaded here dynamically -->
</div>
<button class="back-button" onclick="window.location.href='index.html'">Back to Main Game</button>
</div>
<script>
// List of available scenarios
const scenarios = [
{
id: "encoding_lab",
title: "Encoding and Encryption Lab",
description: "Recover your legendary cookie recipe from mischievous squirrels by solving various encoding and encryption challenges.",
difficulty: "beginner",
file: "assets/scenarios/scenario4.json",
cybok: [
{ ka: "AC", topic: "Algorithms, Schemes and Protocols", keywords: ["Encoding vs Cryptography", "Caesar cipher", "Vigenere cipher", "SYMMETRIC CRYPTOGRAPHY - AES (ADVANCED ENCRYPTION STANDARD)"] },
{ ka: "F", topic: "Artifact Analysis", keywords: ["Encoding and alternative data formats"] },
{ ka: "WAM", topic: "Fundamental Concepts and Approaches", keywords: ["ENCODING", "BASE64"] }
]
},
{
id: "captain_meow",
title: "Captain Meow's Disappearance",
description: "Your beloved kitty sidekick, Captain Meow, has vanished without a trace! Follow the cryptic clues to find him before it's too late.",
difficulty: "medium",
file: "assets/scenarios/scenario1.json",
cybok: [
{ ka: "F", topic: "Operating System Analysis", keywords: ["Steganography", "Encoding and alternative data formats", "SEARCH FOR EVIDENCE", "METADATA"] },
{ ka: "POR", topic: "Privacy Technologies and Democratic Values", keywords: ["METADATA", "STEGANOGRAPHY"] },
{ ka: "AC", topic: "Cryptographic Implementation", keywords: ["Cryptographic Libraries", "ENCRYPTION - TOOLS"] },
{ ka: "AC", topic: "Physical Security", keywords: ["Fingerprint Authentication", "Bluetooth Security", "Physical Locks"] },
{ ka: "AC", topic: "Hashing and Integrity", keywords: ["Hash Functions", "MD5 Hash"] },
{ ka: "AC", topic: "Encoding and Representation", keywords: ["Base64 Encoding", "Octal Encoding", "Hexadecimal (Hex) Encoding"] },
{ ka: "AC", topic: "Algorithms, Schemes and Protocols", keywords: ["ADVANCED ENCRYPTION STANDARD (AES)", "ECB (ELECTRONIC CODE BOOK) BLOCK CIPHER MODE"] }
]
},
{
id: "ceo_exfil",
title: "CEO Data Exfiltration",
description: "Infiltrate the CEO's office and exfiltrate sensitive company data. You'll need to bypass physical security and find ways to access restricted areas.",
difficulty: "medium",
file: "assets/scenarios/ceo_exfil.json"
},
{
id: "asymmetric_encryption",
title: "Asymmetric Encryption with RSA",
description: "Solve cryptographic puzzles using RSA and Diffie-Hellman to escape from a cursed ghost town before you're turned into a llama!",
difficulty: "intermediate",
file: "assets/scenarios/scenario2.json",
cybok: [
{ ka: "AC", topic: "Algorithms, Schemes and Protocols", keywords: ["CRYPTOGRAPHY - ASYMMETRIC - RSA", "DIFFIE-HELLMAN ALGORITHM"] },
{ ka: "AC", topic: "Public-Key Cryptography", keywords: ["public-key encryption", "public-key signatures", "RSA MODULUS", "RSA PROBLEM", "RSA TRANSFORM"] },
{ ka: "AC", topic: "Key Management", keywords: ["key generation"] },
{ ka: "AC", topic: "Cryptographic Implementation", keywords: ["Cryptographic Libraries", "ENCRYPTION - TOOLS"] }
]
},
{
id: "symmetric_encryption",
title: "Symmetric Encryption with AES",
description: "Recover Dr. Knowitall's time machine blueprints by solving AES encryption puzzles before the self-destruct sequence activates.",
difficulty: "intermediate",
file: "assets/scenarios/scenario3.json",
cybok: [
{ ka: "AC", topic: "Algorithms, Schemes and Protocols", keywords: ["ADVANCED ENCRYPTION STANDARD (AES)", "ECB (ELECTRONIC CODE BOOK) BLOCK CIPHER MODE"] },
{ ka: "AC", topic: "Symmetric Cryptography", keywords: ["symmetric primitives", "symmetric encryption and authentication"] },
{ ka: "AC", topic: "Cryptographic Implementation", keywords: ["Cryptographic Libraries", "ENCRYPTION - TOOLS", "Hexadecimal Encoding"] }
]
},
{
id: "biometric_breach",
title: "Biometric Security Breach",
description: "Test the company's biometric security systems by collecting and spoofing fingerprint data to gain unauthorized access.",
difficulty: "hard",
file: "assets/scenarios/biometric_breach.json"
}
];
// Function to create scenario cards
function createScenarioCards() {
const scenarioList = document.getElementById('scenario-list');
// CyBOK Knowledge Area abbreviation mapping
const cybokFullNames = {
"IC": "Introduction to CyBOK",
"FM": "Formal Methods",
"RMG": "Risk Management & Governance",
"LR": "Law & Regulation",
"HF": "Human Factors",
"POR": "Privacy & Online Rights",
"MAT": "Malware & Attack Technologies",
"AB": "Adversarial Behaviours",
"SOIM": "Security Operations & Incident Management",
"F": "Forensics",
"C": "Cryptography",
"AC": "Applied Cryptography",
"OSV": "Operating Systems & Virtualisation Security",
"DSS": "Distributed Systems Security",
"AAA": "Authentication, Authorisation and Accountability",
"SS": "Software Security",
"WAM": "Web & Mobile Security",
"SSL": "Secure Software Lifecycle",
"NS": "Network Security",
"HS": "Hardware Security",
"CPS": "Cyber Physical Systems",
"PLT": "Physical Layer and Telecommunications Security"
};
scenarios.forEach(scenario => {
const card = document.createElement('div');
card.className = 'scenario-card';
card.onclick = function() {
launchScenario(scenario.file);
};
const difficultyClass = `difficulty-${scenario.difficulty.toLowerCase()}`;
let cybokHTML = '';
if (scenario.cybok) {
// Group by Knowledge Area
const kaGroups = {};
scenario.cybok.forEach(item => {
if (!kaGroups[item.ka]) {
kaGroups[item.ka] = [];
}
kaGroups[item.ka].push(item);
});
const badgesHTML = Object.keys(kaGroups).map(ka => {
const topics = kaGroups[ka];
const kaFullName = cybokFullNames[ka] || ka;
const tooltipContent = `
<div class="cybok-tooltip-title">${kaFullName} Topics:</div>
<ul class="cybok-tooltip-list">
${topics.map(item => `
<li>
<strong>${item.topic}</strong>
<ul>
${item.keywords.map(keyword => `<li>${keyword}</li>`).join('')}
</ul>
</li>
`).join('')}
</ul>
`;
return `
<div class="cybok-badge">
CyBOK ${ka}
<div class="cybok-tooltip">
${tooltipContent}
</div>
</div>
`;
}).join('');
cybokHTML = `
<div class="scenario-cybok-badges">
${badgesHTML}
</div>
`;
}
card.innerHTML = `
<div class="scenario-title">${scenario.title}</div>
<div class="scenario-description">${scenario.description}</div>
${cybokHTML}
<div class="scenario-difficulty ${difficultyClass}">${scenario.difficulty.toUpperCase()}</div>
`;
scenarioList.appendChild(card);
});
}
// Function to launch the game with selected scenario
function launchScenario(scenarioFile) {
window.location.href = `index.html?scenario=${encodeURIComponent(scenarioFile)}`;
}
// Initialize the page
document.addEventListener('DOMContentLoaded', createScenarioCards);
</script>
</body>
</html>