Skip to content

Dhimahi-T-Mehta/BrowserGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ BrowserGuard – Privacy-First AI Browser Security Extension

A Manifest V3 Chrome Extension that detects phishing websites and cryptojacking attacks in real time using Machine Learning, WebAssembly, and heuristic threat analysis — all running locally inside the browser.


🚀 Overview

BrowserGuard is a privacy-first browser security extension built with Chrome Manifest V3 that protects users from modern web threats without sending browsing data to external servers.

Unlike traditional browser security tools that rely on cloud APIs, BrowserGuard performs 100% client-side threat analysis, ensuring:

  • 🔒 Complete user privacy
  • ⚡ Zero network latency
  • 📴 Offline threat detection
  • 🤖 AI-powered classification
  • 🛡️ Real-time webpage protection

The extension combines Machine Learning with heuristic analysis to create a defense-in-depth architecture capable of detecting phishing websites, suspicious domains, and hidden cryptojacking scripts.


✨ Features

  • 🧠 XGBoost Machine Learning model deployed directly inside the browser
  • ⚡ ONNX Runtime Web (WebAssembly) inference
  • 🔐 Privacy-first architecture (no cloud APIs)
  • 🌐 Real-time phishing detection
  • ⛏️ Hidden cryptojacking detection
  • 📊 Live Threat Score dashboard
  • 🚨 Automatic warning overlay for dangerous websites
  • 🧩 Chrome Manifest V3 architecture
  • ⚙️ Offscreen Document based ML execution

🏗️ Architecture

BrowserGuard follows a Dual-Engine Defense-in-Depth Architecture.

🤖 Machine Learning Engine

The ML engine runs entirely inside a Manifest V3 Offscreen Document.

Pipeline:

Dataset (16GB) → Feature Engineering → XGBoost Training → ONNX Conversion → WebAssembly Inference → Threat Score (0–100)

Features used include:

  • Shannon Entropy
  • WHOIS Age
  • TLS Chain Length
  • TLS Status

The XGBoost model outputs raw log-odds, which are converted into a Threat Score using a Sigmoid function.


🛡️ Heuristic Detection Engine

To complement the ML model and reduce false negatives caused by dataset imbalance, BrowserGuard performs additional real-time analysis using JavaScript.

It detects:

  • Suspicious high-entropy domains (DGA detection)
  • Hidden WebWorkers
  • Cryptojacking scripts
  • Malicious DOM mutations

A MutationObserver continuously monitors the webpage for suspicious runtime behavior.


⚙️ Tech Stack

Browser Technologies

  • Chrome Manifest V3
  • Service Workers
  • Offscreen Documents
  • Chrome Scripting API
  • ActiveTab API

Machine Learning

  • Python
  • XGBoost
  • ONNX
  • ONNX Runtime Web
  • WebAssembly (WASM)

Frontend

  • HTML
  • CSS
  • JavaScript

📁 Project Structure

BrowserGuard
│
├── assets/
│   └── browserguard_model.onnx
│
├── lib/
│   ├── ort.min.js
│   └── ort-wasm-simd.wasm
│
├── manifest.json
├── background.js
├── content.js
├── popup.html
├── popup.js
├── offscreen.html
├── offscreen.js
└── README.md

🔄 Threat Detection Workflow

  1. User visits a website.
  2. BrowserGuard extracts URL and webpage features.
  3. Network-related features are dynamically simulated for the MVP.
  4. The feature vector is sent to the Offscreen Document.
  5. ONNX Runtime performs ML inference.
  6. The Heuristic Engine performs runtime inspection.
  7. A Threat Score is generated.
  8. If the score exceeds the security threshold, BrowserGuard blocks the webpage with a warning overlay.

🔒 Privacy

BrowserGuard never sends browsing history or webpage data to remote servers.

All Machine Learning inference is performed locally using WebAssembly, ensuring complete user privacy.


🚀 Installation

Load the Extension

  1. Clone or download this repository.
  2. Open chrome://extensions/
  3. Enable Developer Mode
  4. Click Load unpacked
  5. Select the BrowserGuard folder.

📈 Future Improvements

  • Live WHOIS integration
  • TLS certificate validation
  • Threat intelligence feeds
  • Automatic model updates
  • Firefox support
  • Edge support
  • Chrome Web Store deployment

📄 License

This project is released under the MIT License.


⭐ If you found this project useful, consider giving it a star!

About

BrowserGuard is an AI-powered browser security extension that detects phishing websites, malicious URLs, scam pages and suspicious web content in real time using machine learning and cybersecurity techniques.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors