
InfraGuard는 레드팀 인프라를 위협 귀속으로부터 보호하는 Command & Control 리다이렉션 프록시 및 관리자입니다.
레드 팀 인프라 트래커 및 C2 리다이렉터 -- RedWarden의 현대적인 대안입니다.
InfraGuard는 인터넷과 C2 팀서버 사이에 위치하여, 모든 인바운드 요청을 malleable C2 프로필에 대해 검증하고 규칙에 맞지 않는 모든 것을 차단합니다. 스캐너, 봇, 블루 팀 프로브는 데코이 사이트로 리다이렉트되는 반면, 합법적인 비콘 트래픽은 팀서버로 통과합니다.


mythic_file 백엔드가 Mythic의 /direct/download/{uuid}를 깔끔한 URL로 프록시합니다. 고정 UUID 또는 프록시 모드; 접근 제어는 InfraGuard의 필터 스택이 제공합니다/metrics 엔드포인트on_event 훅, 플러그인별 구성, 이벤트 필터링을 갖춘 이벤트 중심 아키텍처.env 파일 지원.htaccess 및 robots.txt 파일에서 IP 블록리스트와 User-Agent 패턴 가져오기.env 파일 자동 로드; ${VAR} 구문이 모든 구성 값과 키에서 작동설치 방법은 Wiki 페이지를 확인하세요
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
### 생성기 옵션
`generate` 명령은 운영자 맞춤 설정을 위한 추가 플래그를 지원합니다:
| 플래그 | 설명 |
|---|---|
| `--listen-port PORT` | 수신 포트 재정의 (기본값: 구성 파일 기준) |
| `--ssl-cert PATH` | SSL 인증서 경로 재정의 |
| `--ssl-key PATH` | SSL 키 경로 재정의 |
| `--redirect-url URL` | 차단된 요청에 대한 리디렉션 URL 재정의 |
| `--default-action redirect\|404` | 일치하지 않는 요청에 대한 동작 |
| `--no-ip-filter` | IP 허용/거부 블록 생략 |
| `--no-header-check` | 헤더 검증 규칙 생략 |
| `--alias DOMAIN:ALIAS` | 서버 이름 별칭 추가 (반복 가능) |
| `--header NAME:VALUE` | 사용자 정의 응답 헤더 추가 (반복 가능) |
## Command Post (다중 인스턴스 대시보드)
여러 VPS 또는 클라우드 제공업체에서 여러 InfraGuard 인스턴스를 실행할 때, Command Post는 모든 노드의 통계, 요청 및 실시간 이벤트를 단일 대시보드로 집계합니다.```
┌─────────────────────────────┐
│ 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
### Configuration
`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
이 두 서비스를 시작합니다:
- **proxy** -- 포트 443과 80에서 동작하는 리다이렉터
- **dashboard** -- 포트 8080에서 동작하는 웹 UI
### 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
Requirements for Let's Encrypt:
INFRAGUARD_DOMAIN must resolve to this host's public IPINFRAGUARD_DOMAIN_EMAIL must be a valid email addressdocker compose --profile geoip up geoip-update
docker compose up -d proxy dashboard
### PwnDrop(페이로드 전달) 사용 시```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
그런 다음 구성 파일에서 콘텐츠 라우트를 설정하여 페이로드 경로를 PwnDrop으로 프록시하세요:```yaml domains: cdn.example.com: content_routes: - path: "/downloads/*" backend: type: "pwndrop" target: "http://pwndrop:80" auth_token: "${PWNDROP_TOKEN}"
### Ollama 사용 (AI 지원 프로필 생성)```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
대시보드 환경 변수 INFRAGUARD_OLLAMA_URL은 docker-compose.yml에 미리 구성되어 있습니다. Ollama가 실행 중이면 대시보드의 디코이 및 프로필 페이지에 AI 어시스턴트 토글이 표시됩니다.
docker compose up -d --scale proxy-node=3
`docker-compose.yml`에서 `proxy-node` 서비스를 주석 해제하여 활성화하세요.
### 볼륨
| 볼륨 | 용도 |
|---|---|
| `./config` | 구성 파일 (읽기 전용으로 마운트됨) |
| `./examples` | C2 프로필 (읽기 전용으로 마운트됨) |
| `./rules` | 수집된 차단 목록 및 규칙 소스 파일 (읽기 전용으로 마운트됨) |
| `./data` | SQLite 데이터베이스 및 생성된 프로필 (영구 저장됨) |
| `certs` | TLS 인증서 (프록시와 certbot 간 공유) |
| `geoip` | GeoLite2 데이터베이스 (`geoip-update` 서비스로 채워짐) |
| `pwndrop-data` | PwnDrop 업로드 파일 및 데이터베이스 |
| `ollama-data` | Ollama 모델 가중치 및 구성 |
## 아키텍처```
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
프로젝트에 기여하고 싶다면 버전 이름으로 새 브랜치를 만들고 풀 리퀘스트에 동일한 버전 이름을 지정하세요. 예: branch=v1.2.3 | [v1.2.3] 항목 추가됨.
BSD 2-Clause License. 자세한 내용은 LICENSE를 참조하세요.
Copyright (c) 2026, Whispergate
| 엔드포인트 | 메서드 | 설명 |
|---|
/api/instances | GET | 상태 정보를 포함한 모든 인스턴스 목록 |
/api/stats | GET | 모든 인스턴스에서 병합된 통계 |
/api/requests | GET | 모든 인스턴스의 인터리브된 요청 로그 |
/api/intel/whitelist | POST | 모든 인스턴스에서 IP를 허용 목록에 추가 |
/api/intel/blocklist | POST | 모든 인스턴스에서 IP를 차단 목록에 추가 |
/api/intel/blocklist | DELETE | 모든 인스턴스에서 IP 차단 해제 |
/ws/events | WS | 모든 인스턴스의 멀티플렉싱된 실시간 이벤트 |
| 기능 | RedWarden | InfraGuard |
|---|
| 아키텍처 | 단일 ~99KB 파일 | 모듈형 패키지 |
| 프로필 파싱 | 정규식 상태 머신 | 전체 블록/변환 지원이 포함된 구조화된 파서 |
| C2 지원 | Cobalt Strike만 지원 | Cobalt Strike, Mythic, Brute Ratel C4, Sliver, Havoc, Nighthawk, PoshC2 |
| 프로필 관리 | 수동 파일 편집 | 생성, 가져오기, 핫스왑, AI 지원이 포함된 대시보드 마법사 |
| 프로토콜 | HTTP만 지원 | HTTP, DNS, MQTT, WebSocket |
| 필터 모델 | 이진 통과/실패 | 점수 기반(0.0~1.0 임계값), 10단계 필터 체인 |
| TLS 핑거프린팅 | 없음 | JA3 차단(Masscan, ZGrab2, Shodan, curl, Python requests, Nmap) |
| 샌드박스 탐지 | 없음 | 헤드리스 브라우저 / Safe Links / 샌드박스 UA 및 헤더 점수화 |
| 열거 탐지 | 없음 | 경로 열거 + DNS NXDOMAIN 추적 및 자동 차단 |
| 번인 탐지 | 없음 | CT 로그 모니터링, 도메인 평판, 교차 도메인 분석가 탐지, 신뢰도 점수화 |
| 인프라 복원력 | 없음 | 회로 차단기, 프로토콜 장애 조치, 데드맨 스위치, 인프라 로테이션 |
| 페이로드 전달 | 없음 | PwnDrop, Mythic 파일 저장소, 파일시스템, 조건부 전달이 포함된 HTTP 프록시 |
| 페이로드 보호 | 없음 | 일회용 토큰, 경로별 속도 제한, 전달 가드 |
| 피싱 방지 | 없음 | 캠페인 토큰 검증(정적 목록 또는 HMAC 서명) |
| 운영자 UI | 없음 | 웹 대시보드 + 터미널 UI + 다중 인스턴스 Command Post |
| 관측 가능성 | 없음 | Prometheus 메트릭, 참여 보고서, 구조화된 로깅 |
| 구성 생성 | 없음 | Nginx, Caddy, Apache 전체 사용자 지정 지원 |
| 규칙 수집 | 없음 | .htaccess + robots.txt 파서 |
| 위협 인텔리전스 피드 | 없음 | 5개 공개 소스에서 자동 업데이트 |
| 플러그인 시스템 | 기본 4-메서드 인터페이스 | on_event 훅 + 플러그인별 구성이 포함된 이벤트 기반 |
| SIEM 통합 | 없음 | Elasticsearch, Wazuh, Syslog(CEF/JSON) |
| 웹훅 알림 | 없음 | Discord, Slack, 일반 웹훅 |
| 화이트리스트 인텔리전스 | 없음 | 시작 시 CIDR을 ASN/조직/국가로 자동 강화 |
| 안티-리플레이 | SQLite 해시 | 인메모리 L1 캐시가 포함된 영구 SQLite, 재시작 후에도 유지 |
| 드롭 액션 | redirect, reset, proxy | redirect, reset, proxy, tarpit |
| TLS 관리 | 수동만 가능 | 자동 자체 서명 + Let's Encrypt 통합 |
| 엣지 배포 | 없음 | 도메인 프론팅이 포함된 Cloudflare Worker + AWS Lambda 엣지 프록시 |
| 구성 보안 | 없음 | age 및 SOPS 암호화, 검증 검사, API 키 관리 |
| 배포 | 수동 | 상태 확인이 포함된 Docker Compose |
| 비동기 | Tornado 콜백 | 네이티브 async/await(ASGI + uvicorn) |