Skip to content

Commit 7d6821d

Browse files
authored
Updated OPSEC and added more C2 support (#6)
1 parent a2dfa76 commit 7d6821d

37 files changed

Lines changed: 2741 additions & 87 deletions

.env.example

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ INFRAGUARD_MYTHIC_UPSTREAM=https://10.0.0.6:443
4040
INFRAGUARD_BRC4_UPSTREAM=https://10.0.0.7:8443
4141
INFRAGUARD_SLIVER_UPSTREAM=https://10.0.0.8:31337
4242
INFRAGUARD_HAVOC_UPSTREAM=https://10.0.0.9:40056
43+
INFRAGUARD_NIGHTHAWK_UPSTREAM=https://10.0.0.10:443
44+
INFRAGUARD_POSHC2_UPSTREAM=https://10.0.0.11:4443
4345

4446
# ── GeoIP ─────────────────────────────────────────────────────────────
4547
# Paths to MaxMind GeoLite2 databases (all optional).
@@ -97,6 +99,35 @@ INFRAGUARD_BANNED_IP_FILE=/app/rules/banned_ips.txt
9799
# Docker internal URL: http://pwndrop:80
98100
PWNDROP_TOKEN=
99101

102+
# ── Content Delivery (Mythic file staging) ────────────────────────────
103+
# Used with backend type: mythic_file in content_routes.
104+
# MYTHIC_URL: base URL of the Mythic teamserver (default port 7443).
105+
# MYTHIC_STAGE2_FILE_ID: UUID of the file in Mythic's file store.
106+
# Find it in Mythic UI → Payload Management → File Browser, or via:
107+
# mythic-cli shell -> psql -> SELECT agent_file_id FROM filemeta;
108+
# Multiple stages: add one var per payload (MYTHIC_STAGE3_FILE_ID, etc.)
109+
MYTHIC_URL=https://10.0.0.6:7443
110+
MYTHIC_STAGE2_FILE_ID=
111+
112+
# ── Phishing Campaign Tokens ──────────────────────────────────────────
113+
# Static tokens embedded in phishing email links (?t=<value>).
114+
# Analysts who find the URL via CT logs / threat feeds cannot load the
115+
# page without the campaign token from the actual email.
116+
# Generate: python3 -c "import secrets; print(secrets.token_urlsafe(32))"
117+
CAMPAIGN_TOKEN_Q1=
118+
CAMPAIGN_TOKEN_Q2=
119+
120+
# HMAC-signed token alternative (mutually exclusive with static tokens).
121+
# Tokens are self-validating: payload:timestamp:hmac_hex (7-day TTL).
122+
# Generate secret: python3 -c "import secrets; print(secrets.token_hex(32))"
123+
CAMPAIGN_HMAC_SECRET=
124+
125+
# ── Burn Detection / Reputation Monitor ───────────────────────────────
126+
# Google Safe Browsing API key (optional — free tier, 10k queries/day).
127+
# Required only if check_google_safebrowsing: true in config.yaml.
128+
# Get key: https://console.cloud.google.com → Safe Browsing API
129+
GOOGLE_SAFEBROWSING_API_KEY=
130+
100131
# ── SIEM Plugins ──────────────────────────────────────────────────────
101132
# Set these if you enable the corresponding plugin in config.yaml.
102133

config/config.yaml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# InfraGuard Docker Configuration
22
# Environment variables are loaded from .env automatically.
3+
# Full reference with all options: config/test-config-full.yaml
34

45
listeners:
56
- bind: "0.0.0.0"
@@ -65,13 +66,47 @@ domains:
6566
type: "decoy"
6667
target: "${IG_DECOY_SITE}"
6768
content_routes:
69+
# Mythic-hosted stage-2 payload at a clean URL.
70+
# Guard: beacon IP required + Windows UA + no proxy headers + single-use token.
71+
- path: "/jquery-3.7.1.min.js"
72+
backend:
73+
type: "mythic_file"
74+
target: "${MYTHIC_URL}" # e.g. https://10.0.0.5:7443
75+
file_id: "${MYTHIC_STAGE2_FILE_ID}"
76+
ssl_verify: false
77+
headers:
78+
Content-Disposition: "attachment; filename=\"jquery-3.7.1.min.js\""
79+
guard:
80+
require_beacon_ip: true
81+
allowed_user_agents:
82+
- "^Mozilla/5\\.0 \\(Windows NT"
83+
- "WinHTTP"
84+
forbidden_headers:
85+
- "Via"
86+
- "X-Forwarded-For"
87+
require_token: true
88+
rate_limit:
89+
enabled: true
90+
max_downloads: 1
91+
window_seconds: 3600
92+
conditional:
93+
score_threshold: 0.5
94+
scanner_backend:
95+
type: "http_proxy"
96+
target: "https://jquery.com"
97+
track: true
98+
# PwnDrop payload delivery (rate-limited, scanner-aware)
6899
- path: "/downloads/*"
69100
backend:
70101
type: "pwndrop"
71-
target: "http://pwndrop:80" # Docker internal URL
102+
target: "http://pwndrop:80"
72103
auth_token: "${PWNDROP_TOKEN}"
104+
rate_limit:
105+
enabled: true
106+
max_downloads: 3
107+
window_seconds: 300
73108
conditional:
74-
score_threshold: 0.5 # bots/scanners get decoy instead
109+
score_threshold: 0.5
75110
scanner_backend:
76111
type: "http_proxy"
77112
target: "https://jquery.com"
@@ -89,22 +124,53 @@ intel:
89124
geoip_country_db: "${INFRAGUARD_GEOIP_COUNTRY_DB}"
90125
banned_ip_file: "${INFRAGUARD_BANNED_IP_FILE}"
91126
rules_dir: "${INFRAGUARD_RULES_DIR}" # auto-ingest .htaccess / robots.txt on startup
127+
dns_enum_nxdomain_threshold: 15
128+
dns_enum_window_seconds: 30
92129
feeds:
93130
enabled: true
131+
ct_monitor:
132+
enabled: false # set true + add domains to enable CT log alerting
133+
interval_hours: 6.0
134+
monitored_domains: [] # empty = auto-populate from domain keys above
135+
reputation_monitor:
136+
enabled: false # set true to check URLhaus / OpenPhish on schedule
137+
interval_hours: 4.0
138+
check_urlhaus: true
139+
check_openphish: true
94140

95141
tracking:
96142
db_path: "${INFRAGUARD_DB_PATH}"
97143

98144
pipeline:
99145
filter_mode: "${INFRAGUARD_FILTER_MODE}" # "scoring" or "hard"
100146
block_score_threshold: 0.7
147+
replay_window_seconds: 86400
148+
replay_persist: true
149+
enable_enumeration_filter: true
150+
enumeration_unique_path_threshold: 20
151+
enumeration_unique_path_suspect_threshold: 8
152+
enumeration_window_seconds: 60
153+
enable_sandbox_filter: true
154+
enable_ja3_filter: true
155+
ja3_filter:
156+
log_ja3: true
157+
block_unknown: false
158+
ja3_header: "x-ja3" # set by nginx ssl_fingerprint / HAProxy JA3
101159

102160
api:
103161
bind: "0.0.0.0"
104162
port: 8080
105163
auth_token: "${INFRAGUARD_API_TOKEN}"
106164
health_path: "/${INFRAGUARD_HEALTH_PATH}"
107165

166+
payload_tokens:
167+
enabled: false # set true to gate content routes behind one-time tokens
168+
default_ttl_seconds: 3600
169+
default_max_uses: 1
170+
token_header: "X-DL-Token"
171+
token_param: "_t"
172+
issuance_header: "X-Payload-Token"
173+
108174
decoy_pages_dir: "${IG_DECOY_PAGES_DIR}" # base directory for decoy SPA sites
109175

110176
logging:

0 commit comments

Comments
 (0)