Communitygithub.com

Active Directory ACL 権限乱用の分析

ldap3 を使用して Active Directory の危険な ACL 誤構成を検出します。

Active Directory ACL 権限乱用の分析 とは?

このスキルは、Active Directory 内の Access Control List (ACL) の誤構成を分析し、非特権ユーザーがドメイン管理者グループやドメインコントローラなどの重要なオブジェクトに対して過剰な権限を持つ状況を特定します。GenericAll、WriteDACL、WriteOwner、GenericWrite などの危険な ACE パーミッションを検出し、攻撃パスをマッピングして修復レポートを生成します。ldap3 Python ライブラリを使用してドメインコントローラに接続し、バイナリの nTSecurityDescriptor を SDDL 形式に変換しながら解析します。BloodHound ツールと同様の ACL ベースの攻撃パス分析を自動化し、セキュリティインシデント対応や検知ルール作成に役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-active-directory-acl-abuse

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

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

ドキュメント

Active Directory ACL 権限乱用の分析 は何をしますか?

概要

Active Directory のアクセス制御リスト (ACL) は、随意アクセス制御リスト (DACL) に含まれるアクセス制御エントリ (ACE) を介して AD オブジェクトに権限を定義します。誤構成された ACE は、ドメイン管理者グループ、ドメインコントローラ、GPO などの重要なオブジェクトに対して、GenericAll (フルコントロール)、WriteDACL (権限の変更)、WriteOwner (所有権の取得)、GenericWrite (属性の変更) などの危険な権限を非特権ユーザーに付与する可能性があります。

このスキルは、ldap3 Python ライブラリを使用してドメインコントローラに接続し、nTSecurityDescriptor 属性を持つオブジェクトをクエリし、バイナリセキュリティ記述子を SDDL (Security Descriptor Definition Language) 形式に解析し、非管理者プリンシパルに危険な権限を付与する ACE を特定します。これらの誤構成は、BloodHound などのツールで発見される ACL ベースの攻撃パスの基盤となります。

使用タイミング

  • セキュリティインシデント調査において Active Directory ACL の権限乱用を分析する必要がある場合
  • このドメインに関する検知ルールや脅威ハンティングクエリを構築する場合
  • SOC アナリストがこの種の分析のための構造化された手順を必要とする場合
  • 関連する攻撃手法に対するセキュリティ監視の適用範囲を検証する場合

前提条件

  • Python 3.9 以降、ldap3 ライブラリがインストールされていること (pip install ldap3)
  • AD オブジェクトへの読み取りアクセス権を持つドメインユーザー資格情報
  • ポート 389 (LDAP) または 636 (LDAPS) でのドメインコントローラへのネットワーク接続
  • Active Directory セキュリティモデルと SDDL 形式に関する理解

手順

  1. ドメインコントローラに接続する: ldap3 を使用して NTLM 認証または簡易認証で LDAP 接続を確立します。本番環境では暗号化接続のために LDAPS (ポート 636) を使用してください。

  2. ターゲットオブジェクトをクエリする: 指定された OU またはドメイン全体から、ユーザー、グループ、コンピュータ、OU を含むオブジェクトを検索します。nTSecurityDescriptor、distinguishedName、objectClass、sAMAccountName 属性を要求します。

  3. セキュリティ記述子を解析する: バイナリの nTSecurityDescriptor を SDDL 文字列表現に変換します。DACL 内の各 ACE を解析し、信頼者 SID、アクセスマスク、ACE タイプ (許可/拒否) を抽出します。

  4. SID をプリンシパルに解決する: LDAP ルックアップを使用して、セキュリティ識別子 (SID) を人間が読めるアカウント名にマッピングします。組み込みグループの既知の SID を特定します。

  5. 危険な権限を確認する: 各 ACE のアクセスマスクを危険な権限ビットマスクと比較します: GenericAll (0x10000000)、WriteDACL (0x00040000)、WriteOwner (0x00080000)、GenericWrite (0x40000000)、および特定の拡張権限に対する WriteProperty。

  6. 非管理者信頼者をフィルタリングする: 想定される管理者信頼者 (Domain Admins、Enterprise Admins、SYSTEM、Administrators) を除外し、非特権ユーザーまたはグループが危険な権限を保持している ACE にフラグを付けます。

  7. 攻撃パスをマッピングする: 各発見事項について、潜在的な攻撃チェーンを文書化します (例: ユーザーに対する GenericAll はパスワードリセットを許可し、グループに対する WriteDACL は自分自身をグループに追加することを許可します)。

  8. 修復レポートを生成する: すべての危険な ACE、影響を受けるオブジェクト、非管理者信頼者、推奨される修復手順を含む JSON レポートを出力します。

期待される出力

{
  "domain": "corp.example.com",
  "objects_scanned": 1247,
  "dangerous_aces_found": 8,
  "findings": [
    {
      "severity": "critical",
      "target_object": "CN=Domain Admins,CN=Users,DC=corp,DC=example,DC=com",
      "target_type": "group",
      "trustee": "CORP\\helpdesk-team",
      "permission": "GenericAll",
      "access_mask": "0x10000000",
      "ace_type": "ACCESS_ALLOWED",
      "attack_path": "Domain Admins グループに対する GenericAll により、任意のメンバー追加が可能",
      "remediation": "Domain Admins に対する helpdesk-team の GenericAll ACE を削除してください"
    }
  ]
}

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-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,

analyzing-docker-container-forensics

Investigate compromised Docker containers by analyzing images, layers,

関連スキル