facebook / content_fb.js
fritreefw's picture
Upload 22 files
3210117 verified
Raw History Blame Contribute Delete
64.6 kB
// ============================================================================ // File: content_fb.js // ============================================================================ (async function() { 'use strict'; if (window.__FritreeFacebookShieldInitialized) { console.warn("[Fritree Shield] Stealth protection and behavior simulation node is already active in this tab."); return; } window.__FritreeFacebookShieldInitialized = true; let panelShadowRootRef = null; let virtualCursorElement = null; let driftTimer = null; const SHIELD_INTEGRITY_SALT = "FritreeFacebookStealthShieldSymmetricSignatureSalt_SHA256_2026_EnterpriseSecureForce"; // Enhanced Stealth Guard configuration matrix (Facebook Node) const ShieldConfig = { sessionProfile: "casual", typingProfile: "average", typingSpeedMultiplier: 1.0, humanScrollActive: true, simulateMouseActive: true, antiHoneypotActive: true, humanTypingActive: true, randomMicroActive: true, autoPauseFailActive: true, scrollStepPixels: 250, scrollTotalCycles: 4, mouseMovementCycles: 5, mouseJitterSpeed: 8, coordinateJitterRadius: 10, showVirtualCursor: true, canvasNoiseActive: true, audioContextNoiseActive: true, webRtcLeakProtectionActive: true, hardwareConcurrencyMockActive: true, deviceMemoryMockActive: true, batteryApiMockActive: true, languagesSpoofActive: true, screenOrientationSpoofActive: true, pluginsMockActive: true, idleWanderActive: true, safeHoursSchedulerActive: true, dailyCapActive: false, dailyCapLimit: 100, typoRatio: 0.04, activeFreezeState: false, viewportJitterActive: true, idleCursorDriftActive: true, audioFingerprintNoiseActive: true, // Facebook-Specific Advanced Controls fbAntiHoneypotStrict: true, fbFocusShufflingActive: true, fbFocusShuffleMinSec: 15, fbFocusShuffleMaxSec: 45, fbHesitationBeforeType: true, fbHesitationMinMs: 800, fbHesitationMaxMs: 2500, fbSmoothScrollAcceleration: true, fbNetworkInfoSpoof: true }; /** * Compute secure symmetric SHA-256 signature to protect shield parameters */ async function calculateShieldSignature(config) { const serialized = JSON.stringify(config); const concatString = `${serialized}:${SHIELD_INTEGRITY_SALT}`; if (typeof FritreeCrypto !== 'undefined' && typeof FritreeCrypto.signReceipt === 'function') { return await FritreeCrypto.signReceipt( "FB_STEALTH_SHIELD_V3", concatString.length, "config_signature_256", concatString, SHIELD_INTEGRITY_SALT ); } let hash = 0; for (let i = 0; i < concatString.length; i++) { const char = concatString.charCodeAt(i); hash = ((hash << 5) - hash) + char; hash |= 0; } return "fallback_shield_sig_256_" + Math.abs(hash).toString(16); } /** * Save shield parameters securely with SHA-256 cryptographic signatures */ async function saveConfigSecurely() { const configToSave = {}; Object.keys(ShieldConfig).forEach(key => { if (typeof ShieldConfig[key] !== 'function' && typeof ShieldConfig[key] !== 'object') { configToSave[key] = ShieldConfig[key]; } }); const signature = await calculateShieldSignature(configToSave); if (typeof FritreeCrypto !== 'undefined' && typeof FritreeCrypto.setStorage === 'function') { await FritreeCrypto.setStorage('local_shield_config_matrix', configToSave); await FritreeCrypto.setStorage('local_shield_config_matrix_sig_256', signature); TelemetryLogger.log("🔐 Encryption Guard", "Shield parameters encrypted and signed with SHA-256.", "success"); } } /** * Load shield parameters securely and verify signature integrity */ async function loadConfigSecurely() { if (typeof FritreeCrypto !== 'undefined' && typeof FritreeCrypto.getStorage === 'function') { const loaded = await FritreeCrypto.getStorage('local_shield_config_matrix', null); const savedSig = await FritreeCrypto.getStorage('local_shield_config_matrix_sig_256', null); if (loaded) { if (savedSig) { const computedSig = await calculateShieldSignature(loaded); if (savedSig !== computedSig) { console.log("[Fritree Shield] Re-aligned configuration signature."); await saveConfigSecurely(); return; } } Object.keys(loaded).forEach(key => { if (ShieldConfig[key] !== undefined) { ShieldConfig[key] = loaded[key]; } }); } } } // Storage updates synchronized across contexts if (typeof chrome !== 'undefined' && chrome.storage && chrome.storage.onChanged) { chrome.storage.onChanged.addListener(async (changes, namespace) => { if (namespace === 'local') { const targetHash = await FritreeCrypto.sha256("local_shield_config_matrix" + "FritreeKeySalt_2026_StrictSHA256_Hashed_Production_WebCrypto_Salt"); if (changes[targetHash]) { await loadConfigSecurely(); TelemetryLogger.log("Live Mappings Sync", "New shield configurations decrypted and applied.", "success"); if (panelShadowRootRef) { FacebookWebLayoutOverride.setInitialSwitchesState(panelShadowRootRef); } } } }); } // Telemetry logger component class TelemetryLogger { static log(layer, action, status) { const timestamp = new Date().toLocaleTimeString('en-US'); console.log(`[${timestamp}] [Fritree FB Shield] [${layer}] [${action}] (${status})`); if (panelShadowRootRef) { const logsList = panelShadowRootRef.getElementById('fb-panel-logs-list'); if (logsList) { if (logsList.textContent.includes('Waiting for campaign trigger')) { logsList.innerHTML = ''; } const line = document.createElement('div'); line.style.cssText = 'border-bottom: 1px dashed #cbd5e1; padding: 6px 0; line-height: 1.4; color: #1e293b; font-size:11px; text-align: left; direction: ltr;'; let levelColor = '#1e293b'; if (status === 'error') levelColor = '#ef4444'; else if (status === 'warn') levelColor = '#f59e0b'; else if (status === 'success') levelColor = '#10b981'; const timeSpan = document.createElement('span'); timeSpan.style.color = '#64748b'; timeSpan.textContent = `[${timestamp}] `; const layerSpan = document.createElement('span'); layerSpan.style.color = levelColor; layerSpan.style.fontWeight = 'bold'; layerSpan.textContent = `[${layer}] `; const actionText = document.createTextNode(action); line.appendChild(timeSpan); line.appendChild(layerSpan); line.appendChild(actionText); logsList.appendChild(line); logsList.scrollTop = logsList.scrollHeight; } } } } // Dynamic Hardware, Network, and Profile Spoofing class DigitalFingerprintMask { static apply() { if (ShieldConfig.hardwareConcurrencyMockActive) { try { Object.defineProperty(navigator, 'hardwareConcurrency', { get: () => 8, configurable: true }); Object.defineProperty(navigator, 'deviceMemory', { get: () => 8, configurable: true }); } catch(e) {} } if (ShieldConfig.canvasNoiseActive) { this.injectCanvasFingerprintSpoofer(); } if (ShieldConfig.audioFingerprintNoiseActive) { this.injectAudioFingerprintSpoofer(); } if (ShieldConfig.languagesSpoofActive) { try { Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'ar'], configurable: true }); } catch(e) {} } if (ShieldConfig.fbNetworkInfoSpoof) { this.spoofNetworkInfo(); } if (ShieldConfig.batteryApiMockActive) { this.spoofBatteryInfo(); } } static injectCanvasFingerprintSpoofer() { try { const script = document.createElement('script'); script.textContent = ` const originalToDataURL = HTMLCanvasElement.prototype.toDataURL; const originalGetImageData = CanvasRenderingContext2D.prototype.getImageData; HTMLCanvasElement.prototype.toDataURL = function(...args) { const ctx = this.getContext('2d'); if (ctx) { try { const imgData = originalGetImageData.call(ctx, 0, 0, 1, 1); if (imgData) { imgData.data[0] = (imgData.data[0] + 1) % 256; ctx.putImageData(imgData, 0, 0); } } catch(e) {} } return originalToDataURL.apply(this, args); }; `; (document.head || document.documentElement).appendChild(script); script.remove(); } catch (e) { console.error("[Fritree Shield] Canvas spoofer error:", e); } } static injectAudioFingerprintSpoofer() { try { const script = document.createElement('script'); script.textContent = ` (() => { const originalGetChannelData = AudioBuffer.prototype.getChannelData; AudioBuffer.prototype.getChannelData = function(...args) { const data = originalGetChannelData.apply(this, args); if (data && data.length > 0) { data[0] += (Math.random() - 0.5) * 1e-7; } return data; }; })(); `; (document.head || document.documentElement).appendChild(script); script.remove(); } catch (e) { console.error("[Fritree Shield] Audio spoofer error:", e); } } static spoofNetworkInfo() { try { const mockConnection = { downlink: 10, effectiveType: "4g", rtt: 50, saveData: false, addEventListener: () => {}, removeEventListener: () => {} }; Object.defineProperty(navigator, 'connection', { get: () => mockConnection, configurable: true }); TelemetryLogger.log("Fingerprint Mask", "Network Information API spoofed (4G Latency).", "info"); } catch (e) {} } static spoofBatteryInfo() { try { const mockBattery = { charging: true, chargingTime: 0, dischargingTime: Infinity, level: 0.95, addEventListener: () => {}, removeEventListener: () => {} }; navigator.getBattery = () => Promise.resolve(mockBattery); TelemetryLogger.log("Fingerprint Mask", "Battery Status API obfuscated.", "info"); } catch (e) {} } } // Human Interaction and Movement Simulation class BehavioralSimulationEngine { static drawVirtualCursor() { if (virtualCursorElement || !ShieldConfig.showVirtualCursor) return; virtualCursorElement = document.createElement('div'); virtualCursorElement.id = 'fritree-virtual-cursor'; virtualCursorElement.style.cssText = ` position: fixed; width: 18px; height: 18px; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="red" stroke="white" stroke-width="2"><path d="M5.5 2v15.5l4.8-4.8 3.5 8.1 3-1.3-3.5-8.1 6.1-.2z"/></svg>') no-repeat; pointer-events: none; z-index: 1000000; transition: none; transform: translate(100px, 100px); `; document.body.appendChild(virtualCursorElement); } static removeVirtualCursor() { if (virtualCursorElement) { virtualCursorElement.remove(); virtualCursorElement = null; } } static async runAdvancedScrollSimulation() { if (!ShieldConfig.humanScrollActive) return; TelemetryLogger.log("📜 Reading Simulation", "Initiating human scrolling sweeps.", "info"); const step = ShieldConfig.scrollStepPixels || 250; const cycles = ShieldConfig.scrollTotalCycles || 4; for (let i = 0; i < cycles; i++) { let jitterStep = step + (Math.random() * 50 - 25); const targetY = window.scrollY + jitterStep; if (ShieldConfig.fbSmoothScrollAcceleration) { await this.runPhysicsBasedScroll(targetY, 1500); } else { window.scrollBy({ top: jitterStep, behavior: 'smooth' }); await new Promise(r => setTimeout(r, 1200)); } const correctionTargetY = window.scrollY - (jitterStep * 0.25); if (ShieldConfig.fbSmoothScrollAcceleration) { await this.runPhysicsBasedScroll(correctionTargetY, 900); } else { window.scrollBy({ top: -jitterStep * 0.25, behavior: 'smooth' }); await new Promise(r => setTimeout(r, 900)); } } TelemetryLogger.log("📜 Reading Simulation", "Human reading simulation completed.", "success"); } static runPhysicsBasedScroll(targetY, durationMs) { const startTime = performance.now(); const startY = window.scrollY; const difference = targetY - startY; return new Promise(resolve => { const step = (currentTime) => { const elapsed = currentTime - startTime; const progress = Math.min(elapsed / durationMs, 1); // Ease out cubic emulating human deceleration const ease = 1 - Math.pow(1 - progress, 3); window.scrollTo(0, startY + (difference * ease)); if (progress < 1) { requestAnimationFrame(step); } else { resolve(); } }; requestAnimationFrame(step); }); } static async runBezierMouseMovements() { if (!ShieldConfig.simulateMouseActive) return; this.drawVirtualCursor(); const cycles = ShieldConfig.mouseMovementCycles; TelemetryLogger.log("🖱️ Mouse Simulation", `Simulating mouse sweeps across Bezier curve paths. Cycles: [${cycles}].`, "info"); for (let i = 0; i < cycles; i++) { const startPoint = { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }; const endPoint = { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }; const ctrl1 = { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }; const ctrl2 = { x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight }; await this.animateBezierCurve(startPoint, ctrl1, ctrl2, endPoint); await new Promise(r => setTimeout(r, 700)); } if (ShieldConfig.idleCursorDriftActive) { this.startIdleCursorDrift(); } else if (!ShieldConfig.showVirtualCursor) { this.removeVirtualCursor(); } TelemetryLogger.log("🖱️ Mouse Simulation", "Bezier curve mouse sweeps completed.", "success"); } static animateBezierCurve(p0, p1, p2, p3) { return new Promise((resolve) => { const steps = 30; let currentStep = 0; const intervalDelay = ShieldConfig.mouseJitterSpeed || 8; const interval = setInterval(() => { if (currentStep > steps) { clearInterval(interval); resolve(); return; } const t = currentStep / steps; const temp = 1 - t; const x = temp * temp * temp * p0.x + 3 * temp * temp * t * p1.x + 3 * temp * t * t * p2.x + t * t * t * p3.x; const y = temp * temp * temp * p0.y + 3 * temp * temp * t * p1.y + 3 * temp * t * t * p2.y + t * t * t * p3.y; if (virtualCursorElement) { virtualCursorElement.style.transform = `translate(${x}px, ${y}px)`; } const mouseEvent = new MouseEvent('mousemove', { clientX: x, clientY: y, bubbles: true }); document.dispatchEvent(mouseEvent); currentStep++; }, intervalDelay); }); } static startIdleCursorDrift() { if (driftTimer) clearInterval(driftTimer); if (!ShieldConfig.idleCursorDriftActive || !virtualCursorElement) return; let angle = Math.random() * Math.PI * 2; let currentX = parseFloat(virtualCursorElement.style.transform.match(/translate\((.*)px,.*\)/)?.[1] || 300); let currentY = parseFloat(virtualCursorElement.style.transform.match(/translate\(.*px,\s*(.*)px\)/)?.[1] || 300); driftTimer = setInterval(() => { if (!ShieldConfig.idleCursorDriftActive) { clearInterval(driftTimer); return; } angle += (Math.random() - 0.5) * 0.5; const distance = 0.5 + Math.random() * 1.5; currentX += Math.cos(angle) * distance; currentY += Math.sin(angle) * distance; currentX = Math.max(10, Math.min(window.innerWidth - 10, currentX)); currentY = Math.max(10, Math.min(window.innerHeight - 10, currentY)); virtualCursorElement.style.transform = `translate(${currentX}px, ${currentY}px)`; }, 120); } static stopIdleCursorDrift() { if (driftTimer) { clearInterval(driftTimer); driftTimer = null; } } static applyViewportJitter() { if (!ShieldConfig.viewportJitterActive) return; const originalWidth = document.body.style.width; const offset = Math.floor(Math.random() * 3) + 1; document.body.style.width = `calc(100% - ${offset}px)`; setTimeout(() => { document.body.style.width = originalWidth || '100%'; }, 150); } static startFocusShuffling() { if (!ShieldConfig.fbFocusShufflingActive) return; const scheduleNext = () => { const delay = (Math.random() * (ShieldConfig.fbFocusShuffleMaxSec - ShieldConfig.fbFocusShuffleMinSec) + ShieldConfig.fbFocusShuffleMinSec) * 1000; setTimeout(() => { if (!ShieldConfig.fbFocusShufflingActive) return; TelemetryLogger.log("Stealth Focus", "Simulating tab focus background transition.", "info"); window.dispatchEvent(new Event('blur')); document.dispatchEvent(new Event('visibilitychange')); setTimeout(() => { window.dispatchEvent(new Event('focus')); document.dispatchEvent(new Event('visibilitychange')); scheduleNext(); }, Math.random() * 3000 + 1000); }, delay); }; scheduleNext(); } static async hesitateBeforeInteracting(element) { if (!ShieldConfig.fbHesitationBeforeType) return; const delay = Math.random() * (ShieldConfig.fbHesitationMaxMs - ShieldConfig.fbHesitationMinMs) + ShieldConfig.fbHesitationMinMs; TelemetryLogger.log("Stealth Focus", `hesitation phase active. Holding interaction for ${Math.round(delay)}ms...`, "info"); if (element) { element.dispatchEvent(new MouseEvent('mouseenter', { bubbles: true })); element.dispatchEvent(new MouseEvent('mouseover', { bubbles: true })); } await new Promise(r => setTimeout(r, delay)); } static isHoneypot(element) { if (!ShieldConfig.fbAntiHoneypotStrict) return false; if (!element) return false; const style = window.getComputedStyle(element); if (style.display === 'none' || style.visibility === 'hidden' || parseFloat(style.opacity) === 0) { return true; } if (element.getAttribute('aria-hidden') === 'true' || element.hasAttribute('hidden')) { return true; } const rect = element.getBoundingClientRect(); if (rect.width === 0 || rect.height === 0) { return true; } const left = parseFloat(style.left) || 0; const top = parseFloat(style.top) || 0; if (left < -5000 || top < -5000) { return true; } return false; } } // Real-Time Campaign Dispatch User-Interface Overlay class CampaignOverlayManager { static init() { this.overlayHost = null; this.shadowRoot = null; this.bindMessageListener(); } static bindMessageListener() { if (typeof chrome !== 'undefined' && chrome.runtime && chrome.runtime.onMessage) { chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { if (request.action === 'show_campaign_overlay') { this.show(request.text, request.photos, request.groupId); sendResponse({ success: true }); } else if (request.action === 'update_campaign_overlay_status') { this.updateStatus(request.status, request.step); sendResponse({ success: true }); } else if (request.action === 'close_campaign_overlay') { this.close(); sendResponse({ success: true }); } }); } } static show(text, photos, groupId) { this.close(); this.overlayHost = document.createElement('div'); this.overlayHost.id = 'fritree-campaign-overlay-host'; this.overlayHost.style.cssText = 'position: fixed; top: 70px; right: 20px; width: 380px; z-index: 10000000; pointer-events: none;'; document.body.appendChild(this.overlayHost); this.shadowRoot = this.overlayHost.attachShadow({ mode: 'open' }); const container = document.createElement('div'); container.id = 'campaign-overlay-container'; container.style.cssText = ` width: 100%; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; flex-direction: column; font-family: system-ui, -apple-system, sans-serif; overflow: hidden; pointer-events: auto; direction: ltr; text-align: left; `; const header = document.createElement('div'); header.style.cssText = 'background: #1877f2; color: #ffffff; padding: 12px 16px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; font-size: 13px;'; header.innerHTML = ` <div style="display: flex; align-items: center; gap: 6px;"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"> <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/> </svg> <span>Active Campaign Dispatch Viewer</span> </div> <button id="btn-close-overlay" style="background: none; border: none; color: #ffffff; font-size: 18px; cursor: pointer; font-weight: bold; padding: 0 4px;">&times;</button> `; const body = document.createElement('div'); body.style.cssText = 'padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 12px; color: #1e293b; max-height: 400px; overflow-y: auto;'; const targetInfo = document.createElement('div'); targetInfo.style.cssText = 'background: #f1f5f9; border-radius: 8px; padding: 10px; border: 1px solid #e2e8f0;'; targetInfo.innerHTML = ` <div style="font-weight: bold; color: #64748b; margin-bottom: 2px; text-transform: uppercase; font-size: 9px; letter-spacing: 0.5px;">Target Destination Group</div> <div style="font-size: 13px; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">Group ID: ${groupId}</div> `; const textCopySec = document.createElement('div'); textCopySec.style.cssText = 'display: flex; flex-direction: column; gap: 4px;'; textCopySec.innerHTML = ` <div style="font-weight: bold; color: #64748b; text-transform: uppercase; font-size: 9px; letter-spacing: 0.5px;">Campaign Content Copy</div> <div style="background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; max-height: 120px; overflow-y: auto; white-space: pre-wrap; font-size: 12px; color: #334155; line-height: 1.5; font-family: monospace;">${text || '[No text copy]'}</div> `; const photosSec = document.createElement('div'); photosSec.style.cssText = 'display: flex; flex-direction: column; gap: 4px;'; if (photos && photos.length > 0) { photosSec.innerHTML = ` <div style="font-weight: bold; color: #64748b; text-transform: uppercase; font-size: 9px; letter-spacing: 0.5px;">Attached Media (${photos.length})</div> <div id="overlay-media-container" style="display: flex; gap: 6px; overflow-x: auto; padding: 4px 0;"></div> `; } const statusSec = document.createElement('div'); statusSec.style.cssText = 'background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px;'; statusSec.innerHTML = ` <div style="font-weight: bold; color: #1d4ed8; text-transform: uppercase; font-size: 9px; letter-spacing: 0.5px;">Dispatch Execution Status</div> <div id="overlay-status-text" style="font-size: 12px; font-weight: bold; color: #1e40af; display: flex; align-items: center; gap: 6px;"> <span style="display: inline-block; width: 8px; height: 8px; background: #3b82f6; border-radius: 50%;"></span> <span>Initializing behavior matrix templates...</span> </div> `; body.appendChild(targetInfo); body.appendChild(textCopySec); if (photos && photos.length > 0) { body.appendChild(photosSec); } body.appendChild(statusSec); container.appendChild(header); container.appendChild(body); this.shadowRoot.appendChild(container); if (photos && photos.length > 0) { const mediaContainer = this.shadowRoot.getElementById('overlay-media-container'); if (mediaContainer) { photos.forEach(pId => { const img = document.createElement('img'); img.src = 'icon.png'; img.style.cssText = 'width: 50px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid #cbd5e1;'; if (typeof FritreeStorage !== 'undefined') { FritreeStorage.get(`media_thumb_${pId}`).then(blob => { if (blob) { img.src = URL.createObjectURL(blob); } else { FritreeStorage.get(`media_blob_${pId}`).then(b => { if (b) img.src = URL.createObjectURL(b); }); } }); } mediaContainer.appendChild(img); }); } } const closeBtn = this.shadowRoot.getElementById('btn-close-overlay'); if (closeBtn) { closeBtn.addEventListener('click', () => this.close()); } } static updateStatus(status, step) { if (!this.shadowRoot) return; const statusText = this.shadowRoot.getElementById('overlay-status-text'); if (statusText) { let color = '#1e40af'; let indicatorColor = '#3b82f6'; if (status === 'success') { color = '#15803d'; indicatorColor = '#10b981'; } else if (status === 'failed') { color = '#b91c1c'; indicatorColor = '#ef4444'; } statusText.style.color = color; statusText.innerHTML = ` <span style="display: inline-block; width: 8px; height: 8px; background: ${indicatorColor}; border-radius: 50%;"></span> <span>${step}</span> `; } } static close() { if (this.overlayHost) { this.overlayHost.remove(); this.overlayHost = null; this.shadowRoot = null; } } } // Layout integration dashboard override class FacebookWebLayoutOverride { static init() { if (!window.location.host.includes('facebook.com')) return; TelemetryLogger.log("System Kernel", "Auditing active Facebook DOM structure.", "info"); loadConfigSecurely().then(() => { DigitalFingerprintMask.apply(); this.maintainButtonInjection(); this.bindCrossTabMessageListener(); if (ShieldConfig.fbFocusShufflingActive) { BehavioralSimulationEngine.startFocusShuffling(); } }); } static maintainButtonInjection() { this.tryInjectButton(); const observer = new MutationObserver(() => { const existingHost = document.getElementById('fritree-fb-shield-btn-host'); if (!existingHost) { this.tryInjectButton(); } }); observer.observe(document.body, { childList: true, subtree: true }); } static tryInjectButton() { const existing = document.getElementById('fritree-fb-shield-btn-host'); if (existing) return; const homeIconAnchor = document.querySelector('.x1iyjqo2.xmlsiyf.x1hxoosp.x1l38jg0.x1awlv9s.x1gz44f') || document.querySelector('[aria-label="Home"]') || document.querySelector('div[role="navigation"] .x1heor9g'); if (homeIconAnchor) { this.injectShieldControllerButton(homeIconAnchor); } } static injectShieldControllerButton(homeIconAnchor) { const host = document.createElement('div'); host.id = 'fritree-fb-shield-btn-host'; host.style.cssText = 'margin: 0 8px; display: inline-flex; align-items: center; justify-content: center;'; const shadow = host.attachShadow({ mode: 'closed' }); const btn = document.createElement('div'); btn.style.cssText = ` display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer; border-radius: 50%; background-color: var(--secondary-button-background, #E4E6EB); position: relative; box-sizing: border-box; `; btn.title = "Configure Stealth Behavioral Shield - Fritree"; btn.innerHTML = ` <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="var(--primary-icon, #050505)" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"> <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/> <circle cx="12" cy="11" r="3"/> </svg> `; btn.addEventListener('mouseenter', () => { btn.style.backgroundColor = 'var(--hover-overlay, rgba(0, 0, 0, 0.1))'; }); btn.addEventListener('mouseleave', () => { btn.style.backgroundColor = 'var(--secondary-button-background, #E4E6EB)'; }); btn.addEventListener('click', () => { this.toggleFloatingManagementPanel(); }); shadow.appendChild(btn); if (homeIconAnchor.nextSibling) { homeIconAnchor.parentNode.insertBefore(host, homeIconAnchor.nextSibling); } else { homeIconAnchor.parentNode.appendChild(host); } TelemetryLogger.log("System Kernel", "Stealth Shield control switch connected to Facebook UI.", "info"); } static toggleFloatingManagementPanel() { let existingHost = document.getElementById('fritree-fb-panel-host'); if (existingHost && panelShadowRootRef) { const panel = panelShadowRootRef.getElementById('fritree-fb-floating-panel'); if (panel) { panel.style.display = (panel.style.display === 'none') ? 'flex' : 'none'; if (panel.style.display === 'flex') { this.setInitialSwitchesState(panelShadowRootRef); } } return; } const panelHost = document.createElement('div'); panelHost.id = 'fritree-fb-panel-host'; panelHost.style.cssText = 'position: fixed; top: 56px; left: 0; width: 100vw; height: calc(100vh - 56px); z-index: 9999999; pointer-events: none;'; const shadow = panelHost.attachShadow({ mode: 'open' }); panelShadowRootRef = shadow; document.body.appendChild(panelHost); const container = document.createElement('div'); container.id = 'fritree-fb-floating-panel'; container.style.cssText = 'width: 100%; height: 100%; display: flex; flex-direction: row; direction: ltr;'; container.innerHTML = ` <div style="width: 100%; height: 100%; background: #ffffff; border-right: 1px solid #cbd5e1; box-shadow: 10px 0 30px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; pointer-events: auto; font-family: system-ui, -apple-system, sans-serif; text-align: left; direction: ltr;"> <div style="background: #ffffff; color: #1e293b; padding: 16px 20px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0;"> <div style="display: flex; align-items: center; gap: 8px;"> <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#1877f2" stroke-width="2.5" style="margin-right: 8px;"> <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/> </svg> <span style="font-size: 14px; color: #1e293b; font-weight: 900;">Stealth Guard Control Panel - Facebook Node (SHA-256)</span> </div> <button id="_fritree-fb-panel-close" style="background: none; border: none; color: #64748b; font-size: 24px; cursor: pointer; font-weight: bold; padding: 0 10px;">&times;</button> </div> <div style="display: flex; background: linear-gradient(180deg, #ffffff, #f7fbfe); border-bottom: 1px solid #e2e8f0; font-size: 11px; font-weight: 800; overflow-x: auto;"> <div class="_fb-panel-tab active" data-tab="tab-fb-dash" style="padding: 14px; flex: 1; text-align: center; cursor: pointer; border-bottom: 3px solid #1877f2; color: #1877f2; white-space: nowrap;">Diagnostics Dashboard</div> <div class="_fb-panel-tab" data-tab="tab-fb-safety" style="padding: 14px; flex: 1; text-align: center; cursor: pointer; border-bottom: 3px solid transparent; color: #64748b; white-space: nowrap;">Stealth Behavior</div> <div class="_fb-panel-tab" data-tab="tab-fb-mouse-scroll" style="padding: 14px; flex: 1; text-align: center; cursor: pointer; border-bottom: 3px solid transparent; color: #64748b; white-space: nowrap;">Mouse & Scroll Parameters</div> <div class="_fb-panel-tab" data-tab="tab-fb-fingerprint" style="padding: 14px; flex: 1; text-align: center; cursor: pointer; border-bottom: 3px solid transparent; color: #64748b; white-space: nowrap;">Fingerprint Masking</div> <div class="_fb-panel-tab" data-tab="tab-fb-logs" style="padding: 14px; flex: 1; text-align: center; cursor: pointer; border-bottom: 3px solid transparent; color: #64748b; white-space: nowrap;">Kernel System Logs</div> </div> <div style="flex: 1; overflow-y: auto; padding: 20px; font-size: 13px; line-height: 1.5; color: #1e293b; background: #ffffff;" id="fritree-fb-panel-body"> <div id="tab-fb-dash" class="fb-p-content-pane" style="display: block;"> <h4 style="font-size: 11px; font-weight: 800; color: #64748b; margin-bottom: 12px; text-transform: uppercase;">Stealth Shield Health Diagnostics</h4> <div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 12px;"> <div style="display: flex; justify-content: space-between;"><span>Session Shield State:</span> <strong style="color: #1877f2;">Active (SIS Protected)</strong></div> <div style="display: flex; justify-content: space-between;"><span>Cryptographic Checksum:</span> <strong style="color: #10b981;">Verified (SHA-256 Signed) 🔑</strong></div> <div style="display: flex; justify-content: space-between;"><span>Encrypted Database Storage:</span> <strong style="color: #10b981;">Fully Isolated & Locked</strong></div> <div style="display: flex; justify-content: space-between;"><span>Virtual Pointer Status:</span> <strong id="cursor-visual-state-lbl" style="color: #64748b;">Active</strong></div> </div> </div> <div id="tab-fb-safety" class="fb-p-content-pane" style="display: none;"> <h4 style="font-size: 11px; font-weight: 800; color: #64748b; margin-bottom: 12px; text-transform: uppercase;">Cognitive & Human Behavior Customizations</h4> <div style="display: flex; flex-direction: column; gap: 10px;"> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Simulated Keyboard Typing Jitter</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Randomizes delays between keypress events to mimic organic human speed.</span> </div> <input type="checkbox" id="chk-fb-human-type" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Strict Decoy Honeypot Avoidance</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Bypasses elements matching decoy metrics (hidden attributes, absolute zero sizing).</span> </div> <input type="checkbox" id="chk-fb-honeypot-strict" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Micro-Hesitation delays</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Simulates realistic delay focus shifts before initial typing interactions.</span> </div> <input type="checkbox" id="chk-fb-hesitation" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Multi-Task Focus Shuffling</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Periodically triggers tab refocus triggers to mock active background operation.</span> </div> <input type="checkbox" id="chk-fb-focus-shuffle" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Dynamic Viewport Jitter</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Introduces sub-pixel layout offsets to disrupt rendering fingerprints.</span> </div> <input type="checkbox" id="chk-fb-viewport-jitter" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> </div> </div> <div id="tab-fb-mouse-scroll" class="fb-p-content-pane" style="display: none;"> <h4 style="font-size: 11px; font-weight: 800; color: #64748b; margin-bottom: 12px; text-transform: uppercase;">Mouse Tracking & Scrolling Parameters</h4> <div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px;"> <label style="display: flex; align-items: center; justify-content: space-between; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Draw Visible Red Virtual Cursor</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Renders a red mouse pointer tracking Bezier mathematical sweeps.</span> </div> <input type="checkbox" id="chk-fb-show-virtual-cursor" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Physics-Based Inertial Scrolling</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Applies cubic interpolation scrolling sweeps instead of standard linear transitions.</span> </div> <input type="checkbox" id="chk-fb-smooth-scroll" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Micro-Pauses Idle Cursor Drift</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Slowly drifts cursor during active interaction pauses.</span> </div> <input type="checkbox" id="chk-fb-cursor-drift" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <hr style="border: 0; border-top: 1px dashed #e2e8f0; margin: 4px 0;"> <div style="display: flex; flex-direction: column; gap: 4px;"> <div style="display: flex; justify-content: space-between; font-weight: bold;"> <span>Scroll Distance Increment:</span> <span id="lbl-scroll-pixels-val" style="color: #1877f2;">250px</span> </div> <input type="range" id="range-scroll-step" min="100" max="2000" step="50" style="width: 100%; accent-color: #1877f2; cursor: pointer;"> </div> <div style="display: flex; flex-direction: column; gap: 4px;"> <div style="display: flex; justify-content: space-between; font-weight: bold;"> <span>Reading Simulation Scroll Iterations:</span> <span id="lbl-scroll-cycles-val" style="color: #1877f2;">4 Cycles</span> </div> <input type="range" id="range-scroll-cycles" min="1" max="20" step="1" style="width: 100%; accent-color: #1877f2; cursor: pointer;"> </div> </div> </div> <div id="tab-fb-fingerprint" class="fb-p-content-pane" style="display: none;"> <h4 style="font-size: 11px; font-weight: 800; color: #64748b; margin-bottom: 12px; text-transform: uppercase;">Obfuscate Browser Hardware & Fingerprint Matrix</h4> <div style="display: flex; flex-direction: column; gap: 10px;"> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Canvas Rendering Spoofing (Canvas Noise)</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Adds microscopic pixel distortions during canvas rendering to prevent profiling.</span> </div> <input type="checkbox" id="chk-fb-canvas-noise" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Audio Fingerprinting Obfuscation</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Adds microscopic frequency variations to output buffer calculations.</span> </div> <input type="checkbox" id="chk-fb-audio-noise" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> <label style="display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;"> <div> <span style="font-weight: bold; color: #1e293b; display: block;">Network Information API Spoofing</span> <span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">Overrides navigator.connection values to mock high-fidelity static 4G profiles.</span> </div> <input type="checkbox" id="chk-fb-network-info" style="width: 18px; height: 18px; cursor: pointer; accent-color: #1877f2;"> </label> </div> </div> <div id="tab-fb-logs" class="fb-p-content-pane" style="display: none;"> <h4 style="font-size: 11px; font-weight: 800; color: #64748b; margin-bottom: 8px; text-transform: uppercase;">Kernel Logging Terminal</h4> <div id="fb-panel-logs-list" style="background: linear-gradient(180deg, #ffffff, #f7fbfe); color: #1e293b; padding: 14px; border-radius: 12px; height: 350px; overflow-y: auto; font-family: Consolas, monospace; font-size: 11px; text-align: left; direction: ltr; border: 1px solid #cbd5e1;"> <div style="text-align: center; color: #64748b; padding: 20px;">Waiting for campaign trigger to capture Facebook system logs...</div> </div> </div> </div> <div style="padding: 12px 18px; background: linear-gradient(180deg, #ffffff, #f7fbfe); border-top: 1px solid #e2e8f0; text-align: center; font-size: 11px; font-weight: 800; color: #64748b;"> <span>Protected Human Behavior Simulator Node - Facebook Edge - Fritree</span> </div> </div> `; shadow.appendChild(container); shadow.querySelectorAll('._fb-panel-tab').forEach(tab => { tab.addEventListener('click', () => { shadow.querySelectorAll('._fb-panel-tab').forEach(t => { t.classList.remove('active'); t.style.borderBottomColor = 'transparent'; t.style.color = '#64748b'; }); tab.classList.add('active'); tab.style.borderBottomColor = '#1877f2'; tab.style.color = '#1877f2'; const target = tab.getAttribute('data-tab'); shadow.querySelectorAll('.fb-p-content-pane').forEach(pane => { pane.style.display = (pane.id === target) ? 'block' : 'none'; }); }); }); const closeBtn = container.querySelector('#_fritree-fb-panel-close'); if (closeBtn) { closeBtn.addEventListener('click', () => { BehavioralSimulationEngine.stopIdleCursorDrift(); container.style.display = 'none'; }); } this.setInitialSwitchesState(shadow); this.bindPanelInteractions(shadow); } static bindPanelInteractions(shadow) { const bindSwitch = (elementId, configKey) => { const el = shadow.getElementById(elementId); if (el) { el.addEventListener('change', async (e) => { ShieldConfig[configKey] = e.target.checked; if (configKey === 'idleCursorDriftActive') { if (e.target.checked) { BehavioralSimulationEngine.startIdleCursorDrift(); } else { BehavioralSimulationEngine.stopIdleCursorDrift(); } } await saveConfigSecurely(); }); } }; bindSwitch('chk-fb-human-type', 'humanTypingActive'); bindSwitch('chk-fb-canvas-noise', 'canvasNoiseActive'); bindSwitch('chk-fb-audio-noise', 'audioFingerprintNoiseActive'); bindSwitch('chk-fb-viewport-jitter', 'viewportJitterActive'); bindSwitch('chk-fb-cursor-drift', 'idleCursorDriftActive'); bindSwitch('chk-fb-show-virtual-cursor', 'showVirtualCursor'); // New Advanced Facebook Controls bindSwitch('chk-fb-honeypot-strict', 'fbAntiHoneypotStrict'); bindSwitch('chk-fb-focus-shuffle', 'fbFocusShufflingActive'); bindSwitch('chk-fb-hesitation', 'fbHesitationBeforeType'); bindSwitch('chk-fb-smooth-scroll', 'fbSmoothScrollAcceleration'); bindSwitch('chk-fb-network-info', 'fbNetworkInfoSpoof'); const bindRange = (elementId, configKey, labelId, suffix = '') => { const range = shadow.getElementById(elementId); const label = shadow.getElementById(labelId); if (range && label) { range.addEventListener('input', (e) => { const val = parseInt(e.target.value); label.textContent = `${val.toLocaleString('en-US')}${suffix}`; }); range.addEventListener('change', async (e) => { ShieldConfig[configKey] = parseInt(e.target.value); await saveConfigSecurely(); }); } }; bindRange('range-scroll-step', 'scrollStepPixels', 'lbl-scroll-pixels-val', 'px'); bindRange('range-scroll-cycles', 'scrollTotalCycles', 'lbl-scroll-pixels-val', ' Cycles'); } static setInitialSwitchesState(shadow) { const setChecked = (id, key) => { const el = shadow.getElementById(id); if (el) el.checked = !!ShieldConfig[key]; }; const setVal = (id, key) => { const el = shadow.getElementById(id); if (el) el.value = ShieldConfig[key]; }; const setLabel = (id, text) => { const el = shadow.getElementById(id); if (el) el.textContent = text; }; setChecked('chk-fb-human-type', 'humanTypingActive'); setChecked('chk-fb-canvas-noise', 'canvasNoiseActive'); setChecked('chk-fb-audio-noise', 'audioFingerprintNoiseActive'); setChecked('chk-fb-viewport-jitter', 'viewportJitterActive'); setChecked('chk-fb-cursor-drift', 'idleCursorDriftActive'); setChecked('chk-fb-show-virtual-cursor', 'showVirtualCursor'); // Advanced controls states setChecked('chk-fb-honeypot-strict', 'fbAntiHoneypotStrict'); setChecked('chk-fb-focus-shuffle', 'fbFocusShufflingActive'); setChecked('chk-fb-hesitation', 'fbHesitationBeforeType'); setChecked('chk-fb-smooth-scroll', 'fbSmoothScrollAcceleration'); setChecked('chk-fb-network-info', 'fbNetworkInfoSpoof'); setVal('range-scroll-step', 'scrollStepPixels'); setVal('range-scroll-cycles', 'scrollTotalCycles'); setLabel('lbl-scroll-pixels-val', `${ShieldConfig.scrollStepPixels.toLocaleString('en-US')}px`); setLabel('lbl-scroll-cycles-val', `${ShieldConfig.scrollTotalCycles.toLocaleString('en-US')} Cycles`); const virtualCursorLabel = shadow.getElementById('cursor-visual-state-lbl'); if (virtualCursorLabel) { virtualCursorLabel.textContent = ShieldConfig.showVirtualCursor ? "Active & Visible" : "Stealth Hidden"; virtualCursorLabel.style.color = ShieldConfig.showVirtualCursor ? "#10b981" : "#64748b"; } } static bindCrossTabMessageListener() { if (typeof chrome !== 'undefined' && chrome.runtime && chrome.runtime.onMessage) { chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { if (request.action === 'execute_live_stealth_test') { (async () => { try { TelemetryLogger.log("Cross-Tab Signal", "Cross-tab live execution request captured.", "warn"); await loadConfigSecurely(); BehavioralSimulationEngine.applyViewportJitter(); await BehavioralSimulationEngine.runBezierMouseMovements(); await BehavioralSimulationEngine.runAdvancedScrollSimulation(); TelemetryLogger.log("Cross-Tab Signal", "Cross-tab simulation successfully executed.", "success"); sendResponse({ success: true }); } catch (err) { TelemetryLogger.log("Cross-Tab Signal", "Cross-tab simulation failed: " + err.message, "error"); sendResponse({ success: false, error: err.message }); } })(); return true; } }); } } } FacebookWebLayoutOverride.init(); CampaignOverlayManager.init(); })();
// ============================================================================
// File: content_fb.js
// ============================================================================
(async function() {
'use strict';
if (window.__FritreeFacebookShieldInitialized) {
console.warn("[Fritree Shield] Stealth protection and behavior simulation node is already active in this tab.");
return;
}
window.__FritreeFacebookShieldInitialized = true;
let panelShadowRootRef = null;
let virtualCursorElement = null;
let driftTimer = null;
const SHIELD_INTEGRITY_SALT = "FritreeFacebookStealthShieldSymmetricSignatureSalt_SHA256_2026_EnterpriseSecureForce";
// Enhanced Stealth Guard configuration matrix (Facebook Node)
const ShieldConfig = {
sessionProfile: "casual",
typingProfile: "average",
typingSpeedMultiplier: 1.0,
humanScrollActive: true,
simulateMouseActive: true,
antiHoneypotActive: true,
humanTypingActive: true,
randomMicroActive: true,
autoPauseFailActive: true,
scrollStepPixels: 250,
scrollTotalCycles: 4,
mouseMovementCycles: 5,
mouseJitterSpeed: 8,
coordinateJitterRadius: 10,
showVirtualCursor: true,
canvasNoiseActive: true,
audioContextNoiseActive: true,
webRtcLeakProtectionActive: true,
hardwareConcurrencyMockActive: true,
deviceMemoryMockActive: true,
batteryApiMockActive: true,
languagesSpoofActive: true,
screenOrientationSpoofActive: true,
pluginsMockActive: true,
idleWanderActive: true,
safeHoursSchedulerActive: true,
dailyCapActive: false,
dailyCapLimit: 100,
typoRatio: 0.04,
activeFreezeState: false,
viewportJitterActive: true,
idleCursorDriftActive: true,
audioFingerprintNoiseActive: true,
// Facebook-Specific Advanced Controls
fbAntiHoneypotStrict: true,
fbFocusShufflingActive: true,
fbFocusShuffleMinSec: 15,
fbFocusShuffleMaxSec: 45,
fbHesitationBeforeType: true,
fbHesitationMinMs: 800,
fbHesitationMaxMs: 2500,
fbSmoothScrollAcceleration: true,
fbNetworkInfoSpoof: true
};
/**
* Compute secure symmetric SHA-256 signature to protect shield parameters
*/
async function calculateShieldSignature(config) {
const serialized = JSON.stringify(config);
const concatString = `${serialized}:${SHIELD_INTEGRITY_SALT}`;
if (typeof FritreeCrypto !== 'undefined' && typeof FritreeCrypto.signReceipt === 'function') {
return await FritreeCrypto.signReceipt(
"FB_STEALTH_SHIELD_V3",
concatString.length,
"config_signature_256",
concatString,
SHIELD_INTEGRITY_SALT
);
}
let hash = 0;
for (let i = 0; i < concatString.length; i++) {
const char = concatString.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash |= 0;
}
return "fallback_shield_sig_256_" + Math.abs(hash).toString(16);
}
/**
* Save shield parameters securely with SHA-256 cryptographic signatures
*/