Skip to content

Nespartious/Fortify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

178 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏰 Fortify

Advanced DDoS Protection for Tor Hidden Services

CI Security Audit Tor Alignment Code Quality Coverage SBOM Dependency Review

Status Rust License


πŸ’° Support Development

If Fortify helps protect your service, consider supporting development:

Monero (XMR):

8BWceRPePNGBJditiULcsHao4jShvuQeQ9tisu7sU2efHnMqJqeQdcnXM9h3qYsGUx53jP5mV7zpdWGgWFCKhWzPDtysEu1

πŸ”’ Security Verification

What does "Security Audit Passed" mean?

Our Security Audit workflow runs 6 independent security checks:

Check Tool What It Validates
Vulnerability Scan cargo-audit Checks all dependencies against RustSec Advisory Database for known CVEs
License Compliance cargo-deny Ensures all dependencies use approved licenses (MIT, Apache-2.0, BSD)
SAST Analysis Semgrep Static analysis for security anti-patterns, injection risks, unsafe patterns
Unsafe Code Audit cargo-geiger Reports all unsafe blocks in codebase and dependencies
Secrets Detection Gitleaks Scans for accidentally committed API keys, tokens, credentials
Supply Chain cargo-vet Verifies dependency integrity and trusted sources

Runs daily and on every push to main. View workflow β†’

What does "CI Passed" mean?
Check Description
Build Compiles on stable Rust with all features
Tests 131+ unit and integration tests pass
Clippy Zero warnings from Rust linter
Format Code follows rustfmt standards
What does "Tor Alignment Passed" mean?

Ensures Fortify is fully compatible with Tor Browser's privacy requirements:

Check What It Validates
No JavaScript HTML contains no <script> tags (Tor Browser disables JS by default)
No External URLs No CDN, Google Fonts, or external resource loading (prevents deanonymization)
No Tracking No tracking pixels, analytics, or inline event handlers
Privacy Patterns Flags IP extraction and User-Agent logging for review
Tor Headers Reports on Onion-Location and security header implementation

Runs on every push/PR. View workflow β†’

Fortify is a sophisticated multi-layered defense system that protects Tor hidden services from DDoS attacks while maintaining access for legitimate users. Built in Rust for performance and security, Fortify acts as a proxy shield between attackers and your real hidden service.


🎯 Project Status: Alpha

Production-Ready Core Protection βœ…
Battle-tested DDoS defense for Tor hidden services. Blocks attack traffic while maintaining access for legitimate users.

Current Capabilities:

  • βœ… Per-circuit rate limiting (prevents IP-based blocking on Tor)
  • βœ… Single-use verification tokens (prevents CAPTCHA farming)
  • βœ… Trust tier system with behavioral analysis
  • βœ… Session protection with User-Agent binding
  • βœ… 7 CAPTCHA types (JavaScript-free, Tor-compatible)
  • βœ… Automatic quota clearing after verification

In Development:

  • πŸ”„ TUI deployment wizard (40% complete)
  • ⏳ Mirror management automation (Phase 4)
  • ⏳ Auto-scaling system (Phase 4)
  • ⏳ Cluster support (Phase 5)

View detailed progress β†’


πŸš€ Quick Start

Installation

# 1. Update system and install build dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y git build-essential pkg-config libssl-dev

# 2. Clone the repository
git clone https://github.com/Nespartious/Fortify.git
cd Fortify/fortify

# 3. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env

# 4. Build the project
cargo build --release

# 5. Run the TUI
./target/release/fortify

Deployment via TUI

Fortify uses an interactive TUI (Terminal User Interface) for deployment and management.

# Launch the Fortify TUI
./target/release/fortify

The TUI provides:

  • Deployment Wizard - Step-by-step setup for new deployments
  • Live Status Monitoring - Real-time component health and metrics
  • Configuration Management - Hot-reload settings without restart
  • Log Streaming - Multi-component log aggregation
  • Mirror Management - View and manage .onion addresses

Navigation:

  • Arrow keys to navigate
  • Enter to select
  • Tab to switch panels
  • Esc to go back
  • 'q' to quit

Headless Deployment (Scripted)

For automated/headless server deployments without interactive TUI.

Fortify includes a comprehensive deployment script that configures everything from a single file. Perfect for:

  • Automated server provisioning
  • Infrastructure-as-code setups
  • Headless server environments
  • Reproducible deployments
# 1. Clone the repository
git clone https://github.com/Nespartious/Fortify.git
cd Fortify

# 2. Edit the deployment script configuration
#    Open deploy.sh and modify the settings at the top of the file.
#    Each setting has comments explaining what it does.
nano deploy.sh

