Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhishShield 🛡️

License Python Version FastAPI Playwright ML

PhishShield is a production-grade, AI-driven cybersecurity system that detects and blocks malicious URLs and zero-day phishing attacks in real-time. It intercepts network traffic via a Chrome Extension and routes it through a multi-layered, low-latency "Early-Exit" Machine Learning pipeline.

🚀 Features

  • "Bounce" Architecture Interception: A Manifest V3 Chrome Extension that synchronously halts navigation to unverified links, buffering them with a modern interstitial UI.
  • Early-Exit Inference Pipeline: Employs multiple stages of circuit-breaking to clear benign links in milliseconds without needing to execute heavy sandbox analysis.
  • Multi-Modal AI Engine:
    • URL & Content DistilBERT: NLP parsing for phishing URL vernacular and HTML DOM structures.
    • PHP XGBoost Classifier: Static heuristic engine identifying backend web-shells, backdoors, and logic exploits natively.
    • Behavior & Zero-Day Isolation Forests: Unsupervised anomaly detection tracking sandbox redirects and extreme entropy.
  • Headless Sandbox Triage: Asynchronous headless rendering using Playwright to extract DOM paths and catch direct .exe / .bat file payloads before they hit the disk.
  • Anti-False Positive Mitigations: Custom calculus to prevent ad-heavy free-hosting subdomains from being categorized as phishing if they lack credential harvesting mechanisms.

🧠 Architecture Overview

PhishShield utilizes an orchestration engine across 3 phases:

  1. Stage 1 (Liveness & Fast-Path): URL TLD heuristics and URL-DistilBERT determine if the string alone is highly trustworthy.
  2. Stage 2 (DOM Extraction): If suspicious, the Sandbox pulls HTML structural proxies. Content-DistilBERT scores the DOM.
  3. Stage 3 (Full Anomaly Fusion): XGBoost handles exposed backend signatures while Isolation Forests map behavioral footprints. All scores run through a weighted Risk Fusion matrix.

📂 Project Structure

phishshield/
├── extension/           # Chrome Manifest V3 Extension (UI & Interceptors)
├── server/
│   ├── api/             # FastAPI App & Endpoints
│   ├── inference/       # Core ML Pipeline & Risk Engine
│   ├── models/          # Neural Networks & XGBoost architectures
│   ├── php_analyzer/    # Static codebase analyzers
│   └── sandbox/         # Async Playwright Headless Browser
├── data/                # Crawled legitimate & phishing domains (CSV)
├── run_server.py        # Production Server deployment script
├── run_training.py      # ML Retraining pipeline
└── requirements.txt     # Python dependencies

🛠️ Installation & Setup

1. Backend Server Setup

Ensure you have Python 3.10+ installed.

# Clone the repository
git clone https://github.com/yourusername/phishshield.git
cd phishshield

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install Playwright sandbox browsers
playwright install chromium

2. Loading the Models

(Note: Trained weights should be placed in models/ or trained locally) If you need to train models from scratch on the provided datasets, you can utilize the training script or Colab notebooks:

python run_training.py

3. Running the Server

Launch the production API server:

python run_server.py --port 8000 --workers 4

4. Chrome Extension Installation

  1. Open Google Chrome and navigate to chrome://extensions/.
  2. Enable Developer mode in the top right corner.
  3. Click Load unpacked.
  4. Select the extension/ folder from this repository.
  5. The extension is now active and monitoring navigations.

📊 API Endpoints

  • POST /scan: Submit a single URL {"url": "https://example.com", "deep_scan": false}.
  • POST /scan/batch: Submit an array of URLs for bulk risk analysis.
  • POST /report: User crowdsourced endpoint to classify sites as safe/malicious.
  • GET /health: Model status and RAM payload capacity checks.

🤝 Contributing

Pull requests are welcome! If you're contributing new ML architectures, ensure they do not exceed a total 50ms latency overhead over the Fast-Path circuit breakers. Please see run_tests.py for ensuring regression stability.

⚖️ License

This project is licensed under the MIT License.

About

PhishShield is an AI cybersecurity tool that blocks zero-day phishing attacks in real-time. A Chrome extension intercepts traffic, routing it to a Python backend. Its multi-stage, early-exit ML pipeline uses DistilBERT and XGBoost to instantly clear safe links while deeply sandboxing complex and evasive threats.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages