Skip to content

817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platforms · 29 security domains · Apache 2.0

2.1 KB
Raw Blame

C2 Redirector — Directives & Tooling Reference

nginx reverse-proxy directives

Directive Purpose
location ~ ^/regex Match profile C2 URIs
proxy_pass https://TEAMSERVER; Forward matched traffic to team server
proxy_ssl_verify off; Skip cert verification to backend
proxy_set_header Host $host; Preserve Host header
if ($http_user_agent != "...") { return 302 ...; } UA validation
return 302 https://DECOY/; Divert non-C2 to a benign site

Apache mod_rewrite directives

Directive Purpose
RewriteEngine On Enable rewriting
SSLProxyEngine On Allow HTTPS proxying
RewriteCond %{HTTP_USER_AGENT} "..." Match implant User-Agent
RewriteCond %{REQUEST_URI} ^/c2/path Match profile URIs
RewriteRule ^.*$ https://TEAMSERVER%{REQUEST_URI} [P,L] Proxy match to backend
RewriteRule ^.*$ https://DECOY/ [R=302,L] Redirect non-match to decoy

Required modules: rewrite proxy proxy_http ssl headers (a2enmod).

cs2modrewrite invocation

# Apache rules from a Cobalt Strike profile
python3 cs2modrewrite.py -i PROFILE.profile -c https://TEAMSERVER \
  -r https://DECOY -o redirect.rules

# nginx config
python3 cs2nginx.py -i PROFILE.profile -c https://TEAMSERVER \
  -r https://DECOY -H your.domain > c2.conf
Flag Meaning
-i Input Cobalt Strike malleable profile
-c C2 team server URL (proxy target)
-r Redirect URL for non-matching requests
-o Output rules file (Apache)
-H Hostname (nginx)

Dumb-pipe forwarders

socat TCP4-LISTEN:443,fork,reuseaddr TCP4:TEAMSERVER:443
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination TEAMSERVER:443

TLS (certbot)

certbot --nginx -d your.domain --agree-tos -m ops@you --redirect
certbot renew --dry-run

External References