File size: 42,094 Bytes
20e694a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HackTool Pro - macOS</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }
        .cursor-blink {
            animation: blink 1s step-end infinite;
        }
        .window {
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            overflow: hidden;
        }
        .terminal-bg {
            background-color: #1a1a1a;
        }
        .scrollbar-hide::-webkit-scrollbar {
            display: none;
        }
        .command-history {
            height: calc(100% - 40px);
        }
        .macos-traffic-light {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-right: 8px;
        }
        .sidebar-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        .sidebar-item.active {
            background-color: rgba(0, 122, 255, 0.2);
            border-left: 3px solid #007aff;
        }
        .typewriter {
            overflow: hidden;
            white-space: nowrap;
            margin: 0 auto;
            letter-spacing: 0.15em;
        }
    </style>
</head>
<body class="bg-gray-900 text-white h-screen overflow-hidden flex items-center justify-center p-4">
    <div class="window w-full max-w-6xl h-[90vh] flex flex-col">
        <!-- Title Bar -->
        <div class="bg-gray-800 rounded-t-lg flex items-center px-4 py-2">
            <div class="flex mr-4">
                <div class="macos-traffic-light bg-red-500"></div>
                <div class="macos-traffic-light bg-yellow-500"></div>
                <div class="macos-traffic-light bg-green-500"></div>
            </div>
            <div class="text-sm font-medium text-gray-300 flex-1 text-center">
                HackTool Pro - Terminal
            </div>
            <div class="text-xs text-gray-500">
                v2.4.1
            </div>
        </div>

        <!-- Main Content -->
        <div class="flex flex-1 overflow-hidden">
            <!-- Sidebar -->
            <div class="w-64 bg-gray-800 p-4 flex flex-col">
                <div class="mb-6">
                    <div class="text-xs uppercase text-gray-500 mb-2">Quick Actions</div>
                    <button class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded text-sm w-full mb-2 flex items-center">
                        <i class="fas fa-bolt mr-2"></i> Quick Scan
                    </button>
                    <button class="bg-green-600 hover:bg-green-700 text-white px-3 py-1 rounded text-sm w-full flex items-center">
                        <i class="fas fa-shield-alt mr-2"></i> Defense Mode
                    </button>
                </div>

                <div class="mb-6">
                    <div class="text-xs uppercase text-gray-500 mb-2">Hacking Tools</div>
                    <div class="space-y-1">
                        <div class="sidebar-item active px-3 py-2 rounded text-sm cursor-pointer flex items-center">
                            <i class="fas fa-terminal mr-2 text-blue-400"></i> Terminal
                        </div>
                        <div class="sidebar-item px-3 py-2 rounded text-sm cursor-pointer flex items-center">
                            <i class="fas fa-network-wired mr-2 text-purple-400"></i> Network Scanner
                        </div>
                        <div class="sidebar-item px-3 py-2 rounded text-sm cursor-pointer flex items-center">
                            <i class="fas fa-lock mr-2 text-yellow-400"></i> Password Cracker
                        </div>
                        <div class="sidebar-item px-3 py-2 rounded text-sm cursor-pointer flex items-center">
                            <i class="fas fa-code mr-2 text-red-400"></i> Exploit Database
                        </div>
                    </div>
                </div>

                <div class="mb-6 flex-1">
                    <div class="text-xs uppercase text-gray-500 mb-2">Preset Commands</div>
                    <div class="bg-gray-700 rounded p-2 h-64 overflow-y-auto scrollbar-hide">
                        <div class="grid grid-cols-2 gap-2">
                            <button onclick="runPresetCommand(1)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">1. Port Scan</button>
                            <button onclick="runPresetCommand(2)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">2. Ping Sweep</button>
                            <button onclick="runPresetCommand(3)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">3. DNS Enum</button>
                            <button onclick="runPresetCommand(4)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">4. WHOIS Lookup</button>
                            <button onclick="runPresetCommand(5)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">5. Subdomain Brute</button>
                            <button onclick="runPresetCommand(6)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">6. HTTP Header</button>
                            <button onclick="runPresetCommand(7)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">7. SSL Check</button>
                            <button onclick="runPresetCommand(8)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">8. SQL Injection</button>
                            <button onclick="runPresetCommand(9)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">9. XSS Test</button>
                            <button onclick="runPresetCommand(10)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">10. CSRF Test</button>
                            <button onclick="runPresetCommand(11)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">11. Brute Force</button>
                            <button onclick="runPresetCommand(12)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">12. Hash Crack</button>
                            <button onclick="runPresetCommand(13)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">13. Wifi Scan</button>
                            <button onclick="runPresetCommand(14)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">14. ARP Spoof</button>
                            <button onclick="runPresetCommand(15)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">15. MAC Changer</button>
                            <button onclick="runPresetCommand(16)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">16. Packet Sniff</button>
                            <button onclick="runPresetCommand(17)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">17. MITM Attack</button>
                            <button onclick="runPresetCommand(18)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">18. DOS Attack</button>
                            <button onclick="runPresetCommand(19)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">19. SSH Brute</button>
                            <button onclick="runPresetCommand(20)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">20. FTP Brute</button>
                            <button onclick="runPresetCommand(21)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">21. RDP Brute</button>
                            <button onclick="runPresetCommand(22)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">22. SMTP Enum</button>
                            <button onclick="runPresetCommand(23)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">23. SNMP Walk</button>
                            <button onclick="runPresetCommand(24)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">24. LDAP Enum</button>
                            <button onclick="runPresetCommand(25)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">25. SMB Enum</button>
                            <button onclick="runPresetCommand(26)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">26. NFS Enum</button>
                            <button onclick="runPresetCommand(27)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">27. MySQL Brute</button>
                            <button onclick="runPresetCommand(28)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">28. MSSQL Brute</button>
                            <button onclick="runPresetCommand(29)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">29. Oracle Brute</button>
                            <button onclick="runPresetCommand(30)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">30. Postgres Brute</button>
                            <button onclick="runPresetCommand(31)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">31. Redis Brute</button>
                            <button onclick="runPresetCommand(32)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">32. MongoDB Brute</button>
                            <button onclick="runPresetCommand(33)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">33. Elastic Brute</button>
                            <button onclick="runPresetCommand(34)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">34. Jenkins Brute</button>
                            <button onclick="runPresetCommand(35)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">35. Docker Enum</button>
                            <button onclick="runPresetCommand(36)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">36. Kubernetes Enum</button>
                            <button onclick="runPresetCommand(37)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">37. AWS Enum</button>
                            <button onclick="runPresetCommand(38)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">38. Azure Enum</button>
                            <button onclick="runPresetCommand(39)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">39. GCP Enum</button>
                            <button onclick="runPresetCommand(40)" class="bg-gray-600 hover:bg-gray-500 text-xs p-1 rounded truncate">40. Metasploit</button>
                        </div>
                    </div>
                </div>

                <div class="text-xs text-gray-500 text-center">
                    Connected: <span class="text-green-400">localhost</span>
                </div>
            </div>

            <!-- Terminal -->
            <div class="flex-1 flex flex-col terminal-bg">
                <div class="p-4 border-b border-gray-700 flex items-center">
                    <div class="flex-1">
                        <div class="text-sm font-medium">Terminal Session</div>
                        <div class="text-xs text-gray-500">Interactive hacking console</div>
                    </div>
                    <div class="flex space-x-2">
                        <button class="bg-gray-700 hover:bg-gray-600 p-1 rounded">
                            <i class="fas fa-cog text-gray-400 text-sm"></i>
                        </button>
                        <button class="bg-gray-700 hover:bg-gray-600 p-1 rounded">
                            <i class="fas fa-expand text-gray-400 text-sm"></i>
                        </button>
                    </div>
                </div>

                <div class="flex-1 p-4 overflow-y-auto scrollbar-hide command-history" id="terminal-output">
                    <div class="text-green-400 mb-4">
                        <div class="flex items-baseline">
                            <span class="text-purple-400 font-mono">hacktool-pro</span>
                            <span class="text-gray-500 mx-1">@</span>
                            <span class="text-yellow-400 font-mono">localhost</span>
                            <span class="text-gray-500 mx-1">~</span>
                            <span class="text-gray-500">$</span>
                            <span class="ml-2 typewriter" style="width: 350px;">Welcome to HackTool Pro v2.4.1 - Ethical Hacking Terminal</span>
                        </div>
                    </div>
                    <div class="text-gray-400 text-sm mb-4">
                        Type <span class="text-blue-400">help</span> to see available commands or click on preset commands from the sidebar.
                    </div>
                    <div class="text-gray-400 text-sm mb-4">
                        <div class="flex items-baseline">
                            <span class="text-purple-400 font-mono">hacktool-pro</span>
                            <span class="text-gray-500 mx-1">@</span>
                            <span class="text-yellow-400 font-mono">localhost</span>
                            <span class="text-gray-500 mx-1">~</span>
                            <span class="text-gray-500">$</span>
                            <span class="ml-2">Initializing system...</span>
                        </div>
                        <div class="ml-8 text-green-400">βœ“ Security protocols enabled</div>
                        <div class="ml-8 text-green-400">βœ“ Command modules loaded</div>
                        <div class="ml-8 text-green-400">βœ“ Network interfaces ready</div>
                    </div>
                </div>

                <div class="p-4 border-t border-gray-700">
                    <div class="flex items-center">
                        <span class="text-green-400 font-mono mr-2">$</span>
                        <input type="text" id="command-input" class="bg-transparent border-none outline-none flex-1 font-mono text-green-400" placeholder="Enter command..." autofocus>
                        <button class="ml-2 bg-blue-600 hover:bg-blue-700 px-3 py-1 rounded text-sm" onclick="executeCommand()">
                            Run
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- Status Bar -->
        <div class="bg-gray-800 rounded-b-lg px-4 py-2 flex items-center justify-between text-xs">
            <div class="text-gray-400">
                <span class="text-green-400">Ready</span> | <span>CPU: 12%</span> | <span>MEM: 34%</span>
            </div>
            <div class="flex items-center space-x-4">
                <div class="flex items-center text-gray-400">
                    <i class="fas fa-shield-alt mr-1 text-green-400"></i>
                    <span>Secure</span>
                </div>
                <div class="flex items-center text-gray-400">
                    <i class="fas fa-network-wired mr-1 text-blue-400"></i>
                    <span>192.168.1.105</span>
                </div>
                <div class="flex items-center text-gray-400">
                    <i class="fas fa-clock mr-1 text-yellow-400"></i>
                    <span id="current-time"></span>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Update current time
        function updateTime() {
            const now = new Date();
            document.getElementById('current-time').textContent = now.toLocaleTimeString();
        }
        setInterval(updateTime, 1000);
        updateTime();

        // Command history
        let commandHistory = [];
        let historyIndex = -1;

        // Terminal functions
        const terminalOutput = document.getElementById('terminal-output');
        const commandInput = document.getElementById('command-input');

        // Focus input on any click in the terminal
        document.addEventListener('click', () => {
            commandInput.focus();
        });

        // Handle command execution
        function executeCommand() {
            const command = commandInput.value.trim();
            if (!command) return;

            // Add to history
            commandHistory.push(command);
            historyIndex = commandHistory.length;

            // Display command
            addCommandToTerminal(command);

            // Process command
            processCommand(command);

            // Clear input
            commandInput.value = '';
        }

        // Handle Enter key
        commandInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter') {
                executeCommand();
            }
        });

        // Handle up/down arrows for history
        commandInput.addEventListener('keydown', (e) => {
            if (e.key === 'ArrowUp' && commandHistory.length > 0) {
                e.preventDefault();
                if (historyIndex > 0) historyIndex--;
                commandInput.value = commandHistory[historyIndex] || '';
            } else if (e.key === 'ArrowDown' && commandHistory.length > 0) {
                e.preventDefault();
                if (historyIndex < commandHistory.length - 1) historyIndex++;
                commandInput.value = commandHistory[historyIndex] || '';
                if (historyIndex === commandHistory.length - 1) {
                    commandInput.value = '';
                    historyIndex = commandHistory.length;
                }
            }
        });

        // Add command to terminal output
        function addCommandToTerminal(command) {
            const commandElement = document.createElement('div');
            commandElement.className = 'text-green-400 mb-2';
            commandElement.innerHTML = `
                <div class="flex items-baseline">
                    <span class="text-purple-400 font-mono">hacktool-pro</span>
                    <span class="text-gray-500 mx-1">@</span>
                    <span class="text-yellow-400 font-mono">localhost</span>
                    <span class="text-gray-500 mx-1">~</span>
                    <span class="text-gray-500">$</span>
                    <span class="ml-2">${command}</span>
                </div>
            `;
            terminalOutput.appendChild(commandElement);
            terminalOutput.scrollTop = terminalOutput.scrollHeight;
        }

        // Add output to terminal
        function addOutputToTerminal(output, isError = false) {
            const outputElement = document.createElement('div');
            outputElement.className = isError ? 'text-red-400 mb-4 font-mono text-sm' : 'text-gray-300 mb-4 font-mono text-sm';
            outputElement.innerHTML = output;
            terminalOutput.appendChild(outputElement);
            terminalOutput.scrollTop = terminalOutput.scrollHeight;
        }

        // Process commands
        function processCommand(command) {
            const cmd = command.split(' ')[0].toLowerCase();
            const args = command.split(' ').slice(1);

            switch(cmd) {
                case 'help':
                    showHelp();
                    break;
                case 'clear':
                    terminalOutput.innerHTML = '';
                    break;
                case 'scan':
                    runScan(args);
                    break;
                case 'exploit':
                    runExploit(args);
                    break;
                case 'crack':
                    runCrack(args);
                    break;
                case 'brute':
                    runBrute(args);
                    break;
                case 'sniff':
                    runSniff(args);
                    break;
                case 'spoof':
                    runSpoof(args);
                    break;
                case 'dos':
                    runDos(args);
                    break;
                case 'mitm':
                    runMitm(args);
                    break;
                case 'enum':
                    runEnum(args);
                    break;
                case 'list':
                    showPresetCommands();
                    break;
                default:
                    addOutputToTerminal(`Command not found: ${cmd}. Type 'help' for available commands.`, true);
            }
        }

        // Show help
        function showHelp() {
            const helpText = `
                <div class="mb-2 text-blue-400">Available Commands:</div>
                <div class="grid grid-cols-2 gap-2 mb-2">
                    <div><span class="text-green-400">help</span> - Show this help message</div>
                    <div><span class="text-green-400">clear</span> - Clear the terminal</div>
                    <div><span class="text-green-400">scan</span> [target] - Run network scan</div>
                    <div><span class="text-green-400">exploit</span> [target] - Run exploit</div>
                    <div><span class="text-green-400">crack</span> [hash] - Crack password hash</div>
                    <div><span class="text-green-400">brute</span> [service] - Brute force attack</div>
                    <div><span class="text-green-400">sniff</span> [interface] - Packet sniffing</div>
                    <div><span class="text-green-400">spoof</span> [target] - ARP spoofing</div>
                    <div><span class="text-green-400">dos</span> [target] - Denial of Service</div>
                    <div><span class="text-green-400">mitm</span> [target] - Man in the Middle</div>
                    <div><span class="text-green-400">enum</span> [service] - Service enumeration</div>
                    <div><span class="text-green-400">list</span> - Show preset commands</div>
                </div>
                <div class="text-gray-500 text-xs">Use preset commands from sidebar for specific tools</div>
            `;
            addOutputToTerminal(helpText);
        }

        // Show preset commands
        function showPresetCommands() {
            let commands = `
                <div class="mb-2 text-blue-400">Preset Commands (click in sidebar):</div>
                <div class="grid grid-cols-2 gap-1 text-xs">
            `;
            
            for (let i = 1; i <= 40; i++) {
                const cmdName = getPresetCommandName(i);
                commands += `<div>${i}. ${cmdName}</div>`;
            }
            
            commands += `</div>`;
            addOutputToTerminal(commands);
        }

        // Run preset command
        function runPresetCommand(num) {
            const cmdName = getPresetCommandName(num);
            const cmd = getPresetCommand(num);
            
            // Simulate typing
            commandInput.value = cmd;
            
            // Execute after a short delay
            setTimeout(() => {
                executeCommand();
            }, 100);
        }

        // Get preset command name
        function getPresetCommandName(num) {
            const commands = [
                "Port Scan", "Ping Sweep", "DNS Enum", "WHOIS Lookup", "Subdomain Brute",
                "HTTP Header", "SSL Check", "SQL Injection", "XSS Test", "CSRF Test",
                "Brute Force", "Hash Crack", "Wifi Scan", "ARP Spoof", "MAC Changer",
                "Packet Sniff", "MITM Attack", "DOS Attack", "SSH Brute", "FTP Brute",
                "RDP Brute", "SMTP Enum", "SNMP Walk", "LDAP Enum", "SMB Enum",
                "NFS Enum", "MySQL Brute", "MSSQL Brute", "Oracle Brute", "Postgres Brute",
                "Redis Brute", "MongoDB Brute", "Elastic Brute", "Jenkins Brute", "Docker Enum",
                "Kubernetes Enum", "AWS Enum", "Azure Enum", "GCP Enum", "Metasploit"
            ];
            return commands[num - 1] || "Unknown Command";
        }

        // Get preset command
        function getPresetCommand(num) {
            const commands = [
                "scan -p 1-1024", "scan -ping", "enum dns", "whois lookup", "scan -subdomains",
                "scan -http", "scan -ssl", "exploit sql", "exploit xss", "exploit csrf",
                "brute all", "crack md5", "scan -wifi", "spoof arp", "spoof mac",
                "sniff eth0", "mitm start", "dos flood", "brute ssh", "brute ftp",
                "brute rdp", "enum smtp", "enum snmp", "enum ldap", "enum smb",
                "enum nfs", "brute mysql", "brute mssql", "brute oracle", "brute postgres",
                "brute redis", "brute mongodb", "brute elastic", "brute jenkins", "enum docker",
                "enum kubernetes", "enum aws", "enum azure", "enum gcp", "exploit msf"
            ];
            return commands[num - 1] || "help";
        }

        // Command functions
        function runScan(args) {
            let output = "<div class='text-yellow-400'>Starting scan...</div>";
            
            if (args.includes('-p')) {
                output += `
                    <div class='ml-4'>
                        <div>Scanning ports 1-1024 on target...</div>
                        <div class='text-green-400'>βœ“ Port 22 (SSH) open</div>
                        <div class='text-green-400'>βœ“ Port 80 (HTTP) open</div>
                        <div class='text-green-400'>βœ“ Port 443 (HTTPS) open</div>
                        <div class='text-gray-500'>βœ— Port 3389 (RDP) closed</div>
                        <div>Scan completed in 4.2 seconds</div>
                    </div>
                `;
            } else if (args.includes('-ping')) {
                output += `
                    <div class='ml-4'>
                        <div>Pinging network range 192.168.1.1-254...</div>
                        <div class='text-green-400'>βœ“ 192.168.1.1 (Router) responding</div>
                        <div class='text-green-400'>βœ“ 192.168.1.105 (This machine)</div>
                        <div class='text-green-400'>βœ“ 192.168.1.120 (Unknown device)</div>
                        <div>5 hosts found in 8.7 seconds</div>
                    </div>
                `;
            } else if (args.includes('-wifi')) {
                output += `
                    <div class='ml-4'>
                        <div>Scanning nearby WiFi networks...</div>
                        <div class='text-green-400'>βœ“ HomeWiFi (Signal: 85%, Security: WPA2)</div>
                        <div class='text-green-400'>βœ“ GuestNetwork (Signal: 60%, Security: Open)</div>
                        <div class='text-green-400'>βœ“ NeighborWiFi (Signal: 45%, Security: WPA3)</div>
                        <div>3 networks found</div>
                    </div>
                `;
            } else if (args.includes('-subdomains')) {
                output += `
                    <div class='ml-4'>
                        <div>Brute-forcing subdomains for example.com...</div>
                        <div class='text-green-400'>βœ“ Found: www.example.com</div>
                        <div class='text-green-400'>βœ“ Found: mail.example.com</div>
                        <div class='text-green-400'>βœ“ Found: api.example.com</div>
                        <div class='text-green-400'>βœ“ Found: dev.example.com</div>
                        <div>4 subdomains discovered</div>
                    </div>
                `;
            } else if (args.includes('-http')) {
                output += `
                    <div class='ml-4'>
                        <div>Fetching HTTP headers for target...</div>
                        <div>Server: Apache/2.4.41</div>
                        <div>X-Powered-By: PHP/7.4.3</div>
                        <div>Content-Type: text/html; charset=UTF-8</div>
                        <div>X-Frame-Options: SAMEORIGIN</div>
                    </div>
                `;
            } else if (args.includes('-ssl')) {
                output += `
                    <div class='ml-4'>
                        <div>Checking SSL certificate...</div>
                        <div>Issuer: Let's Encrypt</div>
                        <div>Valid until: 2023-12-31</div>
                        <div>Signature Algorithm: SHA256-RSA</div>
                        <div class='text-yellow-400'>Warning: TLS 1.0 enabled</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid scan type. Use 'scan -p' for port scan, 'scan -ping' for ping sweep, etc.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runExploit(args) {
            let output = "<div class='text-yellow-400'>Preparing exploit...</div>";
            
            if (args.includes('sql')) {
                output += `
                    <div class='ml-4'>
                        <div>Testing for SQL injection vulnerabilities...</div>
                        <div class='text-green-400'>βœ“ Vulnerable parameter found: 'id'</div>
                        <div>Attempting UNION-based injection...</div>
                        <div class='text-green-400'>βœ“ Success! Database version: MySQL 5.7.32</div>
                        <div>Dumping database names:</div>
                        <div class='ml-4'>- information_schema</div>
                        <div class='ml-4'>- website_db</div>
                        <div class='ml-4'>- users_db</div>
                    </div>
                `;
            } else if (args.includes('xss')) {
                output += `
                    <div class='ml-4'>
                        <div>Testing for XSS vulnerabilities...</div>
                        <div class='text-green-400'>βœ“ Reflected XSS found in search parameter</div>
                        <div class='text-green-400'>βœ“ Stored XSS found in comment form</div>
                        <div>Example payload: &lt;script&gt;alert(1)&lt;/script&gt;</div>
                    </div>
                `;
            } else if (args.includes('csrf')) {
                output += `
                    <div class='ml-4'>
                        <div>Testing for CSRF vulnerabilities...</div>
                        <div class='text-green-400'>βœ“ No CSRF token found in password change form</div>
                        <div>Vulnerable to CSRF attacks</div>
                    </div>
                `;
            } else if (args.includes('msf')) {
                output += `
                    <div class='ml-4'>
                        <div>Starting Metasploit framework...</div>
                        <div>msf6 > use exploit/multi/handler</div>
                        <div>msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp</div>
                        <div>msf6 exploit(multi/handler) > set LHOST 192.168.1.105</div>
                        <div>msf6 exploit(multi/handler) > set LPORT 4444</div>
                        <div>msf6 exploit(multi/handler) > exploit</div>
                        <div class='text-green-400'>[*] Started reverse TCP handler on 192.168.1.105:4444</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid exploit type. Use 'exploit sql', 'exploit xss', etc.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runCrack(args) {
            let output = "<div class='text-yellow-400'>Starting hash cracking...</div>";
            
            if (args.includes('md5')) {
                output += `
                    <div class='ml-4'>
                        <div>Hash: 5f4dcc3b5aa765d61d8327deb882cf99</div>
                        <div>Using rockyou.txt wordlist...</div>
                        <div class='text-green-400'>βœ“ Cracked: password (0.4 seconds)</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid hash type. Use 'crack md5' for MD5 hashes.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runBrute(args) {
            let output = "<div class='text-yellow-400'>Preparing brute force attack...</div>";
            
            if (args.includes('ssh')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: SSH (192.168.1.120:22)</div>
                        <div>Username list: top-usernames.txt</div>
                        <div>Password list: rockyou.txt</div>
                        <div>Starting attack...</div>
                        <div class='text-green-400'>βœ“ Found credentials: admin:admin123</div>
                        <div>Time elapsed: 12 minutes</div>
                    </div>
                `;
            } else if (args.includes('ftp')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: FTP (192.168.1.120:21)</div>
                        <div>Username list: common-ftp-users.txt</div>
                        <div>Password list: rockyou.txt</div>
                        <div>Starting attack...</div>
                        <div class='text-green-400'>βœ“ Found credentials: ftpuser:ftp123</div>
                        <div>Time elapsed: 8 minutes</div>
                    </div>
                `;
            } else if (args.includes('all')) {
                output += `
                    <div class='ml-4'>
                        <div>Running multi-service brute force...</div>
                        <div class='text-green-400'>βœ“ SSH: admin:admin123</div>
                        <div class='text-green-400'>βœ“ FTP: ftpuser:ftp123</div>
                        <div class='text-red-400'>βœ— RDP: No valid credentials</div>
                        <div>Completed in 25 minutes</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid service. Use 'brute ssh', 'brute ftp', etc.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runSniff(args) {
            let output = "<div class='text-yellow-400'>Starting packet sniffing...</div>";
            
            if (args.includes('eth0') || args.includes('start')) {
                output += `
                    <div class='ml-4'>
                        <div>Interface: eth0</div>
                        <div>Filter: tcp port 80</div>
                        <div>Capturing packets (Ctrl+C to stop)...</div>
                        <div class='text-xs font-mono mt-2'>
                            <div>192.168.1.105:52341 -> 142.250.190.46:80 [GET / HTTP/1.1]</div>
                            <div>192.168.1.105:52342 -> 151.101.1.69:80 [GET /static/logo.png HTTP/1.1]</div>
                            <div>192.168.1.120:52343 -> 192.168.1.105:80 [POST /login HTTP/1.1]</div>
                            <div>... capturing more packets ...</div>
                        </div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid interface. Use 'sniff eth0'.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runSpoof(args) {
            let output = "<div class='text-yellow-400'>Preparing spoofing attack...</div>";
            
            if (args.includes('arp')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: 192.168.1.120</div>
                        <div>Gateway: 192.168.1.1</div>
                        <div>Starting ARP spoofing...</div>
                        <div class='text-green-400'>βœ“ Poisoning ARP tables</div>
                        <div>Redirecting traffic through this machine</div>
                        <div class='text-yellow-400'>Warning: This will disrupt network connectivity</div>
                    </div>
                `;
            } else if (args.includes('mac')) {
                output += `
                    <div class='ml-4'>
                        <div>Interface: eth0</div>
                        <div>Current MAC: 00:1A:2B:3C:4D:5E</div>
                        <div>Changing to random MAC address...</div>
                        <div class='text-green-400'>βœ“ New MAC: 12:34:56:78:90:AB</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid spoof type. Use 'spoof arp' or 'spoof mac'.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runDos(args) {
            let output = "<div class='text-yellow-400'>Preparing DoS attack...</div>";
            
            if (args.includes('flood')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: 192.168.1.120:80</div>
                        <div>Attack type: SYN Flood</div>
                        <div>Starting attack with 1000 packets/second...</div>
                        <div class='text-green-400'>βœ“ Target response slowing down</div>
                        <div class='text-green-400'>βœ“ Target service unavailable</div>
                        <div class='text-yellow-400'>Warning: This is illegal without permission</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid DoS type. Use 'dos flood'.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runMitm(args) {
            let output = "<div class='text-yellow-400'>Preparing MITM attack...</div>";
            
            if (args.includes('start')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: 192.168.1.120</div>
                        <div>Gateway: 192.168.1.1</div>
                        <div>Starting ARP poisoning...</div>
                        <div class='text-green-400'>βœ“ Traffic redirected</div>
                        <div>Starting SSLstrip...</div>
                        <div class='text-green-400'>βœ“ Capturing plaintext credentials</div>
                        <div>Starting packet inspection...</div>
                        <div class='text-xs font-mono mt-2'>
                            <div>[HTTP] username: johndoe, password: s3cr3t</div>
                            <div>[COOKIE] sessionid: a1b2c3d4e5f6</div>
                            <div>... capturing more data ...</div>
                        </div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid command. Use 'mitm start'.</div>";
            }
            
            addOutputToTerminal(output);
        }

        function runEnum(args) {
            let output = "<div class='text-yellow-400'>Starting enumeration...</div>";
            
            if (args.includes('dns')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: example.com</div>
                        <div>Performing DNS enumeration...</div>
                        <div class='text-green-400'>βœ“ A record: 93.184.216.34</div>
                        <div class='text-green-400'>βœ“ MX records: mail.example.com</div>
                        <div class='text-green-400'>βœ“ TXT records: "v=spf1 include:_spf.example.com ~all"</div>
                        <div>DNS enumeration complete</div>
                    </div>
                `;
            } else if (args.includes('smtp')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: mail.example.com:25</div>
                        <div>Enumerating SMTP users...</div>
                        <div class='text-green-400'>βœ“ Valid user: admin@example.com</div>
                        <div class='text-green-400'>βœ“ Valid user: support@example.com</div>
                        <div class='text-red-400'>βœ— Invalid user: root@example.com</div>
                        <div>Found 2 valid email addresses</div>
                    </div>
                `;
            } else if (args.includes('snmp')) {
                output += `
                    <div class='ml-4'>
                        <div>Target: 192.168.1.120</div>
                        <div>Community string: public</div>
                        <div>Walking SNMP tree...</div>
                        <div class='text-green-400'>βœ“ System: Cisco Router</div>
                        <div class='text-green-400'>βœ“ Uptime: 14 days, 6 hours</div>
                        <div class='text-green-400'>βœ“ Interfaces: 4</div>
                        <div>SNMP enumeration complete</div>
                    </div>
                `;
            } else {
                output = "<div class='text-red-400'>Invalid service. Use 'enum dns', 'enum smtp', etc.</div>";
            }
            
            addOutputToTerminal(output);
        }
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ash-coded-it/hacktool" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>