# 3. Review your configuration
#    Make sure BACKEND_ADDRESS points to your real service
#    Adjust CAPTCHA, mirror, and security settings as needed

# 4. Run the deployment (requires root)
sudo ./deploy.sh

The script will:

  • βœ… Install all system dependencies (Tor, Rust, build tools)
  • βœ… Apply OS hardening (sysctl, file limits)
  • βœ… Build Fortify from source
  • βœ… Generate configuration from your settings
  • βœ… Install and enable systemd services
  • βœ… Start all components

Key Configuration Sections in deploy.sh:

Section Description
Backend Settings Your protected service address and branding
Mirror Settings Number of mirrors and rotation behavior
Vanity Settings Custom .onion address prefixes
CAPTCHA Settings Pool size, difficulty, timeouts
Rate Limiting Request limits and ban thresholds
Vanguards Tor circuit protection settings
Auto-Scaling Dynamic resource allocation

Manual Component Control (Development Only)

For development/debugging, individual components can be run:

# Controller (resource monitoring)
./target/release/fortify-controller

# Orchestrator (mirror management)
SECRET_KEY="your-secret" ./target/release/fortify-orchestrator

# Gate (CAPTCHA verification)
SECRET_KEY="your-secret" ./target/release/fortify-gate

# HTTP Proxy (main traffic handler)
SECRET_KEY="your-secret" ./target/release/fortify-http

# Nodes (backend services)
NODE_MODE="healthy" ./target/release/fortify-node
NODE_MODE="threat" ./target/release/fortify-node

⚠️ Note: Manual deployment is complex and error-prone. Use the TUI for reliable deployment.

Requirements:

  • Rust: 1.88 or higher (MSRV)
  • Tor: Latest stable version
  • OS: Linux (tested on Ubuntu 22.04/24.04)
  • CPU: 4 cores recommended (2 cores minimum)
  • RAM: 4GB minimum (includes ~1GB OS overhead for Ubuntu Server)
  • Disk: 2GB for binaries + logs + OS

πŸ“Š How It Works

