-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimulation-elderly-spoof.html
More file actions
613 lines (543 loc) · 14.4 KB
/
Copy pathsimulation-elderly-spoof.html
File metadata and controls
613 lines (543 loc) · 14.4 KB
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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PhishGuard Enterprise – Spoofed Portal Inspector</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--bg: #090d16;
--card-bg: #111827;
--border: #1f2937;
--text: #f9fafb;
--muted: #9ca3af;
--blue: #2563eb;
--cyan: #06b6d4;
--amber: #f59e0b;
--red: #ef4444;
--green: #10b981;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Header Bar */
.app-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 28px;
background: #0d1322;
border-bottom: 1px solid var(--border);
}
.brand {
display: flex;
align-items: center;
gap: 10px;
font-weight: 700;
font-size: 16px;
color: #f3f4f6;
}
.brand-tag {
background: rgba(37, 99, 235, 0.2);
border: 1px solid rgba(37, 99, 235, 0.4);
color: #60a5fa;
padding: 3px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 600;
}
.counter {
font-size: 14px;
color: var(--muted);
}
.counter span { color: var(--text); font-weight: 700; }
/* Main Workspace */
.main-wrapper {
max-width: 1200px;
width: 95%;
margin: 24px auto;
flex: 1;
display: grid;
grid-template-columns: 1fr 320px;
gap: 24px;
align-items: start;
}
@media(max-width: 960px) {
.main-wrapper { grid-template-columns: 1fr; }
}
/* Hyper-Realistic Browser Container */
.browser-window {
background: #111827;
border: 1px solid var(--border);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.browser-header {
background: #1f2937;
padding: 10px 14px;
display: flex;
flex-direction: column;
gap: 8px;
}
.browser-nav-row {
display: flex;
align-items: center;
gap: 12px;
}
.window-controls {
display: flex;
gap: 6px;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-close { background: #ff5f56; }
.dot-min { background: #ffbd2e; }
.dot-max { background: #27c93f; }
.url-bar {
flex: 1;
background: #0b0f19;
border: 1px solid #374151;
padding: 8px 14px;
border-radius: 20px;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 13px;
display: flex;
align-items: center;
gap: 10px;
color: #e5e7eb;
}
.url-domain {
color: #ffffff;
font-weight: 600;
}
.url-path {
color: #9ca3af;
}
/* Simulated Website Viewport */
.browser-viewport {
background: #f3f4f6;
min-height: 480px;
display: flex;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: #111827;
}
/* Clean Replica Web Forms */
.site-card {
background: #ffffff;
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
width: 100%;
max-width: 400px;
padding: 32px 28px;
border: 1px solid #e5e7eb;
}
.site-header {
text-align: center;
margin-bottom: 24px;
}
.site-logo {
font-size: 36px;
margin-bottom: 8px;
}
.site-header h2 {
margin: 0;
font-size: 20px;
color: #111827;
font-weight: 700;
}
.site-header p {
margin: 4px 0 0 0;
font-size: 13px;
color: #6b7280;
}
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
font-size: 13px;
font-weight: 600;
color: #374151;
margin-bottom: 6px;
}
.form-group input {
width: 100%;
padding: 10px 12px;
border: 1px solid #d1d5db;
border-radius: 6px;
font-size: 14px;
background: #f9fafb;
color: #111827;
}
.btn-submit {
width: 100%;
background: #2563eb;
color: white;
border: none;
padding: 12px;
border-radius: 6px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
margin-top: 8px;
}
/* Sidebar Action Panel */
.action-panel {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 24px;
}
.action-panel h3 {
margin: 0 0 8px 0;
font-size: 18px;
}
.action-panel p {
color: var(--muted);
font-size: 14px;
line-height: 1.5;
margin: 0 0 20px 0;
}
.btn-stack {
display: flex;
flex-direction: column;
gap: 12px;
}
.action-btn {
padding: 14px;
border-radius: 8px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
border: none;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.btn-safe {
background: rgba(16, 185, 129, 0.15);
color: #34d399;
border: 1px solid rgba(16, 185, 129, 0.4);
}
.btn-safe:hover { background: rgba(16, 185, 129, 0.25); }
.btn-phish {
background: rgba(239, 68, 68, 0.15);
color: #f87171;
border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-phish:hover { background: rgba(239, 68, 68, 0.25); }
.btn-hint {
background: rgba(245, 158, 11, 0.15);
color: #fbbf24;
border: 1px solid rgba(245, 158, 11, 0.4);
}
.btn-hint:hover { background: rgba(245, 158, 11, 0.25); }
/* Checklist Box */
.checklist-card {
margin-top: 20px;
padding: 16px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--border);
border-radius: 8px;
}
.checklist-card h4 {
margin: 0 0 10px 0;
font-size: 13px;
color: var(--cyan);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.checklist-card ul {
margin: 0;
padding-left: 18px;
color: var(--muted);
font-size: 13px;
line-height: 1.6;
}
/* Modal Feedback Layer */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.85);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
padding: 16px;
}
.modal-box {
background: var(--card-bg);
border: 1px solid var(--border);
padding: 32px;
width: 100%;
max-width: 420px;
border-radius: 12px;
text-align: center;
}
.modal-box h2 { margin-top: 0; font-size: 20px; }
.modal-box h2.correct { color: var(--green); }
.modal-box h2.wrong { color: var(--red); }
.modal-box p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 16px 0 24px 0; }
.modal-btn {
background: var(--blue);
color: white;
padding: 10px 24px;
border-radius: 6px;
font-weight: 600;
font-size: 14px;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<header class="app-header">
<div class="brand">
<span>🛡️ PhishGuard</span>
<span class="brand-tag">Portal Inspector</span>
</div>
<div class="counter">Case <span id="caseIndex">1 / 5</span></div>
</header>
<main class="main-wrapper">
<!-- Real Browser Window Simulation -->
<div class="browser-window">
<div class="browser-header">
<div class="browser-nav-row">
<div class="window-controls">
<div class="dot dot-close"></div>
<div class="dot dot-min"></div>
<div class="dot dot-max"></div>
</div>
<div class="url-bar">
<span id="sslBadge">🔒</span>
<span id="urlDisplay"></span>
</div>
</div>
</div>
<div class="browser-viewport">
<div class="site-card" id="siteCard">
<!-- Injected Dynamically -->
</div>
</div>
</div>
<!-- Inspection Controls -->
<div class="action-panel">
<h3>Analyze Target Page</h3>
<p>Check the address bar and page components. Is this website authentic or a fake replica?</p>
<div class="btn-stack">
<button class="action-btn btn-safe" onclick="handleVerdict('safe')">✓ Authentic Portal</button>
<button class="action-btn btn-phish" onclick="handleVerdict('phishing')">🚨 Spoofed Impostor</button>
<button class="action-btn btn-hint" onclick="showHint()">🔍 Inspect Clues</button>
</div>
<div class="checklist-card">
<h4>Inspection Guide</h4>
<ul>
<li>Verify exact domain spelling</li>
<li>Check lock icon / SSL indicator</li>
<li>Review credentials requested</li>
</ul>
</div>
</div>
</main>
<div id="modalContainer"></div>
<script src="js/behaviour-engine.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
const scenarios = [
{
id: "spoof-pension-portal",
org: "UK Government Pension",
subTitle: "Digital Identity Sign-In",
domain: "gov.uk-pension-digital-auth.co.uk",
path: "/signin",
secure: false,
logo: "🏛️",
fields: ["National Insurance Number", "Secret Access PIN"],
btnText: "Sign In Securely",
correct: "phishing",
trigger: "authority",
difficulty: 2,
hint: "Look at the domain structure: 'gov.uk-pension-digital-auth.co.uk' adds a fake suffix to mimic government branding."
},
{
id: "spoof-nhs-patient",
org: "NHS Health Services",
subTitle: "Patient Records Gateway",
domain: "www.nhs.uk",
path: "/service/patient-login",
secure: true,
logo: "🏥",
fields: ["NHS Email Address", "Account Password"],
btnText: "Continue to Portal",
correct: "safe",
trigger: null,
difficulty: 1,
hint: "This is a clean, authentic healthcare domain with valid security protocols."
},
{
id: "spoof-barclays-auth",
org: "Barclays Online",
subTitle: "Security Verification",
domain: "banking.barclays.co.uk.security-portal.info",
path: "/auth",
secure: false,
logo: "💳",
fields: ["Membership Number", "Passcode & Memorable Word"],
btnText: "Verify Account",
correct: "phishing",
trigger: "financial",
difficulty: 2,
hint: "Banks never host security authentication pages on domains ending in '.info'."
},
{
id: "spoof-tv-licence-renew",
org: "TV Licensing Hub",
subTitle: "Direct Debit Update",
domain: "tvlicensing.co.uk-refund-update.net",
path: "/renew",
secure: false,
logo: "📺",
fields: ["Full Account Name", "Card Number & CVV Code"],
btnText: "Update Payment Method",
correct: "phishing",
trigger: "urgency",
difficulty: 2,
hint: "Notice the deceptive domain ending in '.net' instead of the official 'tvlicensing.co.uk'."
},
{
id: "spoof-bt-billing",
org: "BT Consumer Portal",
subTitle: "Account Management",
domain: "www.bt.com",
path: "/help/account-sign-in",
secure: true,
logo: "📡",
fields: ["BT ID Username", "Account Password"],
btnText: "Log In to My BT",
correct: "safe",
trigger: null,
difficulty: 1,
hint: "This is a legitimate telecommunications support portal with standard sign-in fields."
}
];
let currentIndex = 0;
let sessionScore = 0;
let startTime = Date.now();
function renderScenario() {
const s = scenarios[currentIndex];
document.getElementById("caseIndex").textContent = `${currentIndex + 1} / ${scenarios.length}`;
// Address Bar Rendering
const urlDisplay = document.getElementById("urlDisplay");
urlDisplay.innerHTML = `<span class="url-domain">https://${s.domain}</span><span class="url-path">${s.path}</span>`;
const sslBadge = document.getElementById("sslBadge");
if (s.secure) {
sslBadge.textContent = "🔒";
sslBadge.style.color = "var(--green)";
} else {
sslBadge.textContent = "⚠️";
sslBadge.style.color = "var(--red)";
}
// Site Preview Card Rendering
let inputsHtml = "";
s.fields.forEach(f => {
inputsHtml += `
<div class="form-group">
<label>${f}</label>
<input type="password" value="••••••••••••" readonly>
</div>
`;
});
document.getElementById("siteCard").innerHTML = `
<div class="site-header">
<div class="site-logo">${s.logo}</div>
<h2>${s.org}</h2>
<p>${s.subTitle}</p>
</div>
${inputsHtml}
<button class="btn-submit">${s.btnText}</button>
`;
startTime = Date.now();
}
window.handleVerdict = function(choice) {
const s = scenarios[currentIndex];
const isCorrect = (choice === s.correct);
const responseTime = Date.now() - startTime;
if (isCorrect) sessionScore++;
if (window.PhishGuardEngine) {
window.PhishGuardEngine.recordSimulation({
userMode: "elderly",
simulation: "spoof",
scenarioId: s.id,
trigger: s.trigger || "none",
correct: isCorrect,
action: choice === "safe" ? "mark_safe" : "flag_spoof",
responseTime: responseTime,
confidence: 5,
hintUsed: false,
difficulty: s.difficulty,
phase: "standard"
});
}
showFeedback(isCorrect, s);
};
window.showHint = function() {
const s = scenarios[currentIndex];
document.getElementById("modalContainer").innerHTML = `
<div class="modal-overlay">
<div class="modal-box">
<h2 style="color: var(--amber);">🔍 Inspector Clue</h2>
<p>${s.hint}</p>
<button class="modal-btn" onclick="closeModal()">Back to Inspection</button>
</div>
</div>
`;
};
function showFeedback(isCorrect, s) {
const isLast = currentIndex + 1 >= scenarios.length;
document.getElementById("modalContainer").innerHTML = `
<div class="modal-overlay">
<div class="modal-box">
<h2 class="${isCorrect ? 'correct' : 'wrong'}">${isCorrect ? "✓ Correct Verdict" : "⚠️ Misidentified Threat"}</h2>
<p>This portal was <strong>${s.correct.toUpperCase()}</strong>. ${isCorrect ? "Great job checking the web address and page markers." : "Entering info on fake sites gives away your private passwords."}</p>
<button class="modal-btn" onclick="${isLast ? 'finishLab()' : 'nextScenario()'}">${isLast ? 'Complete Inspection' : 'Next Portal →'}</button>
</div>
</div>
`;
}
window.closeModal = function() {
document.getElementById("modalContainer").innerHTML = "";
};
window.nextScenario = function() {
closeModal();
currentIndex++;
renderScenario();
};
window.finishLab = function() {
const accuracy = Math.round((sessionScore / scenarios.length) * 100);
const targetUrl = `training.html?mode=elderly&score=${sessionScore}&total=${scenarios.length}&accuracy=${accuracy}`;
document.getElementById("modalContainer").innerHTML = `
<div class="modal-overlay">
<div class="modal-box">
<h2 class="correct">Inspection Complete!</h2>
<p>Final Score: <strong>${sessionScore} / ${scenarios.length}</strong> (${accuracy}% accuracy).</p>
<button class="modal-btn" onclick="window.location.href='${targetUrl}'">Return to Command Center</button>
</div>
</div>
`;
};
renderScenario();
});
</script>
</body>
</html>