NorthernTribe-Research/ai-phishing-detector
   
Enterprise-Grade Neural Threat Detection Engine
A production-ready, multi-modal inference engine designed to detect sophisticated AI-generated phishing, impersonation, and social engineering attacks across Email, SMS, and Social Platforms.
System Overview
This solution leverages Zero-Shot Natural Language Inference (NLI) and Computer Vision (OCR) to identify malicious intent without relying solely on static signature databases. It is designed for rapid deployment in containerized environments (Docker/Kubernetes) or serverless platforms like Hugging Face Spaces.
Core Capabilities
Architecture
graph TD
User[User / Client] -->|Text or Image| API[FastAPI / Gradio Interface]
API --> Router{Input Type?}
Router -->|Image| OCR[OCR Engine]
OCR -->|Extracted Text| Pre[Preprocessing Pipeline]
Router -->|Text| Pre
Pre -->|Cleaned Text| NLI[Zero-Shot Classifier]
Pre -->|Metadata| Heur[Heuristic Engine]
subgraph Inference Engine
NLI -->|Intent Probabilities| Aggregator
Heur -->|URL/Urgency Scores| Aggregator
Aggregator -->|Final Risk Score| Outcome[Risk Assessment]
end
Outcome -->|JSON / UI| UserQuickstart
Option A: Docker (Recommended)
Run the fully containerized application to ensure environment consistency.
# Build the container
docker build -t unit731/phish-detector .
# Run on port 7860
docker run -p 7860:7860 unit731/phish-detectorOption B: Local Python Environment
# 1. Clone repository
git clone https://github.com/734ai/phish_detector_space_files.git
cd phish_detector_space_files
# 2. Setup Virtual Environment
python -m venv .venv
source .venv/bin/activate
# 3. Install Dimensions
pip install -r requirements.txt
# 4. Launch Application
python app.pyConfiguration
The application can be configured via Environment Variables for enterprise integration.
Security & Privacy
- Data Handling: This application processes data in-memory. No data is persisted to disk or external databases by default.
- PII Safety: We recommend sanitizing PII (Personally Identifiable Information) before submission, although the model runs locally within the container.
- Container Security: The Docker image is built on
python:3.10-slimto minimize attack surface. Run as a non-root user (configured in Dockerfile).
Directory Structure
.
├── app.py # Application Entrypoint (Gradio/FastAPI)
├── Dockerfile # Container Definition
├── requirements.txt # Python Dependencies
├── src/
│ ├── inference.py # Core Logic & Model Loading
│ ├── ocr.py # Optical Character Recognition Pipeline
│ ├── preprocessing.py # Text Normalization & Heuristics
│ └── scoring.py # Risk Aggregation Logic
└── assets/ # Static Resources (UI Styles, Images)Contributing
We welcome contributions from the security community. Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes.
- Open a Pull Request.
License
Distributed under the MIT License. See LICENSE for more information.
Developed by Unit 731 for a safer internet.
