a color: #8f9eff; text-decoration: none;
.info-panel background: #0f121c; border-radius: 28px; padding: 18px 22px; margin-bottom: 30px; border: 1px solid #2c3145; box-shadow: inset 0 1px 2px #00000020, 0 6px 12px -8px black;
// Helper: update UI for blocked list (quarantine) function renderBlockedList() if (!blockedListEl) return; if (blockedItems.length === 0) blockedListEl.innerHTML = '<li class="empty-msg">✨ No blocked attempts. Run blocker is watching.</li>'; return; // show latest first (reverse) const reversed = [...blockedItems].reverse(); blockedListEl.innerHTML = reversed.map((item, idx) => const displayUrl = item.url.length > 65 ? item.url.substring(0, 62) + '...' : item.url; const timeStr = item.timestamp ? new Date(item.timestamp).toLocaleTimeString() : 'just now'; return ` <li> <span class="file-url" title="$escapeHtml(item.url)">🚫 $escapeHtml(displayUrl)</span> <span style="font-size:0.7rem; background:#1e1f2e; padding:2px 8px; border-radius:40px;">$timeStr</span> <button class="remove-btn" data-url="$escapeHtml(item.url)" data-removeidx="$blockedItems.length - 1 - idx">✖</button> </li> `; ).join('');
blockDemoBtn.addEventListener('click', () => simulateBlockedRun(); ); simple run blocker download
.header background: #0b0e14; padding: 24px 28px 18px 28px; border-bottom: 1px solid #2d3345;
.section-title font-size: 0.85rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; color: #7f8bb3; padding: 12px 16px 4px; display: flex; justify-content: space-between;
.btn-primary:hover background: #5a6eff; transform: scale(0.97); box-shadow: 0 6px 14px #3c4bff60; a color: #8f9eff; text-decoration: none;
// Add to whitelist + auto download trigger function addToWhitelistAndDownload(rawUrl) let targetUrl = rawUrl.trim(); if (targetUrl === "") updateStatusMessage("⛔ Cannot add empty URL to whitelist", "#ffaa88"); return; // optional normalization: ensure protocol if missing (for demo convenience) if (!targetUrl.match(/^https?:\/\//i) && !targetUrl.startsWith('blob:') && !targetUrl.startsWith('data:')) // prepend https:// as a best guess for demo if (targetUrl.includes('.') && !targetUrl.includes(' ')) targetUrl = 'https://' + targetUrl; updateStatusMessage(`🔧 Auto-prepended https://`, "#c3e8ff"); // Add to whitelist set whitelist.add(targetUrl); updateStatusMessage(`📌 Whitelisted: $shorten(targetUrl, 55)`, "#b5ffb5"); // Now attempt download (whitelisted will pass) attemptDownload(targetUrl, 'whitelist+download'); renderBlockedList(); // re-render in case whitelist status matters but list unchanged // also update a quick visual flash on the blocked area? // Additionally show whitelist count in status but not required if (whitelist.size > 0) // optional: update info line const infoPanel = document.querySelector('.info-panel p:first-child'); if (infoPanel && !infoPanel.querySelector('.whitelist-count')) // nice extra, but no worries.
.btn-warning:hover background: #c5822a;
function addBlockedEntry(url, reason) blockedItems.unshift( // add to beginning for latest on top after render (but render reverses again? we render reversed, but unshift + reversed gives newer first) url: url, timestamp: new Date(), reason: reason ); // limit list to 30 items to avoid clutter if (blockedItems.length > 35) blockedItems.pop(); new Date(item
.sub color: #8f98b3; margin-top: 8px; font-size: 0.9rem; font-weight: 400;
// optional: allow pressing Enter in input to trigger allow+download urlInput.addEventListener('keypress', (e) => if (e.key === 'Enter') e.preventDefault(); if (urlInput.value.trim()) addToWhitelistAndDownload(urlInput.value); urlInput.value = ''; else updateStatusMessage("Enter a URL first", "#ffaa88"); );
/* queue / blocked list */ .queue-section background: #0c0f18; border-radius: 24px; padding: 6px 4px 12px 4px; margin-top: 20px;
// Simulate a "malicious run attempt" -> gets blocked function simulateBlockedRun() const fakeRuns = [ "powershell.exe -EncodedCommand ... (blocked)", "C:\\Users\\temp\\malware.exe", "https://evil-server/runme.bat", "file:///C:/Windows/Tasks/backdoor.vbs", "https://fakecdn.com/setup.exe?click=1" ]; const randomFake = fakeRuns[Math.floor(Math.random() * fakeRuns.length)]; addBlockedEntry(randomFake, 'Simulated run attempt (auto-blocked by Run Blocker)'); renderBlockedList(); updateStatusMessage(`⚠️ SIMULATED run blocked: $shorten(randomFake, 60)`, '#ffaa77'); triggerSimulatedBlockAlert(randomFake);