Basic User Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    NEW USER JOURNEY                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  User β†’ Mirror.onion                                            β”‚
β”‚    β”‚                                                             β”‚
β”‚    β”œβ”€ No token? β†’ Redirect to CAPTCHA                           β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  Gate CAPTCHA Challenge                                         β”‚
β”‚    β”‚                                                             β”‚
β”‚    β”œβ”€ SOLVED ──────────────┐                                    β”‚
β”‚    β”‚                        β”‚                                    β”‚
β”‚    β–Ό                        β–Ό                                    β”‚
β”‚  Verification Token    [FAILED β†’ Try Again]                     β”‚
β”‚    (60s, single-use)                                            β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  First Request β†’ Upgrade to Session Token                       β”‚
β”‚    β”‚              (24hr, reusable)                               β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  βœ“ Access Real Site (Verified tier: 100 req/10s)               β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Attack Defense Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DDOS ATTACK SCENARIO                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  Attack Bot #1 ──┐                                              β”‚
β”‚  Attack Bot #2 ───                                              β”‚
β”‚  Attack Bot #3 ──┼─► Mirror.onion                               β”‚
β”‚  Attack Bot #N β”€β”€β”˜    β”‚                                         β”‚
β”‚                       β”‚                                          β”‚
β”‚                       β–Ό                                          β”‚
β”‚                  Rate Limiter (per-circuit)                      β”‚
β”‚                       β”‚                                          β”‚
β”‚                       β”œβ”€ Bot #1: 10 req/10s β†’ BLOCKED ❌        β”‚
β”‚                       β”œβ”€ Bot #2: 10 req/10s β†’ BLOCKED ❌        β”‚
β”‚                       β”œβ”€ Bot #3: 10 req/10s β†’ BLOCKED ❌        β”‚
β”‚                       └─ Each bot isolated, can't exhaust quota β”‚
β”‚                                                                  β”‚
β”‚  Real User ─────────────────────────────────┐                   β”‚
β”‚                                             β”‚                   β”‚
β”‚                                             β–Ό                   β”‚
β”‚                                        Rate Limiter              β”‚
β”‚                                             β”‚                   β”‚
β”‚                                             β”œβ”€ Independent quotaβ”‚
β”‚                                             β”œβ”€ 3 requests β†’ βœ“  β”‚
β”‚                                             β”‚                   β”‚
β”‚                                             β–Ό                   β”‚
β”‚                                        CAPTCHA Challenge        β”‚
β”‚                                             β”‚                   β”‚
β”‚                                             β”œβ”€ Solved β†’ βœ“      β”‚
β”‚                                             β”‚                   β”‚
β”‚                                             β–Ό                   β”‚
β”‚                                        Access Site βœ“            β”‚
β”‚                                                                  β”‚
β”‚  Result: Bots blocked, real users unaffected                    β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Demotion & Re-verification Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                BEHAVIORAL VIOLATION FLOW                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  Verified User β†’ Suspicious Behavior Detected                   β”‚
β”‚    β”‚              (path scanning, bot UA, etc.)                 β”‚
β”‚    β”‚                                                             β”‚
β”‚    β”œβ”€ Violation Count: 1 ──► Warning logged                     β”‚
β”‚    β”œβ”€ Violation Count: 2 ──► Warning logged                     β”‚
β”‚    β”œβ”€ Violation Count: 3 ──► DEMOTE to Suspicious ⚠️           β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  Redirect to Gate                                               β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  Re-verification Challenge (2x CAPTCHAs)                        β”‚
β”‚    β”‚                                                             β”‚
β”‚    β”œβ”€ Both Solved ──────┐                                       β”‚
β”‚    β”‚                     β”‚                                       β”‚
β”‚    β–Ό                     β–Ό                                       β”‚
β”‚  Re-issue Token     [FAILED β†’ BURNED πŸ”₯]                        β”‚
β”‚    β”‚                  (permanent ban)                            β”‚
β”‚    β”‚                                                             β”‚
β”‚    β–Ό                                                             β”‚
β”‚  βœ“ Return to Site (Verified tier restored)                     β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        FORTIFY LAYERS                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  EXTERNAL (Untrusted)                                       β”‚    β”‚
β”‚  β”‚  β€’ Tor Network                                              β”‚    β”‚
β”‚  β”‚  β€’ Mirror Onion Addresses                                   β”‚    β”‚
β”‚  β”‚  β€’ User Connections                                         β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                         β”‚                                            β”‚
β”‚                         β–Ό                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  BOUNDARY LAYER                                             β”‚    β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚
β”‚  β”‚  β”‚   HTTP PROXY     β”‚  β”‚    GATE    β”‚  β”‚  BEHAVIORAL β”‚    β”‚    β”‚
β”‚  β”‚  β”‚ Token Validation β”‚  β”‚  CAPTCHA   β”‚  β”‚  ANALYSIS   β”‚    β”‚    β”‚
β”‚  β”‚  β”‚ Rate Limiting    β”‚  β”‚ Verificationβ”‚  β”‚  Detection  β”‚    β”‚    β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                         β”‚                                            β”‚
β”‚                         β–Ό                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  INTERNAL (Trusted)                                         β”‚    β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚    β”‚
β”‚  β”‚  β”‚  CONTROLLER  β”‚  β”‚ ORCHESTRATOR β”‚  β”‚    NODES     β”‚     β”‚    β”‚
β”‚  β”‚  β”‚   Service    β”‚  β”‚    Mirror    β”‚  β”‚ Healthy/     β”‚     β”‚    β”‚
β”‚  β”‚  β”‚  Management  β”‚  β”‚  Management  β”‚  β”‚   Threat     β”‚     β”‚    β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                         β”‚                                            β”‚
β”‚                         β–Ό                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  PROTECTED (Your Service)                                   β”‚    β”‚
β”‚  β”‚  β€’ Real Hidden Service                                      β”‚    β”‚
β”‚  β”‚  β€’ Backend Application                                      β”‚    β”‚
β”‚  β”‚  β€’ Real Onion Address                                       β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components:

  • Controller: Service lifecycle management, health monitoring
  • Orchestrator: Mirror creation and rotation
  • HTTP Proxy: Request routing, token validation, rate limiting
  • Gate: CAPTCHA challenges and verification
  • Nodes: Backend proxying with behavioral analysis

πŸ” Security Features

Trust Tier System

Tier Access Rate Limit How to Achieve
Trusted βœ… Yes 120 req/min Consistent good behavior
Verified βœ… Yes 60 req/min Solve CAPTCHA
Stranger ❌ No 30 req/min New visitor (requires CAPTCHA)
Suspicious ⚠️ Limited 10 req/min Failed verification or rate limited
Hostile ❌ Never Banned Multiple violations

Behavioral Analysis

Detected Violations:

  • Path traversal attempts (../, /.env)
  • Bot User-Agents (curl, wget, python-requests)
  • Path enumeration (sequential scanning)
  • Resource enumeration (rapid unique paths)
  • Form submission floods
  • Attack path access (admin panels, config files)

Severity Levels:

  • Level 3: Attack path access, automated behavior
  • Level 2: Bot UA, enumeration, form floods
  • Level 1: Suspicious referer, payload anomalies

