Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Keylogger with Network Access</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --primary-color: #4a6fa5; | |
| --secondary-color: #166088; | |
| --accent-color: #4fc3f7; | |
| --dark-color: #1a1a2e; | |
| --light-color: #f8f9fa; | |
| --danger-color: #e63946; | |
| --success-color: #2a9d8f; | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| body { | |
| background-color: #f0f2f5; | |
| color: var(--dark-color); | |
| line-height: 1.6; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 20px; | |
| } | |
| header { | |
| background-color: var(--primary-color); | |
| color: white; | |
| padding: 15px 0; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); | |
| position: relative; | |
| } | |
| .header-content { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| } | |
| .logo a { | |
| color: white; | |
| text-decoration: none; | |
| } | |
| .built-with { | |
| font-size: 0.8rem; | |
| color: rgba(255, 255, 255, 0.8); | |
| } | |
| .built-with a { | |
| color: white; | |
| text-decoration: none; | |
| } | |
| .tabs { | |
| display: flex; | |
| margin-bottom: 20px; | |
| border-bottom: 1px solid #ddd; | |
| } | |
| .tab { | |
| padding: 10px 20px; | |
| cursor: pointer; | |
| background-color: #f1f1f1; | |
| border: 1px solid #ddd; | |
| border-bottom: none; | |
| margin-right: 5px; | |
| border-radius: 5px 5px 0 0; | |
| transition: all 0.3s; | |
| } | |
| .tab.active { | |
| background-color: white; | |
| border-bottom: 1px solid white; | |
| margin-bottom: -1px; | |
| font-weight: bold; | |
| color: var(--primary-color); | |
| } | |
| .tab-content { | |
| display: none; | |
| padding: 20px; | |
| background-color: white; | |
| border-radius: 0 0 5px 5px; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); | |
| } | |
| .tab-content.active { | |
| display: block; | |
| } | |
| .card { | |
| background-color: white; | |
| border-radius: 8px; | |
| box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); | |
| padding: 20px; | |
| margin-bottom: 20px; | |
| } | |
| h2 { | |
| color: var(--primary-color); | |
| margin-bottom: 15px; | |
| } | |
| .form-group { | |
| margin-bottom: 15px; | |
| } | |
| label { | |
| display: block; | |
| margin-bottom: 5px; | |
| font-weight: 500; | |
| } | |
| input, select, textarea { | |
| width: 100%; | |
| padding: 10px; | |
| border: 1px solid #ddd; | |
| border-radius: 4px; | |
| font-size: 16px; | |
| } | |
| button { | |
| background-color: var(--primary-color); | |
| color: white; | |
| border: none; | |
| padding: 10px 15px; | |
| border-radius: 4px; | |
| cursor: pointer; | |
| font-size: 16px; | |
| transition: background-color 0.3s; | |
| } | |
| button:hover { | |
| background-color: var(--secondary-color); | |
| } | |
| button.danger { | |
| background-color: var(--danger-color); | |
| } | |
| button.danger:hover { | |
| background-color: #c1121f; | |
| } | |
| button.success { | |
| background-color: var(--success-color); | |
| } | |
| button.success:hover { | |
| background-color: #1d7874; | |
| } | |
| .status { | |
| padding: 10px; | |
| border-radius: 4px; | |
| margin-top: 10px; | |
| display: none; | |
| } | |
| .status.success { | |
| background-color: rgba(42, 157, 143, 0.2); | |
| color: var(--success-color); | |
| display: block; | |
| } | |
| .status.error { | |
| background-color: rgba(230, 57, 70, 0.2); | |
| color: var(--danger-color); | |
| display: block; | |
| } | |
| .status.warning { | |
| background-color: rgba(233, 196, 106, 0.2); | |
| color: #d4a017; | |
| display: block; | |
| } | |
| .logs-container { | |
| max-height: 400px; | |
| overflow-y: auto; | |
| border: 1px solid #ddd; | |
| padding: 10px; | |
| border-radius: 4px; | |
| background-color: #f9f9f9; | |
| font-family: 'Courier New', Courier, monospace; | |
| white-space: pre-wrap; | |
| } | |
| .server-info { | |
| background-color: #e9f5ff; | |
| padding: 15px; | |
| border-radius: 4px; | |
| margin-bottom: 20px; | |
| } | |
| .server-info p { | |
| margin-bottom: 5px; | |
| } | |
| .server-info strong { | |
| color: var(--secondary-color); | |
| } | |
| .flex-row { | |
| display: flex; | |
| gap: 15px; | |
| } | |
| .flex-row > * { | |
| flex: 1; | |
| } | |
| @media (max-width: 768px) { | |
| .flex-row { | |
| flex-direction: column; | |
| } | |
| } | |
| .keyboard-icon { | |
| font-size: 2rem; | |
| color: var(--primary-color); | |
| margin-bottom: 10px; | |
| } | |
| .instructions { | |
| background-color: #f8f9fa; | |
| padding: 15px; | |
| border-left: 4px solid var(--accent-color); | |
| margin-bottom: 20px; | |
| } | |
| .instructions h3 { | |
| margin-bottom: 10px; | |
| color: var(--secondary-color); | |
| } | |
| .instructions ol { | |
| padding-left: 20px; | |
| } | |
| .instructions li { | |
| margin-bottom: 8px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <div class="container header-content"> | |
| <div class="logo"> | |
| <a href="#">Keylogger with Network Access</a> | |
| </div> | |
| <div class="built-with"> | |
| Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a> | |
| </div> | |
| </div> | |
| </header> | |
| <div class="container"> | |
| <div class="tabs"> | |
| <div class="tab active" data-tab="keylogger">Keylogger</div> | |
| <div class="tab" data-tab="server">Network Access</div> | |
| <div class="tab" data-tab="logs">View Logs</div> | |
| </div> | |
| <div id="keylogger" class="tab-content active"> | |
| <div class="card"> | |
| <div class="keyboard-icon"> | |
| <i class="fas fa-keyboard"></i> | |
| </div> | |
| <h2>Keylogger Configuration</h2> | |
| <div class="instructions"> | |
| <h3>How to use:</h3> | |
| <ol> | |
| <li>Configure the keylogger settings below</li> | |
| <li>Click "Start Keylogger" to begin recording keystrokes</li> | |
| <li>Keystrokes will be saved to a text file on your computer</li> | |
| <li>Use the "Network Access" tab to access logs from other computers</li> | |
| </ol> | |
| </div> | |
| <div class="form-group"> | |
| <label for="logFilePath">Log File Path:</label> | |
| <input type="text" id="logFilePath" value="C:\\keylogs\\keystrokes.txt" placeholder="Enter path to save log file"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="logInterval">Save Interval (seconds):</label> | |
| <input type="number" id="logInterval" value="10" min="1" max="3600"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="captureWindowTitles">Capture Window Titles:</label> | |
| <select id="captureWindowTitles"> | |
| <option value="true">Yes</option> | |
| <option value="false">No</option> | |
| </select> | |
| </div> | |
| <div class="flex-row"> | |
| <button id="startKeylogger" class="success"> | |
| <i class="fas fa-play"></i> Start Keylogger | |
| </button> | |
| <button id="stopKeylogger" class="danger"> | |
| <i class="fas fa-stop"></i> Stop Keylogger | |
| </button> | |
| </div> | |
| <div id="keyloggerStatus" class="status"></div> | |
| </div> | |
| </div> | |
| <div id="server" class="tab-content"> | |
| <div class="card"> | |
| <h2>Network Access Configuration</h2> | |
| <div class="instructions"> | |
| <h3>How to access logs from another computer:</h3> | |
| <ol> | |
| <li>Start the local server using the button below</li> | |
| <li>Note the IP address and port displayed</li> | |
| <li>From another computer on the same network, open a web browser</li> | |
| <li>Navigate to http://[your-ip]:[port]/logs</li> | |
| <li>You'll see the recorded keystrokes</li> | |
| </ol> | |
| </div> | |
| <div class="server-info"> | |
| <p><strong>Your local IP address:</strong> <span id="localIp">Detecting...</span></p> | |
| <p><strong>Server status:</strong> <span id="serverStatus">Not running</span></p> | |
| <p><strong>Access URL:</strong> <span id="accessUrl">http://[ip]:8080/logs</span></p> | |
| </div> | |
| <div class="form-group"> | |
| <label for="serverPort">Server Port:</label> | |
| <input type="number" id="serverPort" value="8080" min="1024" max="65535"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="serverPassword">Access Password (optional):</label> | |
| <input type="password" id="serverPassword" placeholder="Leave empty for no password"> | |
| </div> | |
| <div class="flex-row"> | |
| <button id="startServer" class="success"> | |
| <i class="fas fa-server"></i> Start Server | |
| </button> | |
| <button id="stopServer" class="danger"> | |
| <i class="fas fa-power-off"></i> Stop Server | |
| </button> | |
| </div> | |
| <div id="serverStatusMessage" class="status"></div> | |
| </div> | |
| </div> | |
| <div id="logs" class="tab-content"> | |
| <div class="card"> | |
| <h2>Keystroke Logs</h2> | |
| <div class="form-group"> | |
| <label for="logFileToView">Select Log File:</label> | |
| <input type="text" id="logFileToView" value="C:\\keylogs\\keystrokes.txt" placeholder="Enter path to log file"> | |
| </div> | |
| <button id="loadLogs" class="success"> | |
| <i class="fas fa-sync-alt"></i> Load Logs | |
| </button> | |
| <div id="logsStatus" class="status"></div> | |
| <div class="logs-container" id="logContent"> | |
| Logs will appear here... | |
| </div> | |
| <div style="margin-top: 15px;"> | |
| <button id="clearLogs" class="danger"> | |
| <i class="fas fa-trash-alt"></i> Clear Log File | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Tab switching functionality | |
| document.querySelectorAll('.tab').forEach(tab => { | |
| tab.addEventListener('click', () => { | |
| // Remove active class from all tabs and content | |
| document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); | |
| document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active')); | |
| // Add active class to clicked tab and corresponding content | |
| tab.classList.add('active'); | |
| const tabId = tab.getAttribute('data-tab'); | |
| document.getElementById(tabId).classList.add('active'); | |
| }); | |
| }); | |
| // Simulate keylogger functionality (note: actual keylogging would require additional software) | |
| let isKeyloggerRunning = false; | |
| let isServerRunning = false; | |
| // Detect local IP (simulated) | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // This is a simulation - in a real app you would detect the actual IP | |
| const ips = ['192.168.1.100', '192.168.0.15', '10.0.0.5']; | |
| const randomIp = ips[Math.floor(Math.random() * ips.length)]; | |
| document.getElementById('localIp').textContent = randomIp; | |
| updateAccessUrl(randomIp, document.getElementById('serverPort').value); | |
| }); | |
| // Update access URL when port changes | |
| document.getElementById('serverPort').addEventListener('change', function() { | |
| const ip = document.getElementById('localIp').textContent; | |
| updateAccessUrl(ip, this.value); | |
| }); | |
| function updateAccessUrl(ip, port) { | |
| document.getElementById('accessUrl').textContent = `http://${ip}:${port}/logs`; | |
| } | |
| // Keylogger controls | |
| document.getElementById('startKeylogger').addEventListener('click', function() { | |
| const logFilePath = document.getElementById('logFilePath').value; | |
| const logInterval = document.getElementById('logInterval').value; | |
| const captureWindowTitles = document.getElementById('captureWindowTitles').value === 'true'; | |
| if (!logFilePath) { | |
| showStatus('keyloggerStatus', 'Please enter a valid log file path', 'error'); | |
| return; | |
| } | |
| // In a real application, this would start an actual keylogger | |
| isKeyloggerRunning = true; | |
| showStatus('keyloggerStatus', `Keylogger started. Keystrokes will be saved to: ${logFilePath}`, 'success'); | |
| // Simulate logging | |
| if (isKeyloggerRunning) { | |
| setTimeout(() => { | |
| if (isKeyloggerRunning) { | |
| showStatus('keyloggerStatus', `Keylogger is running. Last saved at ${new Date().toLocaleTimeString()}`, 'success'); | |
| } | |
| }, logInterval * 1000); | |
| } | |
| }); | |
| document.getElementById('stopKeylogger').addEventListener('click', function() { | |
| isKeyloggerRunning = false; | |
| showStatus('keyloggerStatus', 'Keylogger stopped', 'warning'); | |
| }); | |
| // Server controls | |
| document.getElementById('startServer').addEventListener('click', function() { | |
| const port = document.getElementById('serverPort').value; | |
| const password = document.getElementById('serverPassword').value; | |
| if (!port || port < 1024 || port > 65535) { | |
| showStatus('serverStatusMessage', 'Please enter a valid port between 1024 and 65535', 'error'); | |
| return; | |
| } | |
| // In a real application, this would start an actual HTTP server | |
| isServerRunning = true; | |
| document.getElementById('serverStatus').textContent = 'Running'; | |
| showStatus('serverStatusMessage', `Server started on port ${port}. Logs accessible from other devices.`, 'success'); | |
| }); | |
| document.getElementById('stopServer').addEventListener('click', function() { | |
| isServerRunning = false; | |
| document.getElementById('serverStatus').textContent = 'Not running'; | |
| showStatus('serverStatusMessage', 'Server stopped', 'warning'); | |
| }); | |
| // Log viewing | |
| document.getElementById('loadLogs').addEventListener('click', function() { | |
| const logFile = document.getElementById('logFileToView').value; | |
| if (!logFile) { | |
| showStatus('logsStatus', 'Please enter a valid log file path', 'error'); | |
| return; | |
| } | |
| // In a real application, this would read the actual log file | |
| const sampleLogs = `[${new Date().toLocaleString()}] Keylogger started | |
| [${new Date().toLocaleString()}] Window: Chrome - Google | |
| [${new Date().toLocaleString()}] Typed: hello world | |
| [${new Date().toLocaleString()}] Window: Notepad | |
| [${new Date().toLocaleString()}] Typed: this is a test | |
| [${new Date().toLocaleString()}] Special key: [ENTER] | |
| [${new Date().toLocaleString()}] Window: File Explorer | |
| [${new Date().toLocaleString()}] Special key: [CTRL+C]`; | |
| document.getElementById('logContent').textContent = sampleLogs; | |
| showStatus('logsStatus', `Logs loaded from ${logFile}`, 'success'); | |
| }); | |
| document.getElementById('clearLogs').addEventListener('click', function() { | |
| if (confirm('Are you sure you want to clear the log file? This cannot be undone.')) { | |
| document.getElementById('logContent').textContent = ''; | |
| showStatus('logsStatus', 'Log file cleared', 'warning'); | |
| } | |
| }); | |
| // Helper function to show status messages | |
| function showStatus(elementId, message, type) { | |
| const element = document.getElementById(elementId); | |
| element.textContent = message; | |
| element.className = 'status ' + type; | |
| // Auto-hide after 5 seconds | |
| setTimeout(() => { | |
| element.textContent = ''; | |
| element.className = 'status'; | |
| }, 5000); | |
| } | |
| // Simulate key presses (for demo purposes) | |
| document.addEventListener('keydown', function(e) { | |
| if (isKeyloggerRunning) { | |
| // In a real application, this would log the actual keystrokes | |
| console.log(`Key pressed: ${e.key}`); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |