Skip to content

aurelianware/PrivaseeAI.Security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

130 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

PrivaseeAI.Security

License Python 3.11+ Code Tests Coverage

Real-Time iOS Threat Detection & Monitoring System

PrivaseeAI.Security is a privacy-preserving iOS threat detection system that provides continuous security monitoring through VPN integrity checks, backup analysis, and behavioral pattern detection. Built in response to a real carrier-level attack, every detection rule is validated against actual threat patterns.

Status: v0.3.0-alpha - MVP Complete | 9,879 lines of Python | 196 tests passing | Production ready

🎯 Overview

Unlike traditional periodic scans, PrivaseeAI.Security provides continuous real-time monitoring with instant alerts when threats are detected. All analysis happens locally on your machine, ensuring complete privacy and data sovereignty.

What Makes This Different

  • βœ… Battle-Tested: Built from real carrier-level attack (January 26, 2026)
  • βœ… Continuous Monitoring: Real-time detection, not periodic scans
  • βœ… Privacy-First: 100% local processing, no cloud dependencies
  • βœ… Production-Ready: 9,879 lines of code, 196 tests passing
  • βœ… Open Source: Apache 2.0 license, full transparency

✨ Current Features (v0.3.0-alpha)

πŸ›‘οΈ Real-Time Threat Detection

VPN Integrity Monitor (386 lines)

  • Detects TCP fallback when UDP is blocked
  • Tracks API rate limiting and cooldown periods
  • Identifies server hopping patterns (4+ servers in <10 min)
  • Validates certificates against known-good fingerprints
  • 14 integration tests covering real attack scenarios

API Abuse Monitor (397 lines)

  • Location tracking detection via API abuse
  • Rate limit identification and analysis
  • Burst pattern detection
  • Background activity monitoring
  • 19 unit tests validating all detection rules

Carrier Compromise Detector (790 lines)

  • Localhost routing detection in VPN profiles
  • eSIM profile monitoring
  • DNS tampering identification
  • Cross-backup persistence tracking
  • 28 comprehensive unit tests

Certificate Validator (295 lines)

  • Known-good fingerprint database (ProtonVPN baseline)
  • Certificate chain validation
  • Expiry date checking
  • Self-signed certificate detection
  • 8 unit tests ensuring accuracy

Telegram Alerting (300 lines)

  • Real-time notifications for CRITICAL/HIGH threats
  • Severity-based filtering
  • Automatic threat deduplication
  • Custom message formatting
  • Alert throttling to prevent spam

πŸš€ System Architecture

Orchestrator (374 lines)

  • Concurrent monitoring using asyncio
  • Multi-monitor coordination
  • Smart threat aggregation
  • Automatic deduplication
  • Graceful shutdown handling

CLI Interface (319 lines)

privasee start      # Start continuous monitoring
privasee scan       # One-time security scan
privasee status     # Check system health
privasee config     # View configuration
privasee alerts     # Show recent threats
privasee dashboard  # Launch web dashboard (NEW in v0.3.0)

Rich console output with tables and color-coded severity indicators

πŸ”§ Infrastructure

  • Configuration System (180 lines) - YAML support, environment variables, validation
  • Device Info Extractor (796 lines) - iOS backup parsing, profile extraction
  • File Watcher (97 lines) - Real-time directory monitoring
  • Logger (97 lines) - JSON/text formatting, structured logging
  • Crypto Module (123 lines) - AES-256 encryption, SHA hashing

πŸ“Š Test Coverage

196 Tests - 100% Pass Rate

tests/
β”œβ”€β”€ unit/ (148 tests)
β”‚   β”œβ”€β”€ VPN integrity, API abuse, carrier detection
β”‚   β”œβ”€β”€ Certificate validation, crypto operations
β”‚   └── Configuration, logging, file watching
β”‚
└── integration/ (48 tests)
    β”œβ”€β”€ Backup monitoring workflow
    β”œβ”€β”€ Real attack pattern detection
    └── End-to-end monitoring scenarios

