-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscriptRecrutamento.js
More file actions
922 lines (779 loc) · 41 KB
/
scriptRecrutamento.js
File metadata and controls
922 lines (779 loc) · 41 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
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
var c = document.getElementById('chatCanvas');
var ctx = c.getContext('2d');
var cw = c.width = 400;
var ch = c.height = 58;
ctx.font = 'normal 32px monospace';
ctx.textAlign = 'left';
ctx.textBaseline = 'top';
ctx.fillStyle = '#fff';
ctx.strokeStyle = 'rgba(0, 0, 0, .3)';
ctx.shadowColor = '#3f3';
let currentDir = fileSystem['~']; // Diretoria atual
let currentPath = '~'; // Caminho atual (só se usa no cd)
let parsedPath = '~'; // É o caminho que uso nas outras funções
// HackerSchool Secure Network state
let networkState = {
installedPackages: [],
requiredPackages: ['hs-secure-browser', 'network-access-key'],
fakePackages: [
'hs-secure-browser-lts', 'hs-secure-browser-v2', 'hs-browser-secure',
'network-access-key-pro', 'network-access-token', 'network-key-access',
'secure-network-access', 'hs-network-connector'
],
isConnected: false,
isLoggedIn: false,
_auth_u: 'hackerschool',
_auth_p: 'tooeazforme',
hintsUnlocked: []
};
// Generate fake random IP
function generateFakeIP() {
return `${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}.${Math.floor(Math.random() * 256)}`;
}
// Animate text line by line
async function animateLines(terminal, lines, delay = 50) {
for (const line of lines) {
terminal.echo(line);
await new Promise(resolve => setTimeout(resolve, delay));
}
}
// Animate progress bar
async function animateProgressBar(terminal, text, duration = 1000) {
const steps = 8;
const chars = '█';
for (let i = 0; i <= steps; i++) {
const bar = chars.repeat(i) + '░'.repeat(steps - i);
const percent = Math.floor((i / steps) * 100);
terminal.update(-1, `[[;#888;]${text} ${bar} ${percent}%]`);
await new Promise(resolve => setTimeout(resolve, duration / steps));
}
}
// Boot animation
async function bootSequence(terminal) {
terminal.pause();
terminal.set_prompt('');
const bootLines = [
{ text: '> Inicializando sistema', dots: 35 },
{ text: '> A carregar módulos de segurança', dots: 27 },
{ text: '> A verificar integridade do sistema', dots: 24 },
{ text: '> Sistema operacional pronto', dots: 32 }
];
for (const line of bootLines) {
terminal.echo(`[[;#888;]${line.text}]`, { exec: false });
// Animate dots
for (let i = 0; i < line.dots; i++) {
await new Promise(r => setTimeout(r, 20));
terminal.update(-1, `[[;#888;]${line.text}${'.'.repeat(i + 1)}]`);
}
await new Promise(r => setTimeout(r, 100));
terminal.update(-1, `[[;#888;]${line.text}${'.'.repeat(line.dots)} [[;#0f0;]OK]]`);
await new Promise(r => setTimeout(r, 200));
}
terminal.echo('\n[[;#0f0;]╔═════════════════════════════════════════╗]');
terminal.echo('[[;#0f0;]║ HACKERSCHOOL RECRUITMENT SYSTEM ║]');
terminal.echo('[[;#0f0;]║ Version 2.7 ║]');
terminal.echo('[[;#0f0;]╚═════════════════════════════════════════╝]\n');
await new Promise(r => setTimeout(r, 500));
terminal.echo('[[;#0f0;]HACKERSAUDAÇÕES!]\n');
terminal.echo('Muito bem, recruta! Conseguiste desbloquear a fase 1. Assim damos-te as boas vindas ao início da jornada.\n');
terminal.echo('Para passares à próxima fase, tudo que precisas está nesta página,');
terminal.echo('que é um emulador de terminal UNIX (um pouco limitado!).\n');
terminal.echo('Lembra-te que a internet e agora o chatgpt estão sempre prontos para te ajudar.\n');
terminal.echo('O ls é um comando que serve para mostrar que ficheiros e pastas');
terminal.echo('estão num certo local do computador.');
terminal.echo('Experimenta escrever ls e apertar enter a ver o que acontece!\n');
terminal.echo('Caso precises de mais ajuda, podes usar o comando help no terminal. \n');
terminal.echo('[[;#FCE94F;]⚠️ AVISO DE SEGURANÇA: Detetámos actividade suspeita do grupo xad0w.b1ts no sistema.]');
terminal.echo('[[;#888888;] Alguns ficheiros podem ter sido comprometidos. Procede com cautela...]\n');
terminal.echo('[[;#888;]💻 Para melhor experiência, abre o terminal num computador]\n');
terminal.set_prompt(getPrompt());
terminal.resume();
}
// Initialize the terminal
$('#terminal').terminal(async function (command) {
let p_input = readArgs(command);
let comando = p_input.cmd;
let argumentos = p_input.argumentos;
paths.parsedPath = getDirectory(argumentos.path);
switch(comando) {
case 'ls':
this.echo(ls(argumentos));
break;
case 'cd':
output = cd(argumentos)
if(output)
this.echo(output);
this.set_prompt(getPrompt());
break;
case 'cat':
this.echo(cat(argumentos));
break;
case 'grep':
this.echo(grep(argumentos));
break;
case 'show':
this.echo(show(argumentos).replace(/\s+$/, ''));
break;
case 'pwd':
this.echo(pwd());
break;
case 'install':
await installPackage(command, this);
break;
case 'hs-connect':
await connectNetwork(this);
break;
case 'hs-login':
await loginNetwork(command, this);
break;
case 'help':
this.echo(showHelp());
break;
case 'unlock':
await unlockFile(command, this);
break;
case 'empty':
break;
default:
this.echo('Comando não reconhecido. Digite "help" para ver comandos disponíveis.');
}
}, {
greetings: false,
prompt: getPrompt,
name: 'HackerSchool',
promptExit: false,
onInit: async function(terminal) {
await bootSequence(terminal);
}
});
// Help function
function showHelp() {
return `[[;#0f0;]
╔══════════════════════════════════════════════════╗
║ COMANDOS DISPONÍVEIS ║
╚══════════════════════════════════════════════════╝
]
[[;#0f0;]COMANDOS BÁSICOS:]
[[;#3465A4;]ls [path]] Lista ficheiros e pastas
[[;#3465A4;]ls -a [path]] Lista ficheiros incluindo escondidos (.)
[[;#3465A4;]cd [path]] Muda de pasta
[[;#3465A4;]pwd] Mostra pasta atual
[[;#3465A4;]cat <file>] Mostra conteúdo de um ficheiro
[[;#3465A4;]grep <text> <file>] Procura texto num ficheiro
[[;#3465A4;]grep -r <text> [path]] Procura recursivamente
[[;#FCE94F;]COMANDOS ESPECIAIS:]
[[;#3465A4;]install <package>] Instala um pacote de segurança
[[;#3465A4;]unlock <file> <password>] Desencripta ficheiros protegidos
[[;#3465A4;]hs-connect] Conecta à rede HackerSchool
[[;#3465A4;]hs-login <user> <pass>] Autentica na rede segura
[[;#3465A4;]help] Mostra esta mensagem
[[;#888;]EXEMPLOS:]
$ ls
$ ls -a
$ cd pasta_qualquer
$ cat ficheiro1.txt
$ grep "password" ficheiro2.txt
[[;#0f0;]DICA:] Ficheiros que começam com '.' estão escondidos!
[[;#0f0;] Usa 'ls -a' para vê-los.
[[;#0f0;]DICA 2:] Alguns ficheiros podem conter informação escondida!
Se mesmo assim ainda precisares de ajuda, recomendamos o livro "The art of UNIX programming" por Eric Steven Raymond. \nNão, a sério, devias mesmo ir vê-lo.
]`;
}
// HackerSchool Network functions
async function installPackage(command, terminal) {
const parts = command.trim().split(/\s+/);
if (parts.length < 2) {
terminal.echo('Uso: install <package-name>\n\n[[;#888;]Pacotes disponíveis: hs-secure-browser, hs-secure-browser-lts, hs-secure-browser-v2,\nhs-browser-secure, network-access-key, network-access-key-pro, network-access-token,\nnetwork-key-access, secure-network-access, hs-network-connector]\n\n[[;#FCE94F;]💡 ATENÇÃO: Alguns destes pacotes foram comprometidos pelos xad0w.b1ts!]');
return;
}
const packageName = parts[1];
const allPackages = [...networkState.requiredPackages, ...networkState.fakePackages];
if (!allPackages.includes(packageName)) {
terminal.echo(`[[;#EF2929;]Erro: Pacote '${packageName}' não encontrado nos repositórios.]`);
return;
}
if (networkState.installedPackages.includes(packageName)) {
// Se é pacote falso, bloquear
if (networkState.fakePackages.includes(packageName)) {
terminal.echo(`[[;#EF2929;]✗ ACESSO NEGADO]`);
terminal.echo(`[[;#FCE94F;]⚠️ O pacote '${packageName}' foi BLOQUEADO pelo sistema de segurança!]`);
terminal.echo(`[[;#888888;] Este pacote comprometido já tentou infectar o sistema.]`);
terminal.echo(`[[;#888888;] Nova tentativa de instalação foi impedida por precaução.]`);
terminal.echo(`\n[[;#3465A4;]💡 Usa pacotes LEGÍTIMOS da HackerSchool.]`);
} else {
terminal.echo(`[[;#FCE94F;]Aviso: Pacote '${packageName}' já está instalado.]`);
}
return;
}
networkState.installedPackages.push(packageName);
if (networkState.fakePackages.includes(packageName)) {
// ANIMAÇÃO ÉPICA DE HACK
terminal.echo(`[[;#888;]A instalar '${packageName}'...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#888;]A verificar integridade do pacote...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#888;]A analisar assinatura digital...]`);
await new Promise(r => setTimeout(r, 1000));
terminal.echo(`[[;#EF2929;]
╔══════════════════════════════════════════╗
║ ⚠️ ALERTA DE SEGURANÇA ⚠️ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#EF2929;]✗ ERRO: Assinatura digital INVÁLIDA!]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`[[;#888;]A abortar instalação...]`);
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#888;]A limpar ficheiros temporários...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#EF2929;]
ERRO CRÍTICO: Código malicioso detectado!
]`);
await new Promise(r => setTimeout(r, 500));
// GLITCH EFFECT - SMOOTH STREAM
const glitchChars = '█▓▒░!@#$%^&*()_+-={}[]|\\:";\'<>?,./§±×÷';
const evilMessages = [
'AHAHAHAHA não tens escapatória AHAHAHAHA',
'xbxbxbxb diz adeus ao teu terminal xbxbxbxb'
];
// Stream de glitch com mensagens intercaladas
for(let wave = 0; wave < 8; wave++) {
let glitch = '';
for(let j = 0; j < 150; j++) { // ← Reduzido de 60000 para 150!
glitch += glitchChars[Math.floor(Math.random() * glitchChars.length)];
}
terminal.echo(`[[;#EF2929;]${glitch}]`);
await new Promise(r => setTimeout(r, 80));
// Intercalar mensagens evil
if (wave === 1) {
terminal.echo(`[[;#EF2929;]ihihihahahah os xb estão a ver-te ihihihahahah]`);
await new Promise(r => setTimeout(r, 600));
}
if (wave === 4) {
terminal.echo(`[[;#EF2929;]${evilMessages[Math.floor(Math.random() * evilMessages.length)]}]`);
await new Promise(r => setTimeout(r, 600));
}
}
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#FF0000;]
╔═════════════════════════════════╗
║ 💀 SISTEMA COMPROMETIDO 💀 ║
╚═════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 800));
const fakeIP = generateFakeIP();
terminal.echo(`[[;#FF0000;]xad0w.b1ts: Estás a divertir-te? 😂]`);
await new Promise(r => setTimeout(r, 1200));
terminal.echo(`[[;#FF0000;]xad0w.b1ts: Não vais longe, estamos a observar-te.]`);
await new Promise(r => setTimeout(r, 1200));
terminal.echo(`[[;#FF0000;]xad0w.b1ts: O teu IP é ${fakeIP}, Lisboa, Portugal]`);
await new Promise(r => setTimeout(r, 1200));
terminal.echo(`[[;#FF0000;]xad0w.b1ts: Ainda vais a tempo de te salvar. Desiste enquanto podes.]`);
await new Promise(r => setTimeout(r, 1500));
// MORE GLITCH WAVES
for(let wave = 0; wave < 5; wave++) {
let glitch = '';
for(let j = 0; j < 180; j++) { // ← Reduzido para 180
glitch += glitchChars[Math.floor(Math.random() * glitchChars.length)];
}
terminal.echo(`[[;#EF2929;]${glitch}]`);
await new Promise(r => setTimeout(r, 90));
if (wave === 1) {
terminal.echo(`[[;#EF2929;]ihihihahahah consegues sentir o sistema a falhar? ihihihahahah]`);
await new Promise(r => setTimeout(r, 600));
}
if (wave === 3) {
terminal.echo(`[[;#EF2929;]xb xb xb xb estamos em todo o lado xb xb xb xb]`);
await new Promise(r => setTimeout(r, 600));
}
}
terminal.echo(`[[;#EF2929;]SISTEMA FALHANDO... ]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`[[;#EF2929;]PERDA DE DADOS IMINENTE...]`);
await new Promise(r => setTimeout(r, 1000));
// RECOVERY
terminal.echo(`\n[[;#888;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#FCE94F;][SISTEMA] A tentar recuperar...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#FCE94F;][SISTEMA] A isolar ameaça...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;][FIREWALL] A ativar proteção de emergência...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;][FIREWALL] A bloquear tráfego suspeito...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;][ANTIVIRUS] A scanear ficheiros...]`);
await new Promise(r => setTimeout(r, 800));
// Progress bar animation
terminal.echo(`[[;#888;][ANTIVIRUS] A remover malware... ]`);
for(let i = 0; i <= 8; i++) {
const bar = '█'.repeat(i) + '░'.repeat(8 - i);
terminal.update(-1, `[[;#888;][ANTIVIRUS] A remover malware... ${bar} ${Math.floor((i/8)*100)}%]`);
await new Promise(r => setTimeout(r, 200));
}
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#8AE234;][SISTEMA] Ameaça neutralizada!]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#8AE234;][SISTEMA] Sistema restaurado com sucesso!]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#0ff;]
╔═════════════════════════════════════╗
║ ✓ SISTEMA SEGURO NOVAMENTE ✓ ║
╚═════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 1000));
// REBOOT DO SISTEMA
terminal.echo('');
terminal.echo('[[;#FCE94F;][SISTEMA] A reiniciar terminal...]');
await new Promise(r => setTimeout(r, 1200));
terminal.echo('[[;#888;][SISTEMA] A limpar buffer de memória...]');
await new Promise(r => setTimeout(r, 1000));
terminal.echo('[[;#888;][SISTEMA] A recarregar shell...]');
await new Promise(r => setTimeout(r, 800));
// RESET do path para HOME antes do reboot
paths.currentPath = '~';
paths.currentDir = fileSystem['~'];
paths.parsedPath = fileSystem['~'];
// CRUCIAL: Pausar terminal ANTES do clear para bloquear comandos fantasma
terminal.pause();
// Espera para garantir que tudo foi processado
await new Promise(r => setTimeout(r, 500));
// Clear e PURGE para limpar buffer de comandos
terminal.clear();
if (terminal.purge) {
terminal.purge(); // Remove comandos pendentes do buffer
}
await new Promise(r => setTimeout(r, 800));
// Agora faz os echos com segurança
terminal.echo('[[;#8AE234;]╔═════════════════════════════════════╗]');
terminal.echo('[[;#8AE234;]║ SISTEMA REINICIADO ║]');
terminal.echo('[[;#8AE234;]╚═════════════════════════════════════╝]');
await new Promise(r => setTimeout(r, 800));
terminal.echo('');
terminal.echo('[[;#FCE94F;]⚠️ ISSO FOI PERTO! O pacote \''+packageName+'\' era uma ARMADILHA!]');
terminal.echo('[[;#888888;] Os xad0w.b1ts tentaram hackear o teu terminal!]');
terminal.echo('[[;#8AE234;] Felizmente, a proteção neutralizou a ameaça.]');
terminal.echo('');
terminal.echo('[[;#3465A4;]💡 LIÇÃO APRENDIDA:]');
terminal.echo('[[;#888888;] Nem todos os pacotes são legítimos!]');
terminal.echo('[[;#888888;] Procura os pacotes OFICIAIS da HackerSchool.]');
terminal.echo('');
terminal.echo('[[;#888;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]');
await new Promise(r => setTimeout(r, 500));
terminal.echo('[[;#0f0;]HACKERSAUDAÇÕES!]\n');
terminal.echo('Muito bem, recruta! Conseguiste desbloquear a fase 1. Assim damos-te as boas vindas ao início da jornada.\n');
terminal.echo('Para passares à próxima fase, tudo que precisas está nesta página,');
terminal.echo('que é um emulador de terminal UNIX (um pouco limitado!).\n');
terminal.echo('Lembra-te que a internet e agora o chatgpt estão sempre prontos para te ajudar.\n');
terminal.echo('O ls é um comando que serve para mostrar que ficheiros e pastas');
terminal.echo('estão num certo local do computador.');
terminal.echo('Experimenta escrever ls e apertar enter a ver o que acontece!\n');
terminal.echo('Caso precises de mais ajuda, podes usar o comando help no terminal. \n');
terminal.echo('[[;#FCE94F;]⚠️ AVISO DE SEGURANÇA: Detetámos actividade suspeita do grupo xad0w.b1ts no sistema.]');
terminal.echo('[[;#888888;] Alguns ficheiros podem ter sido comprometidos. Procede com cautela...]\n');
terminal.echo('[[;#888;]💻 Para melhor experiência, abre o terminal num computador]\n');
// CRUCIAL: Forçar update do prompt ANTES de reativar
terminal.set_prompt(getPrompt()); // ← Força mostrar guest@hackerschool:~$
// CRUCIAL: Reativar o terminal no final
terminal.resume();
return;
}
// Pacote CORRETO - animação positiva
terminal.echo(`[[;#888;]A instalar '${packageName}'...]`);
await new Promise(r => setTimeout(r, 700));
// Download progress bar
terminal.echo(`[[;#888;]A descarregar pacote... ]`);
for(let i = 0; i <= 16; i++) {
const bar = '█'.repeat(i) + '░'.repeat(16 - i);
terminal.update(-1, `[[;#888;]A descarregar pacote... ${bar} ${Math.floor((i/16)*100)}%]`);
await new Promise(r => setTimeout(r, 80));
}
await new Promise(r => setTimeout(r, 400));
terminal.echo(`[[;#888;]A verificar assinatura digital... ✓]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`[[;#888;]A validar integridade... ✓]`);
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#8AE234;]
╔══════════════════════════════════════════╗
║ ✓ INSTALAÇÃO COMPLETA ✓ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`[[;#8AE234;]✓ Pacote '${packageName}' instalado com sucesso!]`);
// Check if all required packages are installed
const hasAll = networkState.requiredPackages.every(pkg =>
networkState.installedPackages.includes(pkg)
);
if (hasAll) {
await new Promise(r => setTimeout(r, 500));
terminal.echo('\n[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]');
terminal.echo('[[;#0ff;]💡 SISTEMA PRONTO PARA CONEXÃO]');
terminal.echo('[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]');
terminal.echo('[[;#8AE234;]Todos os pacotes necessários foram instalados!]');
terminal.echo('[[;#3465A4;]Podes agora conectar à rede segura: hs-connect]');
}
}
async function connectNetwork(terminal) {
const hasRequired = networkState.requiredPackages.every(pkg =>
networkState.installedPackages.includes(pkg)
);
const hasOnlyFake = networkState.installedPackages.length > 0 &&
networkState.installedPackages.every(pkg => networkState.fakePackages.includes(pkg));
if (!networkState.installedPackages.length) {
terminal.echo(`[[;#EF2929;]Erro: Nenhum pacote de segurança instalado.]
[[;#FCE94F;]Precisas de instalar os pacotes necessários primeiro.]
[[;#3465A4;]Dica: Usa 'install <package-name>' para instalar.]`);
return;
}
if (hasOnlyFake) {
terminal.echo(`[[;#888;]A iniciar conexão...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#888;]A verificar pacotes de segurança...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#EF2929;]
╔══════════════════════════════════════════╗
║ ✗ CONEXÃO FALHADA ✗ ║
╚══════════════════════════════════════════╝
]`);
terminal.echo(`[[;#EF2929;]✗ ERRO: Pacotes comprometidos detectados!]`);
terminal.echo(`[[;#FCE94F;]Os pacotes instalados foram adulterados pelos xad0w.b1ts.]`);
terminal.echo(`[[;#888888;] Status: Assinaturas digitais inválidas]`);
terminal.echo(`[[;#888888;] Ação: Procura os pacotes OFICIAIS da HackerSchool]`);
terminal.echo(`[[;#888888;] Dica: Ficheiros escondidos têm as instruções corretas]`);
return;
}
if (!hasRequired) {
const missing = networkState.requiredPackages.filter(pkg =>
!networkState.installedPackages.includes(pkg)
);
terminal.echo(`[[;#EF2929;]Erro: Pacotes em falta: ${missing.join(', ')}]`);
terminal.echo(`[[;#FCE94F;]Instala todos os pacotes necessários antes de conectar.]`);
return;
}
networkState.isConnected = true;
terminal.echo(`[[;#888;]A iniciar conexão à rede segura...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A verificar pacotes de segurança... ✓]`);
await new Promise(r => setTimeout(r, 600));
// ANIMAÇÃO DE TÚNEL DIGITAL / VÓRTEX
terminal.echo('[[;#888;]A estabelecer túnel encriptado...]');
await new Promise(r => setTimeout(r, 400));
terminal.echo('[[;#0ff;]A abrir portal digital...]');
await new Promise(r => setTimeout(r, 500));
// Vórtex Matrix animation - frames progressivos
const vortexFrames = [
`[[;#0ff;] . : . : . : . ]`,
`[[;#0ff;] · ∴ ∵ ∴ ∵ ∴ ∵ ∴ · ]`,
`[[;#0ff;] ∴ ░▒▓ CONECTANDO ▓▒░ ∴ ]`,
`[[;#0ff;] · ▒▓█ ◆ ◇ ◆ ◇ ◆ █▓▒ · ]`,
`[[;#0ff;] ∵ ▓██ ≋ ≈ ≋ ≈ ≋ ≈ ██▓ ∵ ]`,
`[[;#8AE234;]∴ ███ ▓▒░▒▓ TÚNEL ▓▒░▒▓ ███ ∴]`,
`[[;#8AE234;]███████ ◇◆◇◆◇◆◇◆◇ ███████]`,
`[[;#0ff;]████████████ ∴∵∴∵∴ ████████████]`,
`[[;#0ff;]██████████████████████████████]`
];
for (let frame of vortexFrames) {
terminal.update(-1, frame);
await new Promise(r => setTimeout(r, 200));
}
await new Promise(r => setTimeout(r, 600));
// Flash de luz
terminal.echo('[[;#0ff;]⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡]');
await new Promise(r => setTimeout(r, 150));
terminal.update(-1, '[[;#fff;]████████████████████████████████████████]');
await new Promise(r => setTimeout(r, 150));
terminal.update(-1, '[[;#0ff;]⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡]');
await new Promise(r => setTimeout(r, 300));
terminal.echo('');
await new Promise(r => setTimeout(r, 300));
// Box final aparece
terminal.echo(`[[;#8AE234;]
╔══════════════════════════════════════════╗
║ 🔐 HACKERSCHOOL SECURE NETWORK 🔐 ║
║ Conexão Estabelecida ✓ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`\n[[;#8AE234;]✓ Conectado com sucesso à rede interna da HackerSchool!]`);
terminal.echo(`\n[[;#FCE94F;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#FCE94F;]⚠️ ALERTA DE SEGURANÇA - Intrusão Detectada]`);
terminal.echo(`[[;#FCE94F;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#888888;]O grupo xad0w.b1ts infiltrou-se no sistema.]`);
terminal.echo(`[[;#888888;]Vários ficheiros foram comprometidos com dados falsos.]`);
terminal.echo(`\n[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#0ff;]PRÓXIMO PASSO: Autenticação]`);
terminal.echo(`[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#3465A4;]Comando: hs-login <username> <password>]`);
}
async function loginNetwork(command, terminal) {
if (!networkState.isConnected) {
terminal.echo(`[[;#EF2929;]Erro: Não estás conectado à rede segura.]
[[;#3465A4;]Usa 'hs-connect' primeiro.]`);
return;
}
const parts = command.trim().split(/\s+/);
if (parts.length < 3) {
terminal.echo(`[[;#FCE94F;]Uso: hs-login <username> <password>]`);
return;
}
const _u_inp = parts[1].toLowerCase();
const _p_inp = parts[2].toLowerCase();
if (_u_inp !== networkState._auth_u || _p_inp !== networkState._auth_p) {
terminal.echo(`[[;#888;]A validar credenciais...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A verificar username...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A verificar password...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#EF2929;]
╔══════════════════════════════════════════╗
║ ✗ AUTENTICAÇÃO FALHADA ✗ ║
╚══════════════════════════════════════════╝
]`);
terminal.echo(`[[;#EF2929;]✗ Credenciais inválidas.]`);
terminal.echo(`\n[[;#3465A4;]💡 As credenciais estão num ficheiro especial...]`);
terminal.echo(`[[;#888888;] Precisas de VER melhor... 👁️]`);
return;
}
networkState.isLoggedIn = true;
// Add secure network directory to filesystem
fileSystem['~']['hackerschool_net'] = hackerschoolSecureNetwork;
terminal.echo(`[[;#888;]A validar credenciais...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A verificar username... ✓]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`[[;#888;]A verificar password... ✓]`);
await new Promise(r => setTimeout(r, 600));
// Auth progress bar
terminal.echo(`[[;#888;]A autenticar utilizador... ]`);
for(let i = 0; i <= 12; i++) {
const bar = '█'.repeat(i) + '░'.repeat(12 - i);
terminal.update(-1, `[[;#888;]A autenticar utilizador... ${bar} ${Math.floor((i/12)*100)}%]`);
await new Promise(r => setTimeout(r, 100));
}
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#888;]A carregar perfil de recruta...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A desencriptar ficheiros seguros...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A montar pasta de rede...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#8AE234;]
╔══════════════════════════════════════════╗
║ ✓ AUTENTICAÇÃO BEM-SUCEDIDA! ✓ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`\n[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#0ff;] BEM-VINDO À REDE INTERNA DA HACKERSCHOOL ]`);
terminal.echo(`[[;#0ff;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`\n[[;#8AE234;]✓ Acesso concedido.]`);
terminal.echo(`[[;#8AE234;]✓ Nova pasta montada: 'hackerschool_net']`);
terminal.echo(`\n[[;#FCE94F;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#FCE94F;]⚠️ ALERTA DE SEGURANÇA - IMPORTANTE]`);
terminal.echo(`[[;#FCE94F;]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━]`);
terminal.echo(`[[;#888888;]Os xad0w.b1ts comprometeram vários ficheiros na rede.]`);
terminal.echo(`[[;#888888;]Eles injetaram dados FALSOS para te confundir!]`);
terminal.echo(`\n[[;#FCE94F;]Boa sorte, recruta! 🚀]`);
}
// Unlock encrypted files
async function unlockFile(command, terminal) {
const parts = command.trim().split(/\s+/);
if (parts.length < 3) {
terminal.echo(`[[;#FCE94F;]Uso: unlock <filename> <password>]
[[;#888;]Exemplo: unlock .access_instructions.txt senha123]`);
return;
}
const filename = parts[1];
const _p_inp = parts[2];
// Build the correct path
let targetPath = filename;
if (!filename.startsWith('~') && !filename.startsWith('/')) {
// Relative path - add current path
if (paths.currentPath === '~') {
targetPath = '~/' + filename;
} else {
targetPath = paths.currentPath + '/' + filename;
}
}
// Try to get the file from filesystem directly
let file = null;
const pathParts = targetPath.split('/').filter(p => p && p !== '~');
let current = fileSystem['~'];
for (const part of pathParts) {
if (current && current[part]) {
current = current[part];
} else {
terminal.echo(`[[;#EF2929;]Erro: Ficheiro '${filename}' não encontrado.]`);
return;
}
}
file = current;
if (!file || typeof file !== 'object' || !file.content) {
terminal.echo(`[[;#EF2929;]Erro: '${filename}' não é um ficheiro válido.]`);
return;
}
if (!file.isLocked) {
terminal.echo(`[[;#FCE94F;]Aviso: Ficheiro '${filename}' não está encriptado.]`);
return;
}
// Ofuscação: decode da senha correta
const _unlock_k = String.fromCharCode(115,116,64,108,108,109,52,110);
if (_p_inp !== _unlock_k) {
terminal.echo(`[[;#888;]A tentar desencriptar...]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#888;]A validar password...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#EF2929;]
╔══════════════════════════════════════════╗
║ ✗ PASSWORD INCORRECTA ✗ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#EF2929;]✗ Falha na desencriptação.]`);
terminal.echo(`[[;#888888;] Status: INVÁLIDA]`);
terminal.echo(`\n[[;#3465A4;]💡 Procura a password nos outros ficheiros...]`);
terminal.echo(`[[;#888888;] Algo relacionado com o fundador do Free Software]`);
return;
}
// Unlock successful
file.isLocked = false;
file.content = `[COMUNICAÇÃO INTERNA - HackerSchool]
[✓ DESENCRIPTADO]
[CONFIDENCIAL]
Data: 2025-10-18
De: Admin HackerSchool
Para: Recrutas
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Ficheiro desencriptado com sucesso!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INSTRUÇÕES DE ACESSO À REDE SEGURA
Bem-vindo ao processo de recrutamento!
Para acederes à nossa rede interna, segue estes passos:
1️⃣ INSTALAR PACOTES DE SEGURANÇA
Precisas de 2 pacotes específicos:
• hs-sxbure-broxber???? (navegador seguro)
• nxbwork-accexb-key (chave de acesso)
⚠️ ATENÇÃO CRÍTICA: Os xad0w.b1ts infiltraram
VÁRIOS pacotes FALSOS no sistema!
💡 DICA: As letras "xb" nestes nomes representam
caracteres corrompidos, e "????" são carateres em dúvida
(ou seja, há incerteza se são carateres mesmo necessários). Substitui por letras que
façam sentido! Só os pacotes OFICIAIS funcionam!
2️⃣ ESTABELECER CONEXÃO
Comando: hs-connect
3️⃣ AUTENTICAÇÃO
Não consegues VER onde está? 👁️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANTE:
- Usa 'install <package-name>' para instalar`;
terminal.echo(`[[;#888;]A tentar desencriptar ficheiro...]`);
await new Promise(r => setTimeout(r, 700));
/* password eheh claramente és hacker tryhard, e sinto-me na obrigação de dizer: não é isto que fazemos na hackerschool. se gostas de cyber e fazer CTFs, junta-te à STT ou a outro clube de cibersegurança. o objetivo do núcleo é sermos hackers da tecnologia overall e divertirmo-nos com as ferramentas com que o nosso século nos presenteia. fazer este terminal é o tipo de coisas que se faz por aqui. se estás ok com isso, então junta-te ao gang. lov you e espero ver-te em breve. arpg */
// Password validation progress bar
terminal.echo(`[[;#888;]A validar password... ]`);
for(let i = 0; i <= 8; i++) {
const bar = '█'.repeat(i) + '░'.repeat(8 - i);
terminal.update(-1, `[[;#888;]A validar password... ${bar} ${Math.floor((i/8)*100)}%]`);
await new Promise(r => setTimeout(r, 150));
}
await new Promise(r => setTimeout(r, 500));
terminal.echo(`[[;#888;]A aplicar chave AES-256...]`);
await new Promise(r => setTimeout(r, 800));
terminal.echo(`[[;#888;]A desencriptar blocos... ✓]`);
await new Promise(r => setTimeout(r, 700));
terminal.echo(`[[;#8AE234;]
╔══════════════════════════════════════════╗
║ ✓ DESENCRIPTAÇÃO BEM-SUCEDIDA! ✓ ║
╚══════════════════════════════════════════╝
]`);
await new Promise(r => setTimeout(r, 600));
terminal.echo(`\n[[;#8AE234;]✓ Ficheiro '${filename}' desencriptado!]`);
terminal.echo(`[[;#3465A4;]Podes agora ler o ficheiro com: cat ${filename}]`);
}
// ========== MATRIX RAIN EFFECT ==========
(function() {
const canvas = document.getElementById('matrix-canvas');
if (!canvas) return;
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
class Symbol {
constructor(x, y, fontSize, canvasHeight) {
this.characters = "アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトノホモヨョロヲゴゾドボポヴッン0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
this.x = x;
this.y = y;
this.fontSize = fontSize;
this.canvasHeight = canvasHeight;
this.text = "";
}
draw(context) {
this.text = this.characters.charAt(
Math.floor(Math.random() * this.characters.length)
);
context.textAlign = "center";
context.font = this.fontSize + "px monospace";
context.fillText(this.text, this.x * this.fontSize, this.y * this.fontSize);
}
update() {
if (this.y * this.fontSize > this.canvasHeight && Math.random() > 0.98) {
this.y = 0;
} else {
this.y += 1;
}
}
}
class Effect {
constructor(canvasWidth, canvasHeight) {
this.canvasWidth = canvasWidth;
this.canvasHeight = canvasHeight;
this.fontSize = 17;
this.columns = canvasWidth / this.fontSize;
this.symbols = [];
this.initialize();
}
initialize() {
for (let i = 0; i < this.columns; i++) {
this.symbols[i] = new Symbol(i, 0, this.fontSize, this.canvasHeight);
}
}
resize(width, height) {
this.canvasWidth = width;
this.canvasHeight = height;
this.columns = this.canvasWidth / this.fontSize;
this.symbols = [];
this.initialize();
}
}
const singleColor = "#0aff0a";
const matrixEffect = new Effect(canvas.width, canvas.height);
let lastTime = 0;
const fps = 50;
const nextframe = 1000 / fps;
let timer = 0;
function animate(timeStamp) {
const deltaTime = timeStamp - lastTime;
lastTime = timeStamp;
if (timer > nextframe) {
ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = singleColor;
matrixEffect.symbols.forEach((symbol) => {
symbol.draw(ctx);
symbol.update();
});
timer = 0;
} else {
timer += deltaTime;
}
requestAnimationFrame(animate);
}
animate(0);
window.addEventListener("resize", () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
matrixEffect.resize(canvas.width, canvas.height);
});
})();