CAPTCHA System

7 JavaScript-Free Types:

  1. BmpText: Traditional text image
  2. Emoji: Select matching emoji
  3. Direction: Click correct arrow
  4. Sequence: Complete the pattern
  5. WordUnscramble: Unscramble letters
  6. ImageRotation: Select upright image
  7. Silhouette: Identify silhouette

Features:

  • No JavaScript required (Tor Browser "Safest" mode compatible)
  • Single-use verification tokens (60s lifetime)
  • User-Agent binding (prevents token sharing)
  • Atomic check-and-mark (prevents race conditions)

πŸ“ˆ Performance

Defense Capabilities:

  • Per-circuit isolation prevents quota exhaustion
  • Independent quotas for each Tor circuit
  • CAPTCHA paths always accessible (no rate limit)
  • Attack traffic blocked at circuit level
  • Zero impact on legitimate users during attacks

Traffic Tiers:

Fortify auto-scales based on your expected traffic. RAM includes ~1GB OS overhead for Ubuntu Server:

Tier Daily Users CPU RAM (Total) Disk
Micro ~100 1-2 cores 2GB 1GB
Small ~1,000 2-4 cores 2-3GB 2GB
Medium ~10,000 2-4 cores 3-4GB 3GB
Large ~100,000 4-8 cores 5-8GB 6GB
Enterprise ~1M+ 4-8 cores 8-16GB 10GB+

Note: Enterprise tier is optimized for Tor network constraints. Tor hidden services have natural throughput limits.


πŸ“š Documentation

Core Documentation:

Specialized Guides:

Research:


πŸ› οΈ Development

Project Structure

fortify/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ fortify-core/       # Shared types, trust system, behavioral analysis
β”‚   β”œβ”€β”€ fortify-controller/ # Service lifecycle management
β”‚   β”œβ”€β”€ fortify-orchestrator/ # Mirror management
β”‚   β”œβ”€β”€ fortify-http/       # HTTP proxy, rate limiting, routing
β”‚   β”œβ”€β”€ fortify-gate/       # CAPTCHA verification
β”‚   β”œβ”€β”€ fortify-node/       # Backend proxy nodes
β”‚   β”œβ”€β”€ fortify-community/  # Community network (Phase 7)
β”‚   └── fortify-tui/        # Deployment TUI (40% complete)
β”œβ”€β”€ config/                 # Example configurations
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ install/                # Installation scripts
β”œβ”€β”€ scripts/                # Utility scripts
└── tests/                  # Integration tests

Build Commands

# Development build
cargo build

# Release build (optimized)
cargo build --release

# Run tests
cargo test

# Run specific crate
cargo run -p fortify-controller

# Build documentation
cargo doc --no-deps --open

🎯 Roadmap

Phase 4: Resilience & Recovery (0%)

  • Mirror discovery bar and retirement system
  • Auto-scaling based on resource usage
  • Session behavioral analysis enhancements
  • Hot-reload with session juggling (stagger changes across nodes to maintain uptime)
  • Cleanup automation

Phase 5: Cluster System (0%)

  • Multi-VPS coordination
  • Distributed mirror management
  • Cross-cluster session sharing
  • Cluster-wide health monitoring

Phase 6: Deployment TUI (50%)

  • βœ… Core framework and configuration system
  • βœ… Deployment wizard (7 steps)
  • βœ… Live log streaming
  • βœ… Traffic tier auto-scaling
  • ⏳ Controller integration
  • ⏳ Full settings hot-reload

Phase 7: Community Network (0%)

  • P2P mirror discovery
  • Community node registration
  • Trust verification system
  • Reputation tracking

Phase 8: Advanced Capabilities (0%)

  • Machine learning threat detection
  • Predictive scaling algorithms
  • Advanced behavioral analysis
  • Traffic pattern recognition

View detailed roadmap β†’


🀝 Contributing

Fortify is currently in Alpha development. Contributions are welcome!

Areas needing help:

  • Testing and bug reports
  • Documentation improvements
  • CAPTCHA type implementations
  • Performance optimizations

Before contributing:

  1. Read the Security Audit
  2. Review the Alpha Review
  3. Check existing issues and PRs

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


⚠️ Disclaimer

Fortify is provided as-is for educational and defensive purposes. The authors are not responsible for misuse. Always comply with applicable laws when deploying hidden services.


πŸ™ Acknowledgments

  • Built with Rust πŸ¦€
  • Tor Project for the anonymity network
  • The security research community

Built by Nespartious | GitHub | Alpha Release

Protecting hidden services, one CAPTCHA at a time. 🏰

Releases

Packages

Used by

Contributors

Languages