All tests use real attack logs from the January 26, 2026 incident as fixtures.

πŸ”’ Privacy-First Design

  • 100% Local Processing - All analysis on your machine
  • No Cloud Dependencies - Fully self-hosted, no external services
  • Data Sovereignty - You control all security data
  • Encrypted Backups Supported - Works with both encrypted and unencrypted iOS backups
  • Open Source - Full code transparency, audit the security yourself

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              PrivaseeAI Security CLI                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚         Threat Orchestrator (asyncio)             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”˜  β”‚
β”‚       β”‚             β”‚              β”‚             β”‚      β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β–Όβ”€β”€β”€β”€β” β”‚
β”‚  β”‚    VPN    β”‚ β”‚    API     β”‚ β”‚  Carrier   β”‚ β”‚Backupβ”‚ β”‚
β”‚  β”‚ Integrity β”‚ β”‚   Abuse    β”‚ β”‚Compromise  β”‚ β”‚ Mon  β”‚ β”‚
β”‚  β”‚  Monitor  β”‚ β”‚  Monitor   β”‚ β”‚  Detector  β”‚ β”‚itor  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”¬β”€β”€β”€β”€β”˜ β”‚
β”‚       β”‚             β”‚             β”‚              β”‚      β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                            β”‚                             β”‚
β”‚                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚                   β”‚ Threat Aggregatorβ”‚                   β”‚
β”‚                   β”‚  & Deduplication β”‚                   β”‚
β”‚                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                            β”‚                             β”‚
β”‚                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚                   β”‚     Telegram     β”‚                   β”‚
β”‚                   β”‚     Alerter      β”‚                   β”‚
β”‚                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Python 3.11+ (required)
  • macOS with iOS device backup capability
  • iPhone with iOS 14+ (tested on iPhone 16 Pro, iOS 18.2)
  • Telegram Bot (optional, for alerts)

Installation

# 1. Clone the repository
git clone https://github.com/aurelianware/PrivaseeAI.Security.git
cd PrivaseeAI.Security

# 2. Create virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Install package in development mode
pip install -e .

# 5. Verify installation
privasee --help

Basic Usage

# Start continuous monitoring
privasee start

# Run one-time scan
privasee scan

# Check system status
privasee status

# View configuration
privasee config

# View recent alerts
privasee alerts

# Launch web dashboard
privasee dashboard
# Visit http://localhost:8000

Optional: Telegram Alerts

# 1. Create bot with @BotFather on Telegram
# 2. Get your bot token and chat ID
# 3. Configure alerts

export TELEGRAM_BOT_TOKEN="your_token_here"
export TELEGRAM_CHAT_ID="your_chat_id"

# Or add to .env file
echo "TELEGRAM_BOT_TOKEN=your_token" >> .env
echo "TELEGRAM_CHAT_ID=your_chat_id" >> .env

πŸ“– Documentation

Getting Started

Advanced Usage

Development

🎯 Use Cases

Individual Users

  • Monitor your iPhone for sophisticated attacks
  • Detect VPN manipulation in real-time
  • Identify location tracking attempts
  • Verify iOS backup integrity

Security Professionals

  • Forensic analysis of compromised devices
  • Threat research and pattern identification
  • Security auditing for clients
  • Incident response tool

Privacy Advocates

  • Verify carrier-level security
  • Monitor for government surveillance
  • Detect spyware and tracking
  • Maintain digital privacy

πŸ” Real-World Validation

Built from Actual Attack

On January 26, 2026, the developer's iPhone was compromised at the carrier level. This system was built to detect and prevent such attacks:

Attack Patterns Detected:

  • βœ… UDP blocking forcing WireGuard to TCP
  • βœ… API rate limiting (50-minute cooldown) for location tracking
  • βœ… Server hopping (4 servers in 7 minutes)
  • βœ… Certificate manipulation attempts
  • βœ… DNS64 tampering

