
InfraGuard ist ein Command & Control-Umleitungsproxy und -Manager, der Ihre Red-Team-Infrastruktur vor Attribution schützt.
Red-Team-Infrastruktur-Tracker und C2-Redirector -- eine moderne Alternative zu RedWarden.
InfraGuard sitzt zwischen dem Internet und deinem C2-Teamserver und validiert jede eingehende Anfrage gegen dein malleable C2-Profil. Alles, was nicht konform ist, wird blockiert. Scanner, Bots und Blue-Team-Sonden werden zu einer Köder-Website umgeleitet, während legitimer Beacon-Traffic zu deinem Teamserver durchgelassen wird.


mythic_file-Backend leitet Mythics /direct/download/{uuid} unter sauberen URLs weiter; fester UUID- oder Proxy-Modus; Zugriffskontrolle durch InfraGuards Filter-Stack/metrics-Endpoint, der Anfragezähler, Upstream-Latenz-Histogramme, Circuit-Breaker-Status, Feed-Aktualität und aktive Verbindungen bereitstellton_event-Hooks, Konfiguration pro Plugin und Event-Filterung.env-Dateien.htaccess- und robots.txt-Dateien importieren.env-Datei wird automatisch geladen; ${VAR}-Syntax funktioniert in allen Konfigurationswerten und SchlüsselnSchau dir die Wiki-Seite für die Installation an
infraguard --version Show version infraguard --help Show help
infraguard run -c config.yaml Start the reverse proxy infraguard run -c config.yaml --port 8443 Override listen port infraguard run -c config.yaml --host 0.0.0.0 Override bind address
infraguard dashboard -c config.yaml Start the web dashboard infraguard dashboard -c config.yaml --port 9090 Override dashboard port
infraguard tui Launch TUI with login screen infraguard tui --url http://host:8080 --token TOK Auto-connect to dashboard infraguard tui -c config.yaml Read URL/token from config
infraguard command-post -c command-post.yaml Start multi-instance dashboard infraguard command-post --instance name:url:token Add instance via CLI (repeatable)
infraguard profile parse Parse and display a C2 profile infraguard profile parse --format json Output as JSON infraguard profile parse --type brute_ratel Force profile type infraguard profile convert -o out.json Convert profile to JSON
infraguard ingest <files...> Ingest .htaccess/robots.txt rules infraguard ingest <files...> --format blocklist Output as IP blocklist infraguard ingest <files...> --format json Output as JSON infraguard ingest <files...> -o banned_ips.txt Write blocklist to file
infraguard generate nginx -c config.yaml Generate Nginx config infraguard generate caddy -c config.yaml Generate Caddyfile infraguard generate apache -c config.yaml Generate Apache VirtualHost
infraguard init -o config.yaml Generate starter config infraguard validate -c config.yaml Validate config file
### Generator-Optionen
Der Befehl `generate` akzeptiert zusätzliche Flags für die Operator-Anpassung:
| Flag | Beschreibung |
|---|---|
| `--listen-port PORT` | Abhör-Port überschreiben (Standard: aus Konfiguration) |
| `--ssl-cert PATH` | SSL-Zertifikatspfad überschreiben |
| `--ssl-key PATH` | SSL-Schlüsselpfad überschreiben |
| `--redirect-url URL` | Weiterleitungs-URL für blockierte Anfragen überschreiben |
| `--default-action redirect\|404` | Aktion für nicht passende Anfragen |
| `--no-ip-filter` | IP-Erlaubnis-/Sperrblöcke weglassen |
| `--no-header-check` | Header-Validierungsregeln weglassen |
| `--alias DOMAIN:ALIAS` | Servernamens-Alias hinzufügen (wiederholbar) |
| `--header NAME:VALUE` | Benutzerdefinierten Antwort-Header hinzufügen (wiederholbar) |
## Command Post (Multi-Instanz-Dashboard)
Wenn mehrere InfraGuard-Instanzen auf verschiedenen VPSen oder Cloud-Anbietern ausgeführt werden, bündelt der Command Post Statistiken, Anfragen und Live-Ereignisse aller Knoten in einem einzigen Dashboard.```
┌─────────────────────────────┐
│ Command Post Dashboard │
│ http://localhost:9090 │
└──────────┬──────────────────┘
│ parallel fetch
┌─────┼──────┬──────────┐
▼ ▼ ▼ ▼
IG-1 IG-2 IG-3 ... IG-N

infraguard command-post -c config/command-post.yaml
infraguard command-post
--instance "prod:https://ig1.example.com:8080:TOKEN1"
--instance "staging:https://ig2.example.com:8080:TOKEN2"
--port 9090
docker compose --profile command-post up -d command-post
### Konfiguration
Erstelle `config/command-post.yaml`:```yaml
instances:
- name: "prod-cs"
url: "https://ig1.example.com:8080"
token: "${IG_PROD_TOKEN}"
- name: "prod-mythic"
url: "https://ig2.example.com:8080"
token: "${IG_MYTHIC_TOKEN}"
- name: "staging"
url: "https://ig3.example.com:8080"
token: "${IG_STAGING_TOKEN}"
port: 9090
# auth_token: "${COMMAND_POST_TOKEN}"
cp .env.example .env
docker compose up -d
Dadurch werden zwei Dienste gestartet:
- **proxy** -- der Redirector auf den Ports 443 und 80
- **dashboard** -- das Web-UI auf Port 8080
### Mit Let's Encrypt```bash
# Set in .env:
# INFRAGUARD_LETSENCRYPT=true
# INFRAGUARD_DOMAIN=cdn.example.com
# [email protected]
# Obtain the initial certificate
docker compose --profile letsencrypt up certbot
# Start the proxy (will use the LE cert)
docker compose up -d proxy dashboard
# Start auto-renewal (checks every 12 hours)
docker compose --profile letsencrypt up -d certbot-renew
Anforderungen für Let's Encrypt:
INFRAGUARD_DOMAIN muss auf die öffentliche IP dieses Hosts verweisenINFRAGUARD_DOMAIN_EMAIL muss eine gültige E-Mail-Adresse seindocker compose --profile geoip up geoip-update
docker compose up -d proxy dashboard
### Mit PwnDrop (Payload-Zustellung)```bash
# Start PwnDrop alongside the proxy
docker compose --profile pwndrop up -d pwndrop
# Access PwnDrop admin UI at https://localhost:8443
# InfraGuard reaches it internally at http://pwndrop:80
Konfiguriere dann Inhaltsrouten in deiner Konfiguration, um Payload-Pfade an PwnDrop weiterzuleiten:```yaml domains: cdn.example.com: content_routes: - path: "/downloads/*" backend: type: "pwndrop" target: "http://pwndrop:80" auth_token: "${PWNDROP_TOKEN}"
### Mit Ollama (KI-gestützte Profilgenerierung)```bash
# Start the Ollama service
docker compose --profile ollama up -d ollama
# Pull the default model (~5 GB)
docker compose --profile ollama exec ollama ollama pull qwen3:8b
# The dashboard's AI chat panel will connect automatically
Die Umgebungsvariable INFRAGUARD_OLLAMA_URL des Dashboards ist in docker-compose.yml vorkonfiguriert. Wenn Ollama läuft, erscheint der KI-Assistent-Umschalter auf der Decoys- und Profile-Seite des Dashboards.
docker compose up -d --scale proxy-node=3
Entfernen Sie die Kommentierung des `proxy-node`-Dienstes in `docker-compose.yml`, um ihn zu aktivieren.
### Volumes
| Volume | Zweck |
|---|---|
| `./config` | Konfigurationsdateien (schreibgeschützt eingebunden) |
| `./examples` | C2-Profile (schreibgeschützt eingebunden) |
| `./rules` | Eingelesene Blocklisten und Regelquelldateien (schreibgeschützt eingebunden) |
| `./data` | SQLite-Datenbank und generierte Profile (dauerhaft gespeichert) |
| `certs` | TLS-Zertifikate (zwischen Proxy und Certbot geteilt) |
| `geoip` | GeoLite2-Datenbanken (vom Dienst `geoip-update` befüllt) |
| `pwndrop-data` | Über PwnDrop hochgeladene Dateien und Datenbank |
| `ollama-data` | Ollama-Modellgewichte und -Konfiguration |
## Architektur```
infraguard/
__init__.py Package init
__main__.py python -m infraguard entry
main.py Click CLI
config/ YAML config loading, .env support, Pydantic validation
core/ ASGI proxy engine (app, proxy, router, TLS, drop actions, content delivery)
profiles/ C2 profile parsers and generators (8 types)
pipeline/ Request validation filters (JA3, IP, bot, header, DNS, geo, profile, replay, enumeration, sandbox)
intel/ IP intelligence (blocklists, GeoIP, rDNS, feeds, rule ingestion)
tracking/ SQLite persistence (request logging, stats, node registry)
plugins/ Plugin system (protocol, loader, builtins)
ui/
api/ REST API + WebSocket (Starlette)
web/ SPA dashboard (HTML/JS/CSS)
tui/ Terminal UI (Textual) with login screen
command_post/ Multi-instance aggregation dashboard
listeners/ Protocol listeners (HTTP, DNS, MQTT, WebSocket)
backends/ Config generators (Nginx, Caddy, Apache)
models/ Shared types and event models
Wenn Sie zum Projekt beitragen möchten, erstellen Sie bitte einen neuen Branch mit dem Versionsnamen und geben Sie denselben Versionsnamen im Pull-Request an. z. B. branch=v1.2.3 | [v1.2.3] Added blah item.
BSD-2-Clause-Lizenz. Siehe LICENSE für Details.
Copyright (c) 2026, Whispergate
| Endpunkt | Methode | Beschreibung |
|---|
/api/instances | GET | Alle Instanzen mit Gesundheitsstatus auflisten |
/api/stats | GET | Zusammengeführte Statistiken aller Instanzen |
/api/requests | GET | Verschachteltes Anfrageprotokoll aller Instanzen |
/api/intel/whitelist | POST | Eine IP auf allen Instanzen auf die Whitelist setzen |
/api/intel/blocklist | POST | Eine IP auf allen Instanzen blockieren |
/api/intel/blocklist | DELETE | Eine IP auf allen Instanzen freigeben |
/ws/events | WS | Multiplexte Live-Ereignisse aller Instanzen |
| Funktion | RedWarden | InfraGuard |
|---|
| Architektur | Einzelne ~99-KB-Datei | Modulares Paket |
| Profil-Parsing | Regex-Zustandsmaschine | Strukturierter Parser mit vollständiger Block-/Transform-Unterstützung |
| C2-Unterstützung | Nur Cobalt Strike | Cobalt Strike, Mythic, Brute Ratel C4, Sliver, Havoc, Nighthawk, PoshC2 |
| Profilverwaltung | Manuelle Dateibearbeitung | Dashboard-Assistent mit Generieren, Importieren, Hot-Swap und KI-Unterstützung |
| Protokolle | Nur HTTP | HTTP, DNS, MQTT, WebSocket |
| Filtermodell | Binär bestanden/nicht bestanden | Bewertungsbasiert (Schwellenwert 0.0--1.0), 10-Filter-Kette |
| TLS-Fingerprinting | Keine | JA3-Blockierung (Masscan, ZGrab2, Shodan, curl, Python requests, Nmap) |
| Sandbox-Erkennung | Keine | Headless-Browser / Safe Links / Sandbox-UA- und Header-Bewertung |
| Enumeration-Erkennung | Keine | Pfadenumeration + DNS-NXDOMAIN-Verfolgung mit automatischer Blockierung |
| Burn-Erkennung | Keine | CT-Log-Überwachung, Domain-Reputation, domänenübergreifende Analystenerkennung, Konfidenzbewertung |
| Infrastruktur-Resilienz | Keine | Circuit Breaker, Protokoll-Failover, Dead-Man-Switch, Infrastruktur-Rotation |
| Payload-Zustellung | Keine | PwnDrop, Mythic-Dateispeicher, Dateisystem, HTTP-Proxy mit bedingter Zustellung |
| Payload-Schutz | Keine | Einmal-Tokens, Ratenbegrenzung pro Route, Zustellschutz |
| Phishing-Schutz | Keine | Validierung von Kampagnen-Tokens (statische Liste oder HMAC-signiert) |
| Operator-UI | Keine | Web-Dashboard + Terminal-UI + Multi-Instance-Command-Post |
| Beobachtbarkeit | Keine | Prometheus-Metriken, Engagement-Berichte, strukturierte Protokollierung |
| Konfigurationsgenerierung | Keine | Nginx, Caddy, Apache mit vollständiger Anpassung |
| Regel-Import | Keine | .htaccess- + robots.txt-Parser |
| Threat-Intel-Feeds | Keine | Automatische Aktualisierung aus 5 öffentlichen Quellen |
| Plugin-System | Einfache 4-Methoden-Schnittstelle | Ereignisgesteuert mit on_event-Hooks + Konfiguration pro Plugin |
| SIEM-Integration | Keine | Elasticsearch, Wazuh, Syslog (CEF/JSON) |
| Webhook-Benachrichtigungen | Keine | Discord, Slack, generischer Webhook |
| Whitelist-Intelligenz | Keine | Automatische Anreicherung von CIDRs mit ASN/Organisation/Land beim Start |
| Anti-Replay | SQLite-Hash | Persistente SQLite mit In-Memory-L1-Cache, übersteht Neustarts |
| Drop-Aktionen | redirect, reset, proxy | redirect, reset, proxy, tarpit |
| TLS-Verwaltung | Nur manuell | Automatisch selbstsigniert + Let's-Encrypt-Integration |
| Edge-Bereitstellung | Keine | Cloudflare Worker + AWS-Lambda-Edge-Proxys mit Domain-Fronting |
| Konfigurationssicherheit | Keine | age- und SOPS-Verschlüsselung, Validierungsprüfungen, API-Schlüsselverwaltung |
| Bereitstellung | Manuell | Docker Compose mit Health Checks |
| Async | Tornado-Callbacks | Natives async/await (ASGI + uvicorn) |