
リモートシステム上の特権スケジュールタスクを列挙するツール
<p align="center">
<img width="350" height="350" alt="TaskHound ロゴ" src="https://assets.kitploit.com/production/public/readmes/9903/f048c922e3b550dd3bc0880bd2e9ba4bebdfdb710812a9a7eec7249bce3e112e.png" />
</p>
<p align="center">
<strong>Windows 特権スケジュールタスク発見ツール</strong>(楽しみと利益のため)
</p>
<p align="center">
<a href="https://github.com/1r0BIT/TaskHound/releases">
<img src="https://img.shields.io/github/v/release/1r0BIT/TaskHound?style=flat-square&logo=github&color=blue" alt="最新リリース">
</a>
<a href="https://bloodhound.specterops.io/">
<img src="https://img.shields.io/badge/BloodHound-OpenGraph-red.svg?style=flat-square&logo=neo4j" alt="BloodHound OpenGraph">
</a>
<a href="https://www.python.org/">
<img src="https://img.shields.io/badge/python-3.11+-blue.svg?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
</a>
<br>
<a href="https://deepwiki.com/1r0BIT/TaskHound">
<img src="https://deepwiki.com/badge.svg" alt="DeepWiki に質問">
</a>
<a href="https://twitter.com/0xr0BIT">
<img src="https://img.shields.io/badge/Twitter-@0xr0BIT-1DA1F2?style=flat-square&logo=twitter&logoColor=white" alt="Twitter">
</a>
<a href="https://r0bit.io">
<img src="https://img.shields.io/badge/Blog-r0bit.io-orange?style=flat-square&logo=rss&logoColor=white" alt="ブログ">
</a>
</p>
<hr />
TaskHound は、特権アカウントと保存された資格情報で実行される Windows スケジュールタスクを検索します。SMB 経由でタスクを列挙し、XML を解析し、BloodHound 統合を通じて高価値の攻撃機会を特定します。
背景や詳細な説明については、関連するブログ記事をご覧ください: [Part 1](https://r0bit.io/posts/taskhound/part1/index.html) および [Part 2](https://r0bit.io/posts/taskhound/part2/index.html)。
## 主な機能
| 機能 | 説明 |
|---------|-------------|
| **Tier 0 & High Value Detection** | Domain Admins、Enterprise Admins、その他の特権アカウントとして実行されるタスクを自動的に識別します |
| **BloodHound Integration** | ライブの BHCE/Legacy インスタンスに接続するか、エクスポートを取り込んで高価値ユーザーの検出を行います |
| **OpenGraph Support** | スケジュールタスクを BloodHound CE の攻撃パスノードとして可視化します |
| **LAPS Integration** | Windows LAPS と Legacy の両方の LAPS パスワードを自動取得し、ホストごとの認証に使用します |
| **DPAPI Credential Extraction** | 保存されたタスク資格情報を含む DPAPI ブロブを収集および復号化します |
| **Multi-threaded Scanning** | レート制限付きの並列ターゲット処理により、大規模環境をスキャンします |
| **LDAP-based Tier-0 Detection** | BloodHound を使用せずに、グループメンバーシップを介して特権アカウントを検出します |
| **Credential Validation** | RPC 経由で保存されたタスクパスワードがまだ有効かどうかを検証します |
| **Offline Analysis** | マウントされたディスクイメージや以前収集された XML を処理します |
| **Multiple Output Formats** | プレーンテキスト、JSON、CSV、HTML 形式のセキュリティレポート(重要度スコア付き)を出力します |
| **SID Resolution** | BloodHound → Cache → LSARPC → LDAP → GC を使用したマルチティア解決 |
| **Caching** | SID ルックアップと LAPS 資格情報のための SQLite ベースの永続キャッシュ |
## クイックスタート```bash
# Install
git clone https://github.com/1r0BIT/TaskHound.git
cd TaskHound
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt && pip install .
# Basic usage - single target
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local
# Multiple targets with threading
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --targets-file hosts.txt --threads 10
# Auto-discover all domain computers
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --dc-ip 10.0.0.1 --auto-targets --threads 20
# With LAPS - auto-retrieves per-host local admin passwords
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --targets-file hosts.txt --laps --threads 10
# Offline analysis of mounted disk image
taskhound --offline-disk /mnt/disk
```
> **Auth Support**: TaskHoundは、パスワード、NTLMハッシュ、Kerberos(ccacheも含む)、AESキー認証を含む主要な認証メカニズムをサポートしています。
## 設定ファイル
TaskHoundは、永続的な設定のためにTOML設定ファイルをサポートしています。ワーキングディレクトリまたは `~/.config/taskhound/` に `taskhound.toml` を作成します。```toml
[authentication]
username = "svc_taskhound"
domain = "THESIMPSONS.LOCAL"
[target]
dc_ip = "10.0.0.1"
threads = 10
timeout = 30
[bloodhound]
live = true
connector = "http://127.0.0.1:8080"
api_key = "${BH_API_KEY}" # Use env vars for secrets
api_key_id = "${BH_API_KEY_ID}"
type = "bhce"
[bloodhound.opengraph]
enabled = true
output_dir = "./opengraph"
[laps]
enabled = true
[cache]
enabled = true
ttl = 86400 # 24 hours
```
優先順位: CLI args > 環境変数 > ローカル設定 > ユーザー設定 > デフォルト
## AdaptixC2 統合
TaskHound の BOF は、[Adaptix Extension-Kit](https://github.com/Adaptix-Framework/Extension-Kit) の `SAR-BOF/taskhound/` に含まれています。
## デモ出力```
TTTTT AAA SSS K K H H OOO U U N N DDDD
T A A S K K H H O O U U NN N D D
T AAAAA SSS KKK HHHHH O O U U N N N D D
T A A S K K H H O O U U N NN D D
T A A SSSS K K H H OOO UUU N N DDDD
by 0xr0BIT
[+] Connecting to BloodHound CE at http://127.0.0.1:8080
[+] BloodHound connection successful (API v2)
[+] High Value target data loaded (42 users)
[+] OpenGraph generation enabled (auto-upload active)
[*] Processing target: moe.thesimpsons.local
[+] moe.thesimpsons.local: Connected via SMB
[+] moe.thesimpsons.local: Local Admin Access confirmed
[*] moe.thesimpsons.local: Enumerating scheduled tasks (skipping \Microsoft)
[+] moe.thesimpsons.local: Found 12 tasks (3 privileged, 2 with stored credentials)
┌──────────────────────────────────────────────────────────────────────────────┐
│ [TIER-0] moe.thesimpsons.local - \DuffBrewery\BackupJob │
├──────────────────────────────────────────────────────────────────────────────┤
│ Enabled │ True │
│ RunAs │ THESIMPSONS\Administrator │
│ What │ C:\Scripts\backup_beer_recipes.ps1 │
│ Author │ THESIMPSONS\burns.monty │
│ Date │ 2025-06-15T02:30:00 │
│ Trigger │ Calendar (starts 2025-06-15 02:30, daily) │
│ Reason │ Tier 0 - Domain Admins membership │
│ Cred Validation │ CONFIRMED_VALID │
│ Pwd Analysis │ Password unchanged AND ran within schedule - confirmed │
└──────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────┐
│ [PRIV] moe.thesimpsons.local - \KrustyBurger\InventorySync │
├──────────────────────────────────────────────────────────────────────────────┤
│ Enabled │ True │
│ RunAs │ THESIMPSONS\svc_krusty │
│ What │ C:\KrustyApps\sync.exe --silent │
│ Author │ THESIMPSONS\carlson.carl │
│ Date │ 2025-03-10T08:00:00 │
│ Trigger │ Calendar (starts 2025-03-10 08:00, every 4 hours) │
│ Reason │ High Value match found in BloodHound │
│ Cred Validation │ DEFINITELY_STALE │
│ Pwd Analysis │ Password changed AFTER last run - credentials are stale │
└──────────────────────────────────────────────────────────────────────────────┘
╭─────────────────────────── SCAN COMPLETE ────────────────────────────────────╮
│ [+] Succeeded: 1 │
│ [-] Failed: 0 │
│ Total time: 2.34s │
│ Avg per target: 2340ms │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────── TASK SUMMARY ─────────────────────────────────────╮
│ Hostname Tier-0 Privileged Normal │
│ moe.thesimpsons.local 1 2 9 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── BLOODHOUND OPENGRAPH ─────────────────────────────────╮
│ [+] Generated 3 nodes, 5 edges │
│ [+] Uploaded to BloodHound successfully │
│ [*] JSON saved to: ./opengraph/taskhound_data.json │
╰──────────────────────────────────────────────────────────────────────────────╯
```
---
## BloodHound 統合
TaskHound は、**Legacy BloodHound** (Neo4j) と **BloodHound Community Edition (BHCE)** の両方を自動フォーマット検出でサポートしています。
### ライブ接続```bash
# BHCE with API Key (recommended)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local \
--bh-live --bhce --bh-connector http://127.0.0.1:8080 \
--bh-api-key "YOUR_API_KEY" --bh-api-key-id "YOUR_KEY_ID"
# BHCE with username/password
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local \
--bh-live --bhce --bh-connector http://127.0.0.1:8080 \
--bh-user admin --bh-password password
# Legacy BloodHound (Neo4j)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local \
--bh-live --legacy --bh-connector bolt://127.0.0.1:7687 \
--bh-user neo4j --bh-password password
```
### Tier 0 検出方法
| ソース | 検出方法 |
|--------|----------|
| **BHCE** | `isTierZero`、システムタグ(`admin_tier_0`)、AdminSDHolder |
| **レガシー** | AdminSDHolder(`admincount=1`)、SIDベースの検出 |
| **LDAP** | グループメンバーシップクエリ(`--ldap-tier0`) |
| **組み込み** | 既知のTier 0 SID(Domain Admins、Enterprise Adminsなど) |
### オフラインデータ取り込み
ライブ接続が不可能な場合、以下のCypherクエリを使用して高価値ユーザーをエクスポートしてください:
**BHCE:**```cypher
MATCH (n) WHERE coalesce(n.system_tags, "") CONTAINS "admin_tier_0" OR n.highvalue = true
MATCH p = (n)-[:MemberOf*1..]->(g:Group)
RETURN p;
```
**レガシー:**```cypher
MATCH (u:User {highvalue:true})
OPTIONAL MATCH (u)-[:MemberOf*1..]->(g:Group)
WITH u, properties(u) as all_props, collect(g.name) as groups
RETURN u.samaccountname AS SamAccountName, all_props, groups
```
Then use: `taskhound --bh-data exported_users.json ...`
---
## OpenGraph 攻撃パスの可視化
<p align="center">
<img src="https://assets.kitploit.com/production/public/readmes/9903/43ec2d44fef6e06a4aee6b0cad113991182e24d877f0d9099cd6b479554b3362.jpg" alt="OpenGraph 攻撃パス" />
</p>
TaskHound は、スケジュールされたタスクの攻撃パスを可視化するために、BloodHound CE にカスタムノードとエッジを作成します。
**提供されるもの:**
- **カスタムノード**: `ScheduledTask` (20以上のプロパティ: 認証情報、トリガー、パスワード分析、検証ステータス)
- **カスタムエッジ**: `HasTask`, `HasTaskWithStoredCreds`, `RunsAs`
- **攻撃パス**: `(Owned) → AdminTo → (Computer) → HasTask → (Task) → RunsAs → (Target)````bash
# Collect and auto-upload
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --bh-opengraph
# Generate without upload (saves to {output_dir}/opengraph/)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --bh-opengraph --bh-no-upload
```
> **注記**: OpenGraphはBHCE専用です。従来のBloodHoundはカスタムノードタイプをサポートしていません。
---
## LAPS統合
TaskHoundは自動的にLAPSパスワードを取得し、ホストごとの認証に使用できます。Windows LAPS(`msLAPS-Password`)とレガシーLAPS(`ms-Mcs-AdmPwd`)の両方をサポートしており、MS-GKDIによる暗号化されたパスワードも含みます。```bash
# Basic LAPS - auto-retrieves passwords per target
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --targets-file hosts.txt --laps --threads 10
# Custom local admin username
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --laps --laps-user localadmin
# LAPS with OPSEC mode (other noisy operations disabled)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --laps --opsec --force-laps
```
**サポートされているLAPSの種類:**
| タイプ | 属性 | 暗号化 |
|------|-----------|-----------|
| Windows LAPS | `msLAPS-Password` | いいえ |
| Windows LAPS | `msLAPS-EncryptedPassword` | はい (MS-GKDI) |
| Legacy LAPS | `ms-Mcs-AdmPwd` | いいえ |
---
## DPAPI資格情報の抽出
TaskHoundは、DPAPIを使用して保存されたタスク資格情報を抽出および復号化します。**DPAPIの収奪はデフォルトで有効です**。```bash
# Step 1: Get DPAPI_SYSTEM key via LSA dump
nxc smb moe.thesimpsons.local -u homer.simpson -p 'Doh!123' --lsa
# Look for: DPAPI_SYSTEM userkey: 0x51e43225...
# Step 2a: Loot + decrypt immediately (looting is default, just add key)
taskhound -t moe.thesimpsons.local -u homer.simpson -p 'Doh!123' -d thesimpsons.local --dpapi-key 0x51e43225...
# Step 2b: Or collect now (default saves to ./output/raw_backups/), decrypt later
taskhound -t moe.thesimpsons.local -u homer.simpson -p 'Doh!123' -d thesimpsons.local
# Later:
taskhound --offline ./output/raw_backups/moe.thesimpsons.local --dpapi-key 0x51e43225...
# Custom output directory
taskhound -t moe.thesimpsons.local -u homer.simpson -p 'Doh!123' -d thesimpsons.local --output-dir ./collected
# Disable DPAPI looting explicitly
taskhound -t moe.thesimpsons.local -u homer.simpson -p 'Doh!123' -d thesimpsons.local --no-loot
```
> **重要**: 各ホストには固有のDPAPI_SYSTEMキーがあります。マルチターゲットスキャンの場合、収集(デフォルト)し、各ターゲットをオフラインで復号化します。
---
## 資格情報の検証
TaskHoundは、RPCを介してタスク実行履歴をクエリし、ヒューリスティックを適用することで、保存されたタスクパスワードがまだ有効である可能性が高いかどうかを評価します。これは**デフォルトで有効**です。```bash
# Credential validation is on by default, no flag needed
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local
# Disable validation explicitly
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --no-validate-creds
```
### 動作の仕組み
Windows タスクスケジューラは**成功した**タスクの実行のみを記録します。認証失敗(パスワードの誤り、アカウントロックなど)は黙って無視されます。タスクは単に実行されません。
**重要な洞察**: Windows はタスク作成時に資格情報を検証します。間違ったパスワードでタスクを作成しようとすると、`ERROR_LOGON_FAILURE` が発生し、タスクは作成されません。つまり、**保存された資格情報を持つタスクが存在する場合、そのパスワードはタスク作成時に有効だった**ことを意味します。
TaskHound はヒューリスティックを使用して資格情報の有効性を推定します:
| ステータス | 意味 |
|--------|---------|
| `CONFIRMED_VALID` | タスク作成以降パスワード変更なし、かつタスクが予定通りに実行された - 資格情報が動作確認済み |
| `HIGH_CONFIDENCE_VALID` | タスク作成以降パスワード変更なし、ただしトリガータイミング不明(例:起動トリガー) - 資格情報は有効である可能性が高い |
| `LIKELY_VALID` | パスワードが変更されたがタスクはスケジュール内で実行された(資格情報更新済み)、またはタスクが正常に実行された(RPC のみモード) |
| `POSSIBLY_STALE` | タスクは実行されるべきだが実行されていない - 古い資格情報を示す可能性あり |
| `DEFINITELY_STALE` | 前回の成功実行後にパスワードが変更された - 資格情報は確実に間違っている |
| `NEVER_RAN_LIKELY_VALID` | タスクは一度も実行されていないが、作成以降パスワード変更なし - 有効である可能性が高い(バッチログオン権限がない可能性あり) |
| `NEVER_RAN_POSSIBLY_STALE` | タスクは一度も実行されていない、かつ作成後にパスワード変更あり - 古い可能性が高い |
| `NEVER_RAN_UNKNOWN` | タスクは一度も実行されていない、AD コンテキストなし - 作成時は有効だったが、現在の状態は不明 |
| `UNKNOWN` | 判断不可(アカウントがブロックされているなど) |
重要な洞察:AD の `pwdLastSet` とタスクスケジューラの `LastRunTime` を比較することで、最後の成功実行後にパスワードが変更されたかどうかがわかります。一度も実行されていないタスクについては、`pwdLastSet` を `task_creation_date` と比較することで、有効な資格情報でタスクが作成された後にパスワードが変更されたかどうかがわかります。
**AD データなし**(例: `--no-ldap` で BloodHound もなし)の場合: TaskHound は RPC のみモードにフォールバックし、リターンコードと最終実行時間のみを使用します。正常に実行された場合は `LIKELY_VALID` を返します。トリガー間隔がタスク XML から既知であれば、スケジュールベースの古さ検出は引き続き適用されます。
> **注記**: `--opsec` または `--no-rpc` を使用すると無効になります。
---
## 出力形式
TaskHound はさまざまなユースケースに対応する複数の出力形式をサポートしています。すべての出力は `--output-dir`(デフォルト: `./output`)の下の構造化されたディレクトリレイアウトを使用します。
### 利用可能な形式
| 形式 | フラグ | 説明 | ユースケース |
|--------|------|-------------|----------|
| **Plain** | `-o plain` | 人間が読めるコンソール出力(デフォルト) | インタラクティブ使用、簡単な確認 |
| **JSON** | `-o json` | 機械可読な構造化エクスポート | 自動化、データ分析、スクリプティング |
| **CSV** | `-o csv` | スプレッドシート互換のエクスポート | レポート作成、フィルタリング、Excel 分析 |
| **HTML** | `-o html` | 重要度スコアリング付きセキュリティレポート | ブルーチーム監査、ステークホルダーレポート |
### 使用例```bash
# Default - plain text to console + files
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local
# Multiple output formats
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets -o plain,json,html
# JSON only for automation
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets -o json
# Custom output directory
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets -o html --output-dir ./audit_results
# All formats for comprehensive audit
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets -o plain,json,csv,html --output-dir ./full_audit
```
### ディレクトリ構造```
./output/ # Base directory (--output-dir)
├── plain/ # Plain text output
│ └── <hostname>/
│ └── tasks.txt
├── json/ # JSON export
│ └── taskhound.json
├── csv/ # CSV export
│ └── taskhound.csv
├── html/ # HTML security reports
│ └── taskhound.html
├── opengraph/ # BloodHound OpenGraph files
│ └── taskhound_data.json
└── raw_backups/ # Raw collection (XML + DPAPI)
└── <hostname>/
├── tasks/ # Task XML files
└── dpapi_loot/ # DPAPI credential blobs
```
### HTMLセキュリティレポート
HTML出力は、ブルーチーム評価向けに設計された包括的なセキュリティレポートを生成します:
- **重大度スコアリング**: 権限、保存された資格情報、構成に基づいてリスクレベルで評価されたタスク
- **タスク詳細**: トリガー、アクション、実行アカウント、検証ステータスを含む完全なメタデータ
- **フィルタリング**: ホスト、重大度、資格情報ステータスによるクライアント側フィルタリング
- **エクスポート対応**: 管理レポートや監査ドキュメントに適しています
### バックアップ収集
デフォルトでは、TaskHoundはオフライン分析のために生のXMLタスクファイルとDPAPI資格情報ブロブを保存します:```bash
# Disable backup collection
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --no-backup
# Analyze backups later (offline mode)
taskhound --offline ./output/raw_backups/moe.thesimpsons.local --dpapi-key 0x51e43225...
```
---
## マルチスレッドスキャン
大規模な環境では、レート制限付きの並列スキャンを使用してください:```bash
# 20 parallel workers, max 5 targets/second
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets --threads 20 --rate-limit 5
# Auto-discover servers only (uses preset filter)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets --ldap-filter servers --threads 20
# Include disabled computers and extend stale threshold to 90 days
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets --include-disabled --stale-threshold 90
# Target workstations only, disable stale filtering
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local --auto-targets --ldap-filter workstations --stale-threshold 0
```
### 自動ターゲットフィルタリング
デフォルトでは、`--auto-targets` はスマートフィルタリングを適用し、ノイズと失敗した接続を減らします:
| フィルター | デフォルト | オーバーライド |
|--------|---------|----------|
| 無効なアカウント | 除外 | `--include-disabled` |
| 古いコンピューター(60日以上) | 除外 | `--stale-threshold 0`(無効化) |
| ドメインコントローラー | 除外 | `--include-dcs` |
**データソースの優先順位:** BloodHound(設定されている場合) → LDAPフォールバック
BloodHoundを使用する場合、TaskHoundは`include_properties=true`でクエリを実行し、効率的な単一クエリ列挙を行います。BloodHoundデータが7日以上経過している場合は警告が表示され、30日以上経過している場合は緊急警告が表示されます。
**フィルタープリセット:**
- `servers` - Windows Serverオペレーティングシステムのみ
- `workstations` - 非サーバーオペレーティングシステムのみ
- `(raw LDAP)` - カスタムLDAPフィルター(LDAPソースが必要)
---
## SID解決
TaskHoundは、マルチティアフォールバックチェーンを使用してSIDを読み取り可能な名前に解決します:
1. **BloodHound**(接続されている場合) - 最速、ネットワークトラフィックなし
2. **Cache** - SQLite永続キャッシュ(デフォルト24時間TTL)
3. **LSARPC** - 直接ターゲットクエリ(ローカルアカウントに最も正確)
4. **LDAP** - ドメインコントローラークエリ
5. **Global Catalog** - クロスドメイン/フォレストSID用```bash
# Separate LDAP credentials for SID resolution
taskhound -u localadmin -p 'L0c4lP@ss!' -d . -t moe.thesimpsons.local \
--ldap-user homer.simpson --ldap-password 'Doh!123' --ldap-domain thesimpsons.local
# Specify Global Catalog for multi-domain
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --gc-server 10.0.0.1
# Disable all network-based resolution (OPSEC)
taskhound -u homer.simpson -p 'Doh!123' -d thesimpsons.local -t moe.thesimpsons.local --opsec
```
## オフライン解析
ネットワークアクセスなしでタスクを解析する:```bash
# Previously collected XML backups
taskhound --offline ./backup/moe.thesimpsons.local
# Mounted disk image
taskhound --offline-disk /mnt/disk
# Mounted image with custom hostname
taskhound --offline-disk /mnt/disk --disk-hostname MOE
```
---
## OPSEC に関する考慮事項
TaskHound は、ステルス性と機能性のバランスを取るために、ネットワーク操作を細かく制御できます。
### プロトコルの影響
| プロトコル | 操作 | 無効化フラグ |
|------------|------|--------------|
| SMB | タスク列挙(常に使用) | N/A |
| LDAP (389/636) | SID解決、Tier-0検出、pwdLastSet | `--no-ldap` |
| グローバルカタログ (3268) | クロスドメインSID解決 | `--no-ldap` |
| LSARPC (SMBパイプ) | フォールバックSID解決 | `--no-rpc` |
| リモートレジストリ (SMBパイプ) | Credential Guard検出 | `--no-credguard` |
| タスクスケジューラRPC (SMBパイプ) | 資格情報の検証 | `--no-validate-creds` |
| DPAPIファイル収集 (SMB) | DPAPI資格情報ブロブ収集 | `--no-loot` |
### SID解決チェーン```
Default: BloodHound → Cache → LSARPC → LDAP → GC
--no-ldap: BloodHound → Cache → LSARPC
--no-rpc: BloodHound → Cache → LDAP → GC
--opsec: BloodHound → Cache (only)
```
### デフォルトの動作
TaskHoundはデフォルトで**非常にノイズが多い** - すべての機能が最大の可視性のために有効になっています。これにより、OPSECが懸念されない監査や包括的な評価に最適です。
- **Credential Guardの検出** - デフォルトで有効(`--no-credguard`で無効化)
- **資格情報の検証** - デフォルトで有効(`--no-validate-creds`で無効化)
- **DPAPIの略奪** - デフォルトで有効(`--no-loot`で無効化)
- **LDAP解決** - デフォルトで有効(`--no-ldap`で無効化)
- **RPC操作** - デフォルトで有効(`--no-rpc`で無効化)
> [!WARNING]
> **Credential Guardのチェックは高度に検出可能です。** モダンなWindowsではRemote Registryサービスがデフォルトで停止しているため、TaskHoundはSCM経由でリモートから**サービスを起動**し、チェックを実行してから停止します(secretsdumpと同じ)。これは、まともなSOCならクリスマスツリーのように点灯させるでしょう。**エンゲージメントでこれを避けたい場合は、必ず`--no-credguard`を使用してください!**
エンゲージメントと言えば:レッドチーム/ステルス運用では、`--opsec`を使用してすべてのノイズの多い機能を一度に無効にします。(またはBOFを使用してください。)
### 使用例```bash
# Full OPSEC mode (disables: LDAP, RPC, looting, credguard, validation; forces sequential scanning)
taskhound -u user -p 'pass' -d corp.local -t target --opsec
# OPSEC with jitter (random 0-5 second delays between hosts)
taskhound -u user -p 'pass' -d corp.local --targets-file hosts.txt --opsec --jitter 5
# Disable LDAP only (keep LSARPC for SID resolution)
taskhound -u user -p 'pass' -d corp.local -t target --no-ldap
# Disable RPC only (keep LDAP for SID resolution)
taskhound -u user -p 'pass' -d corp.local -t target --no-rpc
# LAPS with OPSEC (force LAPS LDAP queries despite --opsec)
taskhound -u user -p 'pass' -d corp.local --laps --opsec --force-laps
```
### ステルス運用のベストプラクティス
1. **BloodHoundデータの事前投入** - 最初に `--bh-live` を使用してドメインデータをインポートする
2. **`--opsec` フラグの使用** - すべてのノイズの多い操作を一度に無効化する
3. **タイミングランダム化のための `--jitter` の追加** - 予測可能なスキャンパターンを回避する
4. **他の手段でXMLを収集** - `--offline` を使用してオフラインで分析する
5. **BOF実装の使用** - AdaptixC2で利用可能
---
## 完全なCLIリファレンス
TaskHoundは、色付きテーブルと進行状況インジケーターを備えたフォーマット済みコンソール出力にRichを使用しています。```
taskhound --help
```
<details>
<summary>クリックして全使用法を展開</summary>```
Usage: taskhound [OPTIONS] [TARGETS]
AUTHENTICATION OPTIONS
-u, --username Username (required for online mode)
-p, --password Password (omit with -k for Kerberos/ccache)
-d, --domain Domain (required for online mode)
--hashes NTLM hashes (LM:NT or NT-only)
```
---
[Read more](https://github.com/1r0bit/taskhound)