Every detection rule is validated against these real attack logs.

Test Validation

  • iPhone 16 Pro (iOS 18.2) - Full validation
  • iPhone 12+ (iOS 14+) - Expected to work
  • macOS Ventura/Sonoma - Tested and working

πŸ—ΊοΈ Roadmap

βœ… Phase 0-2: MVP Complete (Weeks 1-6)

  • Core monitoring system
  • CLI interface
  • Real-time alerting
  • Comprehensive testing
  • Status: Shipped v0.3.0-alpha

πŸ”„ Phase 3: Production Deployment (February 2026)

  • Background service (launchd)
  • Auto-start on boot
  • Log rotation
  • Crash recovery
  • Status: In Progress

πŸ“… Phase 4: Persistence Layer (March 2026)

  • PostgreSQL + TimescaleDB
  • Historical analysis
  • Multi-device support (3+ devices)
  • Query API

πŸ“… Phase 5: Web Dashboard (March-April 2026)

  • FastAPI REST API
  • React dashboard
  • Real-time visualization
  • Configuration UI
  • PDF reports

πŸ“… Phase 6+: Advanced Features (Q2-Q4 2026)

  • AI/ML anomaly detection
  • SIEM integrations
  • Enterprise features
  • Mobile apps

See ROADMAP.md for detailed timeline and milestones.

🀝 Contributing

We welcome contributions! This project needs:

High Priority:

  • πŸ”΄ Beta testers with iPhones (iOS 14+)
  • πŸ”΄ Python developers for dashboard
  • 🟠 UI/UX designers
  • 🟠 Technical writers
  • 🟑 Security researchers

Getting Started:

  1. Read CONTRIBUTING.md
  2. Check open issues
  3. Look for good first issue labels
  4. Fork, code, test, submit PR

πŸ“Š Project Stats

Metric Value
Total Code 9,879 lines Python
Production Code 4,322 lines
Test Code 3,568 lines
Tests 196 (100% passing)
Documentation 2,000+ lines
Development Time 6 weeks (MVP)
Test Fixtures Real attack logs

πŸ›‘οΈ Security

Reporting Vulnerabilities:

Security Features:

  • All analysis happens locally
  • No telemetry or tracking
  • Encrypted backup support
  • Open source for full auditability

πŸ“„ License

Apache License 2.0 - See LICENSE for details.

TL;DR: You can use, modify, and distribute this software commercially or non-commercially, with attribution.

πŸ™ Acknowledgments

Built on the shoulders of giants:

  • iOS Security Community - Threat intelligence and research
  • MVT Project - Mobile Verification Toolkit indicators
  • Amnesty Tech - NSO Pegasus research and STIX feeds
  • ProtonVPN - Certificate fingerprint baseline for validation
  • Real-World Attack - January 26, 2026 incident that motivated this project

πŸ“ž Support & Community

⚠️ Disclaimer

Legal Notice: This tool is designed for monitoring YOUR OWN devices for security threats. Unauthorized monitoring of devices you do not own or have explicit permission to monitor may be illegal in your jurisdiction. Always respect privacy laws and obtain proper authorization.

Use at Your Own Risk: This software is provided "as is" without warranty. While we strive for accuracy, false positives and false negatives may occur. Always verify threats independently.

🌟 Star History

If you find this project useful, please consider:

  • ⭐ Starring the repository on GitHub
  • πŸ› Reporting issues you encounter
  • πŸ’‘ Suggesting features you'd like to see
  • 🀝 Contributing code or documentation
  • πŸ“’ Sharing with others who might benefit

Built with πŸ›‘οΈ by privacy advocates, for privacy advocates.

Status: v0.3.0-alpha | MVP Complete | Production Ready | 196 tests passing

Get Started | Documentation | Contribute | Roadmap

About

Security Repo for keeping your devices private

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •