コンテンツにスキップ

カテゴリ目次へ戻る / コマンド全体目次へ戻る

RODC の番号と鍵を使って Kerberos Key List 要求を送り、指定または列挙したアカウントの長期鍵を要求します。

項目内容
実装examples/keylistattack.py
カテゴリKerberos / チケット処理
規模283 行
配布setup.py の scripts=examples/*.py によりスクリプトとしてインストール

オプションの最新の定義は python examples/keylistattack.py -h で確認できます。

引数説明
target[[domain/]username[:password]@] (Use this credential to authenticate to SMB and list domain users (low-privilege account) or LIST (if you want to parse a target file)
-rodcNoNumber of the RODC krbtgt account
-rodcKeyAES key of the Read Only Domain Controller
-fullRun the attack against all domain users. Noisy! It could lead to more TGS requests being rejected
-debugTurn DEBUG output ON
-tsAdds timestamp to every logging output
-domainThe fully qualified domain name (only works with LIST)
-kdcKDC HostName or FQDN (only works with LIST)
-tAttack only the username specified (only works with LIST)
-tfFile that contains a list of target usernames (only works with LIST)
-domain-sidLIST モードで PAC に入れるドメイン SID。PAC の検証が厳しい Domain Controller では指定を推奨します。
-hashesUse NTLM hashes to authenticate to SMB and list domain users.
-no-passdon’t ask for password (useful for -k)
-kUse Kerberos to authenticate to SMB and list domain users. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones specified in the command line
-aesKeyAES key to use for Kerberos Authentication (128 or 256 bits)
-dc-ipIP Address of the domain controller. If ommited it use the domain part (FQDN) specified in the target parameter
-target-ipIP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS name and you cannot resolve it

関連技術: Kerberos の KERB_KEY_LIST_REQ、DPAPI / SAM / LSA / NTDS の KeyListSecrets。

資格情報と RODC 情報を検証し、必要なら LDAP/DRS 経由で domain user を列挙します。対象 user ごとに KDC へ key-list 対応 request を送信し、復号した key material を表示します。-t / -tf と -full が対象の決定方法を切り替えます。

LIST モードでは SAMR からドメイン SID を自動取得しないため、PAC の検証で 要求が拒否される場合は -domain-sid を指定します。

RODC は保持する account secret を限定でき、Kerberos Key List request は RODC 用 ticket と権限条件の下で account key 一覧を返す仕組みです。この コマンドは RODC 番号と krbtgt key から必要な Kerberos material を作り、 対象 principal ごとに key list を要求します。

対象は単一名、file、または -full で取得した domain user 一覧から作られます。 一覧取得経路と KDC request 経路は独立しており、LDAP/DRS の列挙に失敗しても 明示 target まで無効になるわけではありません。request には RODC identity、 ticket、nonce、対応 enctype が関係し、応答 encrypted part は request で 確立した key と正しい key usage で復号します。

返る key は account ごと、enctype/key version ごとに意味が違います。 「一つ応答があった」ことと「要求した全 account の全 key が得られた」ことを 区別します。RODC が secret を cache していない、replication policy で拒否、 KVNO/RODC 番号が不一致という状態を個別に診断できるようにします。

シンボル位置責務を追う入口
KeyListDump49__init__()、connect()、run()、getAllDomainUsers()
モジュール使用する主な名前
impacket.exampleslogger
impacket.examples.secretsdumpKeyListSecrets, RemoteOperations
impacket.examples.utilsparse_target
impacket.krb5constants
impacket.krb5.typesPrincipal
impacket.smbconnectionSMBConnection
impacketversion
import 名配布パッケージ経路・宣言状態
pyasn1pyasn1直接 import、宣言済み
  • 照会や認証の試行が中心です。実行回数が多いと監査ログやアカウントロック、対象の負荷に影響します。
  • オプションによりローカルファイルを作成または更新します。既存ファイルの扱いと秘密情報を含む出力の権限を確認してください。
  • 失敗時は、名前解決、接続、認証、サービスの状態、権限のどこで止まったかを、プロトコルのステータスから切り分けます。

Kerberos ASN.1/crypto、LDAP/DRS、SMB/RPC helper に依存し、KeyListDump.connect()、getAllDomainUsers()、run() が主要境界です。RODC key version と enctype の対応を維持してください。