Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
chainsaw — Windowsフォレンジックアーティファクトを迅速に検索・ハント | Kitploit
ツール/GitHubGitHub/withsecureopensource/chainsaw
防御ツール脆弱性分析フォレンジックデジタルフォレンジック脅威インテリジェンスインシデントレスポンスログ分析
GitHubwithsecureopensource/chainsaw

chainsaw

Windowsフォレンジックアーティファクトを迅速に検索・ハント

リポジトリを見る
3.7k305418日前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Windowsフォレンジックアーティファクトを迅速に検索・ハントする


Chainsawは、イベントログやMFTファイルなどのWindowsフォレンジックアーティファクト内の脅威を迅速に特定するための強力な「ファーストレスポンス」機能を提供します。Chainsawは、イベントログをキーワードで検索するための汎用的かつ高速な方法を提供し、Sigma検出ルールの組み込みサポートやカスタムChainsaw検出ルールを通じて脅威を特定します。

機能

  • 🎯 Sigma検出ルールとカスタムChainsaw検出ルールを使用した脅威のハント
  • 🔍 文字列マッチングおよび正規表現パターンによるフォレンジックアーティファクトの検索と抽出
  • 📅 Shimcacheアーティファクトを分析し、Amcacheデータで強化することで実行タイムラインを作成
  • 💡 SRUMデータベースを分析し、それに関する洞察を提供
  • ⬇️ フォレンジックアーティファクト(MFT、レジストリハイブ、ESEデータベース)の生コンテンツをダンプ
  • ⚡ 超高速、Rustで書かれており、@OBenamramによるEVTXパーサーライブラリをラップ
  • 🪶 不要な肥大化のないクリーンで軽量な実行と出力フォーマット
  • 🔥 TAU Engineライブラリによるドキュメントタグ付け(検出ロジックマッチング)
  • 📑 ASCIIテーブル形式、CSV形式、JSON形式など、さまざまな形式で結果を出力
  • 💻 MacOS、Linux、Windowsで実行可能

目次

  • 機能
  • なぜChainsawなのか?
  • Windowsイベントログのハンティングロジック
  • クイックスタートガイド
    • ダウンロードと実行
    • Nixでのインストール/ビルド
    • EDRおよびAVの警告
    • Chainsaw v2での変更点
  • 例
    • 検索
    • ハンティング
    • 分析
      • Shimcache
      • SRUM (System Resource Usage Monitor)
      • Gaps (イベントログのギャップ検出)
    • ダンプ
  • 謝辞

拡張情報はこのツールのWikiにあります: https://github.com/WithSecureLabs/chainsaw/wiki

なぜChainsawなのか?

WithSecure Counterceptでは、EDRエージェントを介してエンドポイントから幅広いテレメトリソースを取り込み、マネージド検出および対応サービスを提供しています。しかし、EDRでキャプチャされなかったフォレンジックアーティファクトを迅速に分析する必要がある状況があります。一般的な例としては、侵害時にEDRがインストールされていなかった環境でのインシデントレスポンス調査が挙げられます。Chainsawは、このような状況でフォレンジックアーティファクトの迅速なトリアージを実行するツールを、当社の脅威ハンターとインシデントレスポンスコンサルタントに提供するために作成されました。

Windowsイベントログ

Windowsイベントログは、脅威ハンティングおよびインシデントレスポンス調査のための豊富なフォレンジック情報源を提供します。残念ながら、イベントログの処理と検索は遅く時間のかかるプロセスであり、ほとんどの場合、ログデータを効率的にハントし検出ロジックを適用するために、ELKスタックやSplunkインスタンスなどの周辺インフラストラクチャのオーバーヘッドを必要とします。このオーバーヘッドは、ブルーチームが調査を進めるために必要な方向性と結論を提供するためにWindowsイベントログを迅速にトリアージできないことをしばしば意味します。Chainsawは、Windowsイベントログを迅速に検索・ハントできるため、この問題を解決します。

執筆時点では、Windowsイベントログをトリアージし、ログ内の興味深い要素を特定し、Sigmaなどの検出ロジックルール形式を適用して悪意のある活動の兆候を検出する、シンプルで高速な方法を提供するオープンソースのスタンドアロンツールはほとんどありません。当社のテストでは、存在していたツールは大量のイベントログに検出ロジックを効率的に適用するのに苦労し、迅速なトリアージが必要なシナリオには適していませんでした。

Windowsイベントログのハンティングロジック

Sigmaルールマッチング

--sigmaおよび--mappingパラメータを使用して、SIGMA検出ルールのサブセット(またはSIGMA gitリポジトリ全体)を含むディレクトリを指定すると、chainsawは自動的にこれらのルールをロード、変換し、提供されたイベントログに対して実行します。マッピングファイルは、ルールマッチングに使用するイベントログ内のフィールドをchainsawに指示します。デフォルトでは、Chainsawは以下を含む(ただしこれらに限定されない)幅広いイベントログタイプをサポートしています:

ルール検出に使用されるフィールドの完全なリストについてはマッピングファイルを参照し、必要に応じて自由に拡張してください。

Chainsaw検出ルール

Sigmaルールのサポートに加えて、Chainsawはカスタムルール形式もサポートしています。リポジトリには、ユーザーが以下を実行できるようにするさまざまなChainsawルールを含むrulesディレクトリがあります:

  1. Windows Defender、F-Secure、Sophos、Kaspersky AVアラートの抽出と解析
  2. 主要なイベントログのクリア、またはイベントログサービスの停止の検出
  3. ユーザーの作成、または機密ユーザーグループへの追加
  4. リモートログイン(サービス、RDP、ネットワークなど)イベント。これはハンターが横展開のソースを特定するのに役立ちます
  5. ローカルユーザーアカウントのブルートフォース

クイックスタートガイド

ダウンロードと実行

Chainsaw v2のリリースに伴い、Sigma RulesおよびEVTX-Attack-SamplesリポジトリをChainsawのサブモジュールとして含めないことにしました。最新バージョンを確実に入手するために、これらのリポジトリを個別にクローンすることをお勧めします。

Chainsawバイナリ、Sigmaルール、サンプルイベントログを含むオールインワンパッケージがまだ必要な場合は、このGitHubリポジトリのリリースセクションからダウンロードできます。このリリースセクションでは、さまざまなプラットフォームとアーキテクチャ向けのコンパイル済みバイナリのみのバージョンのChainsawも見つけることができます。

Chainsawを自分でコンパイルしたい場合は、Chainsawリポジトリをクローンできます:

git clone https://github.com/WithSecureLabs/chainsaw.git

そして、cargo build --releaseを実行してコードを自分でコンパイルします。ビルドが完了すると、コンパイル済みバイナリのコピーがtarget/releaseフォルダにあります。

--releaseフラグを付けてビルドしてください。これにより実行時間が大幅に速くなります。

Chainsawの実行時の外観をすばやく確認したい場合は、Sigma RulesおよびEVTX-Attack-Samplesリポジトリをクローンできます:``` git clone https://github.com/SigmaHQ/sigma git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git

root@kitploit:~
そして、以下のパラメータでChainsawを実行します:```
./chainsaw hunt EVTX-ATTACK-SAMPLES/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml

Nix でインストール/ビルド```

├───devShells │ └───x86_64-linux │ └───default: development environment 'nix-shell' ├───formatter │ └───x86_64-linux: package 'alejandra-3.1.0' └───packages └───x86_64-linux ├───chainsaw: package 'chainsaw-2.10.1' └───default: package 'chainsaw-2.10.1'

root@kitploit:~
Chainsaw はパッケージとして [nixpkgs](https://search.nixos.org/packages?query=chainsaw) から入手できます。
NixOS を使用している場合は、システム設定ファイルに `chainsaw` を追加するだけです。

ただし、NixOS を使用していない場合でも、Nix 経由で Chainsaw をインストールできます。推奨される方法は `nix-shell` を使用する方法で、これにより $PATH 環境変数が一時的に変更されます。
そのためには、以下を実行してください:```
nix-shell -p chainsaw

また、このリポジトリがflakeであることを利用して、以下を実行することもできます:``` nix profile install github:WithSecureLabs/chainsaw

root@kitploit:~
ただし、Nix を使用して chainsaw を自分でビルドしたい場合は、このリポジトリに付属している `flake.nix` を再び利用できます。
バイナリをビルドするには、クローンしたリポジトリのルートディレクトリで以下を実行してください```
nix build .#

これにより ./result ディレクトリが作成され、chainsaw バイナリは ./result/bin/chainsaw に配置されます。

EDR および AV の警告

chainsaw をダウンロードして実行すると、ローカルの EDR / アンチウイルスエンジンが Chainsaw を悪意のあるものとして検出する場合があります。この例は以下の GitHub issue で確認できます: Example1、Example2。

これらの警告は通常、悪意のある文字列(例: "mimikatz")への参照を含むサンプルイベントログおよび/または Sigma ルールが原因です。また、何らかのヒューリスティック検出により、一部のアンチウイルスエンジンが Chainsaw バイナリを検出する事例も確認されています。

Chainsaw v2 で変更された点

2022年7月に、Chainsaw の動作を大幅に刷新したバージョン2をリリースしました。Chainsaw v2 には、以下のハイライトを含むいくつかの重要な改善が含まれています:

  • Sigma ルールのマッピング手法の改善により、サポートされる Chainsaw ルールおよびイベントログのイベントタイプの数が大幅に増加。
  • 検出を含むイベントログのすべてのイベントデータのスナップショットを表示する、改善された CLI 出力。
  • JSON 形式と XML 形式の両方でのイベントログの読み込みと解析のサポート。
  • Hunt および Search 機能のための、よりクリーンでシンプルなコマンドライン引数。
  • ルール作成者、ルールステータス、ルールレベルなどの追加のオプション出力情報。
  • ステータス、種類、および重大度レベルによる読み込み済みルールのフィルタリング機能。
  • 組み込みの Chainsaw 検出ルールを専用の Chainsaw ルールファイルに分離
  • 可読性を向上させ、コミュニティからのコントリビューションのオーバーヘッドを削減するための Chainsaw コードのクリーンアップと書き直し。

Chainsaw のバージョン1を引き続き使用したい場合は、releases セクションでコンパイル済みバイナリを入手するか、v1.x.x ブランチでソースコードにアクセスできます。Chainsaw v1 はもはやメンテナンスされていないため、すべてのユーザーは Chainsaw v2 への移行を検討してください。

Chainsaw v1 の「Christmas Project」コードベースを v2 で洗練された製品へと変換してくれた @AlexKornitzer に多大なる感謝を申し上げます。

例

検索

root@kitploit:~
  USAGE:
      chainsaw search [FLAGS] [OPTIONS] <pattern> [--] [path]...

  FLAGS:
      -h, --help            Prints help information
      -i, --ignore-case     Ignore the case when searching patterns
          --json            Print the output in json format
          --load-unknown    Allow chainsaw to try and load files it cannot identify
          --local           Output the timestamp using the local machine's timestamp
      -q                    Suppress informational output
          --skip-errors     Continue to search when an error is encountered
      -V, --version         Prints version information

  OPTIONS:
          --extension <extension>...    Only search through files with the provided extension
          --from <from>                 The timestamp to search from. Drops any documents older than the value provided
      -o, --output <output>             The path to output results to
      -e, --regex <pattern>...          A string or regular expression pattern to search for
      -t, --tau <tau>...                Tau expressions to search with. e.g. 'Event.System.EventID: =4104'
          --timestamp <timestamp>       The field that contains the timestamp
          --timezone <timezone>         Output the timestamp using the timezone provided
          --to <to>                     The timestamp to search up to. Drops any documents newer than the value provided

  ARGS:
      <pattern>    A string or regular expression pattern to search for. Not used when -e or -t is specified
      <path>...    The paths containing event logs to load and hunt through

コマンド例

大文字小文字を区別せずに文字列 "mimikatz" をすべての .evtx ファイルで検索する

root@kitploit:~
./chainsaw search mimikatz -i evtx_attack_samples/

*powershell スクリプトブロックイベント(イベント ID 4014)をすべての .evtx ファイルで検索する

root@kitploit:~
./chainsaw search -t 'Event.System.EventID: =4104' evtx_attack_samples/

特定の evtx ログでログオンイベントを正規表現パターンに一致させて検索し、JSON 形式で出力する

root@kitploit:~
./chainsaw search -e "DC[0-9].insecurebank.local" evtx_attack_samples --json

ハンティング

root@kitploit:~
  USAGE:
      chainsaw hunt [FLAGS] [OPTIONS] [--] [path]...

  FLAGS:
          --csv             Print the output in csv format
          --full            Print the full values for the tabular output
      -h, --help            Prints help information
          --json            Print the output in json format
          --load-unknown    Allow chainsaw to try and load files it cannot identify
          --local           Output the timestamp using the local machine's timestamp
          --log             Print the output in log like format
          --metadata        Display additional metadata in the tablar output
      -q                    Suppress informational output
          --skip-errors     Continue to hunt when an error is encountered
      -V, --version         Prints version information

  OPTIONS:
          --column-width <column-width>    Set the column width for the tabular output
          --extension <extension>...       Only hunt through files with the provided extension
          --from <from>                    The timestamp to hunt from. Drops any documents older than the value provided
          --kind <kind>...                 Restrict loaded rules to specified kinds
          --level <level>...               Restrict loaded rules to specified levels
      -m, --mapping <mapping>...           A mapping file to tell Chainsaw how to use third-party rules
      -o, --output <output>                A path to output results to
      -r, --rule <rule>...                 A path containing additional rules to hunt with
      -s, --sigma <sigma>...               A path containing Sigma rules to hunt with
          --status <status>...             Restrict loaded rules to specified statuses
          --timezone <timezone>            Output the timestamp using the timezone provided
          --to <to>                        The timestamp to hunt up to. Drops any documents newer than the value provided

  ARGS:
      <rules>      The path to a collection of rules to use for hunting
      <path>...    The paths containing event logs to load and hunt through

コマンド例

Sigma ルールを検出ロジックとして使用して、すべての evtx ファイルをハンティングする

root@kitploit:~
./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml

Sigma ルールと Chainsaw ルールを検出ロジックとして使用してすべての evtx ファイルをハンティングし、CSV 形式で results フォルダに出力する

root@kitploit:~
./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml -r rules/ --csv --output results

Sigma ルールを検出ロジックとして使用してすべての evtx ファイルをハンティングし、特定のタイムスタンプ間のみを検索して、結果を JSON 形式で出力する

root@kitploit:~
 ./chainsaw hunt evtx_attack_samples/ -s sigma/ --mapping mappings/sigma-event-logs-all.yml --from "2019-03-17T19:09:39" --to "2019-03-17T19:09:50" --json

出力

root@kitploit:~
$ ./chainsaw hunt -r rules/ evtx_attack_samples -s sigma/rules --mapping mappings/sigma-event-logs-all.yml --level critical

     ██████╗██╗  ██╗ █████╗ ██╗███╗   ██╗███████╗ █████╗ ██╗    ██╗
    ██╔════╝██║  ██║██╔══██╗██║████╗  ██║██╔════╝██╔══██╗██║    ██║
    ██║     ███████║███████║██║██╔██╗ ██║███████╗███████║██║ █╗ ██║
    ██║     ██╔══██║██╔══██║██║██║╚██╗██║╚════██║██╔══██║██║███╗██║
    ╚██████╗██║  ██║██║  ██║██║██║ ╚████║███████║██║  ██║╚███╔███╔╝
     ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝ ╚══╝╚══╝
        By WithSecure Countercept (@FranticTyping, @AlexKornitzer)

    [+] Loading detection rules from: ../../rules/, /tmp/sigma/rules
    [+] Loaded 129 detection rules (198 not loaded)
    [+] Loading event logs from: ../../evtx_attack_samples (extensions: .evtx)
    [+] Loaded 268 EVTX files (37.5 MB)
    [+] Hunting: [========================================] 268/268

    [+] Group: Antivirus
    ┌─────────────────────┬────────────────────┬──────────┬───────────┬─────────────┬────────────────────────────────┬──────────────────────────────────┬────────────────────┐
    │      timestamp      │     detections     │ Event ID │ Record ID │  Computer   │          Threat Name           │           Threat Path            │        User        │
    ├─────────────────────┼────────────────────┼──────────┼───────────┼─────────────┼────────────────────────────────┼──────────────────────────────────┼────────────────────┤
    │ 2019-07-18 20:40:00 │ ‣ Windows Defender │ 1116     │ 37        │ MSEDGEWIN10 │ Trojan:PowerShell/Powersploit. │ file:_C:\AtomicRedTeam\atomic-   │ MSEDGEWIN10\IEUser │
    │                     │                    │          │           │             │ M                              │ red-team-master\atomics\T1056\   │                    │
    │                     │                    │          │           │             │                                │ Get-Keystrokes.ps1               │                    │
    ├─────────────────────┼────────────────────┼──────────┼───────────┼─────────────┼────────────────────────────────┼──────────────────────────────────┼────────────────────┤
    │ 2019-07-18 20:53:31 │ ‣ Windows Defender │ 1117     │ 106       │ MSEDGEWIN10 │ Trojan:XML/Exeselrun.gen!A     │ file:_C:\AtomicRedTeam\atomic-   │ MSEDGEWIN10\IEUser │
    │                     │                    │          │           │             │                                │ red-team-master\atomics\T1086\   │                    │
    │                     │                    │          │           │             │                                │ payloads\test.xsl                │                    │
    └─────────────────────┴────────────────────┴──────────┴───────────┴─────────────┴────────────────────────────────┴──────────────────────────────────┴────────────────────┘

    [+] Group: Log Tampering
    ┌─────────────────────┬───────────────────────────────┬──────────┬───────────┬────────────────────────────────┬───────────────┐
    │      timestamp      │          detections           │ Event ID │ Record ID │            Computer            │     User      │
    ├─────────────────────┼───────────────────────────────┼──────────┼───────────┼────────────────────────────────┼───────────────┤
    │ 2019-01-20 07:00:50 │ ‣ Security Audit Logs Cleared │ 1102     │ 32853     │ WIN-77LTAPHIQ1R.example.corp   │ Administrator │
    └─────────────────────┴───────────────────────────────┴──────────┴───────────┴────────────────────────────────┴───────────────┘[+] Group: Sigma
    ┌─────────────────────┬────────────────────────────────┬───────┬────────────────────────────────┬──────────┬───────────┬──────────────────────────┬──────────────────────────────────┐
    │      timestamp      │           detections           │ count │     Event.System.Provider      │ Event ID │ Record ID │         Computer         │            Event Data            │
    ├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
    │ 2019-04-29 20:59:14 │ ‣ Malicious Named Pipe         │ 1     │ Microsoft-Windows-Sysmon       │ 18       │ 8046      │ IEWIN7                   │ ---                              │
    │                     │                                │       │                                │          │           │                          │ Image: System                    │
    │                     │                                │       │                                │          │           │                          │ PipeName: "\\46a676ab7f179e511   │
    │                     │                                │       │                                │          │           │                          │ e30dd2dc41bd388"                 │
    │                     │                                │       │                                │          │           │                          │ ProcessGuid: 365ABB72-D9C4-5CC   │
    │                     │                                │       │                                │          │           │                          │ 7-0000-0010EA030000              │
    │                     │                                │       │                                │          │           │                          │ ProcessId: 4                     │
    │                     │                                │       │                                │          │           │                          │ RuleName: ""                     │
    │                     │                                │       │                                │          │           │                          │ UtcTime: "2019-04-29 20:59:14.   │
    │                     │                                │       │                                │          │           │                          │ 430"                             │
    ├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
    │ 2019-04-30 20:26:51 │ ‣ CobaltStrike Service         │ 1     │ Microsoft-Windows-Sysmon       │ 13       │ 9806      │ IEWIN7                   │ ---                              │
    │                     │ Installations in Registry      │       │                                │          │           │                          │ Details: "%%COMSPEC%% /b /c st   │
    │                     │                                │       │                                │          │           │                          │ art /b /min powershell.exe -no   │
    │                     │                                │       │                                │          │           │                          │ p -w hidden -noni -c \"if([Int   │
    │                     │                                │       │                                │          │           │                          │ Ptr]::Size -eq 4){$b='powershe   │
    │                     │                                │       │                                │          │           │                          │ ll.exe'}else{$b=$env:windir+'\   │
    │                     │                                │       │                                │          │           │                          │ \syswow64\\WindowsPowerShell\\   │
    │                     │                                │       │                                │          │           │                          │ v1.0\\powershell.exe'};$s=New-   │
    │                     │                                │       │                                │          │           │                          │ Object System.Diagnostics.Proc   │
    │                     │                                │       │                                │          │           │                          │ essStartInfo;$s.FileName=$b;$s   │
    │                     │                                │       │                                │          │           │                          │ .Arguments='-noni -nop -w hidd   │
    │                     │                                │       │                                │          │           │                          │ en -c &([scriptblock]::create(   │
    │                     │                                │       │                                │          │           │                          │ (New-Object IO.StreamReader(Ne   │
    │                     │                                │       │                                │          │           │                          │ w-Object IO.Compression.GzipSt   │
    │                     │                                │       │                                │          │           │                          │ ream((New-Object IO.MemoryStre   │
    │                     │                                │       │                                │          │           │                          │ am(,[Convert]::FromBase64Strin   │
    │                     │                                │       │                                │          │           │                          │ g(''H4sIAIuvyFwCA7VW+2/aSBD+OZ   │
    │                     │                                │       │                                │          │           │                          │ H6P1...                          │
    │                     │                                │       │                                │          │           │                          │ (use --full to show all content) │
    │                     │                                │       │                                │          │           │                          │ EventType: SetValue              │
    │                     │                                │       │                                │          │           │                          │ Image: "C:\\Windows\\system32\   │
    │                     │                                │       │                                │          │           │                          │ \services.exe"                   │
    │                     │                                │       │                                │          │           │                          │ ProcessGuid: 365ABB72-2586-5CC   │
    │                     │                                │       │                                │          │           │                          │ 9-0000-0010DC530000              │
    │                     │                                │       │                                │          │           │                          │ ProcessId: 460                   │
    │                     │                                │       │                                │          │           │                          │ RuleName: ""                     │
    │                     │                                │       │                                │          │           │                          │ TargetObject: "HKLM\\System\\C   │
    │                     │                                │       │                                │          │           │                          │ urrentControlSet\\services\\he   │
    │                     │                                │       │                                │          │           │                          │ llo\\ImagePath"                  │
    │                     │                                │       │                                │          │           │                          │ UtcTime: "2019-04-30 20:26:51.   │
    │                     │                                │       │                                │          │           │                          │ 934"                             │
    ├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
    │ 2019-05-12 12:52:43 │ ‣ Meterpreter or Cobalt        │ 1     │ Service Control Manager        │ 7045     │ 10446     │ IEWIN7                   │ ---                              │
    │                     │ Strike Getsystem Service       │       │                                │          │           │                          │ AccountName: LocalSystem         │
    │                     │ Installation                   │       │                                │          │           │                          │ ImagePath: "%COMSPEC% /c ping    │
    │                     │                                │       │                                │          │           │                          │ -n 1 127.0.0.1 >nul && echo 'W   │
    │                     │                                │       │                                │          │           │                          │ inPwnage' > \\\\.\\pipe\\WinPw   │
    │                     │                                │       │                                │          │           │                          │ nagePipe"                        │
    │                     │                                │       │                                │          │           │                          │ ServiceName: WinPwnage           │
    │                     │                                │       │                                │          │           │                          │ ServiceType: user mode service   │
    │                     │                                │       │                                │          │           │                          │ StartType: demand start          │
    ├─────────────────────┼────────────────────────────────┼───────┼────────────────────────────────┼──────────┼───────────┼──────────────────────────┼──────────────────────────────────┤
    │ 2019-06-21 07:35:37 │ ‣ Dumpert Process Dumper       │ 1     │ Microsoft-Windows-Sysmon       │ 11       │ 238375    │ alice.insecurebank.local │ ---                              │
    │                     │                                │       │                                │          │           │                          │ CreationUtcTime: "2019-06-21 0   │
    │                     │                                │       │                                │          │           │                          │ 6:53:03.227"                     │
    │                     │                                │       │                                │          │           │                          │ Image: "C:\\Users\\administrat   │
    │                     │                                │       │                                │          │           │                          │ or\\Desktop\\x64\\Outflank-Dum   │
    │                     │                                │       │                                │          │           │                          │ pert.exe"                        │
    │                     │                                │       │                                │          │           │                          │ ProcessGuid: ECAD0485-88C9-5D0   │
    │                     │                                │       │                                │          │           │                          │ C-0000-0010348C1D00              │
    │                     │                                │       │                                │          │           │                          │ ProcessId: 3572                  │
    │                     │                                │       │                                │          │           │                          │ RuleName: ""                     │
    │                     │                                │       │                                │          │           │                          │ TargetFilename: "C:\\Windows\\   │
    │                     │                                │       │                                │          │           │                          │ Temp\\dumpert.dmp"               │
    │                     │                                │       │                                │          │           │                          │ UtcTime: "2019-06-21 07:35:37.   │
    │                     │                                │       │                                │          │           │                          │ 324"                             │
    └─────────────────────┴────────────────────────────────┴───────┴────────────────────────────────┴──────────┴───────────┴──────────────────────────┴──────────────────────────────────┘

分析

Shimcache

root@kitploit:~
COMMAND:
    analyse shimcache                 Create an execution timeline from the shimcache with optional amcache enrichments

USAGE:
    chainsaw analyse shimcache [OPTIONS] <SHIMCACHE>

ARGUMENTS:
    <SHIMCACHE>                       The path to the shimcache artefact (SYSTEM registry file)

OPTIONS:
    -e, --regex <pattern>             A string or regular expression for detecting shimcache entries whose timestamp matches their insertion time
    -r, --regexfile <REGEX_FILE>      The path to a newline delimited file containing regex patterns for detecting shimcache entries whose timestamp matches their insertion time
    -o, --output <OUTPUT>             The path to output the result csv file
    -a, --amcache <AMCACHE>           The path to the amcache artefact (Amcache.hve) for timeline enrichment
    -p, --tspair                      Enable near timestamp pair detection between shimcache and amcache for finding additional insertion timestamps for shimcache entries
    -h, --help                        Print help
  • --regexfile パラメータ用のサンプルパターンファイルは analysis/shimcache_patterns.txt に含まれています。
  • 正規表現パターンは、shimcache エントリ内のパスを小文字に変換したものに対してマッチングされます。
コマンド例

指定された正規表現パターンを使用して shimcache アーティファクトを分析し、タイムスタンプの近接ペア検出を有効にした amcache エンリッチメントを使用します。csv ファイルに出力します。

root@kitploit:~
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt --amcache ./Amcache.hve --tspair --output ./output.csv

指定された正規表現パターンを使用して shimcache アーティファクトを分析します(amcache エンリッチメントなし)。ターミナルに出力します。

root@kitploit:~
./chainsaw analyse shimcache ./SYSTEM --regexfile ./analysis/shimcache_patterns.txt

Gaps(イベントログのギャップ検出)

1 つ以上の .evtx ファイル内における選択的なイベントログ改ざんの 2 つの指標を検出します:

  • RecordID ギャップ: チャネルごとの EventRecordID 値は通常、穴のない単調増加です。単一の evtx ファイル内の穴(つまり、ログローテーションの境界ではないもの)は異常であり、ノイズの多い「ログ消去」イベント(EID 1102)をトリガーせずに個々のレコードを外科的に削除するツール(例:Eventlogedit 系の手法)が残す指紋です。

  • 時間ギャップ: 通常は頻繁にイベントが記録されるチャネルにおいて、連続するイベント間に予期せず長い静穏期間が存在する場合、その期間内のレコードが削除された可能性を示唆します。しきい値は設定可能です。ホストごとのベースライン化はアナリストに委ねられます。

    COMMAND: analyse gaps Detect chronological or RecordID gaps in evtx files (possible selective record deletion)

    USAGE: chainsaw analyse gaps [OPTIONS] [PATH]...

    ARGUMENTS: [PATH]... The path(s) to evtx files or directories containing them

    OPTIONS: --min-time-gap-minutes Minimum time gap (in minutes) between consecutive events to flag as suspicious [default: 30] --no-record-id-gaps Skip RecordID gap detection (only flag time gaps) --no-time-gaps Skip time gap detection (only flag RecordID gaps) -j, --json Print the output in json format -o, --output Save the output to a file -q Suppress informational output --skip-errors Continue when an error is encountered -h, --help Print help

コマンド例

デフォルトの 30 分しきい値で、evtx ファイルのディレクトリを RecordID ギャップと時間ギャップの両方についてスキャンします:

root@kitploit:~
./chainsaw analyse gaps ./Logs/

選択的に削除されたレコード(RecordID の穴)のみを探し、機械可読な JSON を出力します:

root@kitploit:~
./chainsaw analyse gaps ./Logs/ --no-time-gaps --json -o ./gaps.json

SRUM(System Resource Usage Monitor)

Chainsaw に実装されている SRUM データベースパーサーは、テーブルに関するハードコードされた値に依存しない点で他のパーサーとは異なります。情報は SOFTWARE ハイブから直接抽出され、これは必須の引数です。目的は、未知のテーブルに関連するエラーを回避することです。

root@kitploit:~
COMMAND:
    analyse srum                             Analyse the SRUM database

USAGE:
    chainsaw analyse srum [OPTIONS] --software <SOFTWARE_HIVE_PATH> <SRUM_PATH>

ARGUMENTS:
    <SRUM_PATH>                              The path to the SRUM database

OPTIONS:
    -s, --software <SOFTWARE_HIVE_PATH>      The path to the SOFTWARE hive
        --stats-only                         Only output details about the SRUM database
    -q                                       Suppress informational output
    -o, --output <OUTPUT>                    Save the output to a file
    -h, --help                               Print help
コマンド例

SRUM データベースを分析します(SOFTWARE ハイブは必須)

root@kitploit:~
./chainsaw analyse srum --software ./SOFTWARE ./SRUDB.dat --output ./output.json
出力
root@kitploit:~
$ ./chainsaw analyse srum --software ./SOFTWARE ./SRUDB.dat -o ./output.json

     ██████╗██╗  ██╗ █████╗ ██╗███╗   ██╗███████╗ █████╗ ██╗    ██╗
    ██╔════╝██║  ██║██╔══██╗██║████╗  ██║██╔════╝██╔══██╗██║    ██║
    ██║     ███████║███████║██║██╔██╗ ██║███████╗███████║██║ █╗ ██║
    ██║     ██╔══██║██╔══██║██║██║╚██╗██║╚════██║██╔══██║██║███╗██║
    ╚██████╗██║  ██║██║  ██║██║██║ ╚████║███████║██║  ██║╚███╔███╔╝
     ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝ ╚══╝╚══╝
        By WithSecure Countercept (@FranticTyping, @AlexKornitzer)[+] ESE データベースファイルを "/home/user/Documents/SRUDB.dat" から読み込みました
    [+] ESE データベースを解析しています...
    [+] SOFTWARE ハイブを "/home/user/Documents/SOFTWARE" から読み込みました
    [+] SOFTWARE レジストリハイブを解析しています...
    [+] SRUM データベースを分析しています...
    [+] SRUM 拡張機能に関連するテーブルの詳細:
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | Table GUID                               | Table Name                                 | DLL Path                             | Timeframe of the data   | Expected Retention Time |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {5C8CF1C7-7257-4F13-B223-970EF5939312}   | App Timeline Provider                      | %SystemRoot%\System32\eeprov.dll     | 2022-03-10 16:34:59 UTC | 7 days                  |
    |                                          |                                            |                                      | 2022-03-10 21:10:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {B6D82AF1-F780-4E17-8077-6CB9AD8A6FC4}   | Tagged Energy Provider                     | %SystemRoot%\System32\eeprov.dll     | No records              | 3 days                  |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {D10CA2FE-6FCF-4F6D-848E-B2E99266FA86}   | WPN SRUM Provider                          | %SystemRoot%\System32\wpnsruprov.dll | 2022-03-10 20:09:00 UTC | 60 days                 |
    |                                          |                                            |                                      | 2022-03-10 21:09:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {D10CA2FE-6FCF-4F6D-848E-B2E99266FA89}   | Application Resource Usage Provider        | %SystemRoot%\System32\appsruprov.dll | 2022-03-10 16:34:59 UTC | 60 days                 |
    |                                          |                                            |                                      | 2022-03-10 21:10:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {FEE4E14F-02A9-4550-B5CE-5FA2DA202E37}   | Energy Usage Provider                      | %SystemRoot%\System32\energyprov.dll | No records              | 60 days                 |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {FEE4E14F-02A9-4550-B5CE-5FA2DA202E37}LT | Energy Usage Provider (Long Term)          | %SystemRoot%\System32\energyprov.dll | No records              | 1820 days               |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {973F5D5C-1D90-4944-BE8E-24B94231A174}   | Windows Network Data Usage Monitor         | %SystemRoot%\System32\nduprov.dll    | 2022-03-10 16:34:59 UTC | 60 days                 |
    |                                          |                                            |                                      | 2022-03-10 21:10:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {7ACBBAA3-D029-4BE4-9A7A-0885927F1D8F}   | vfuprov                                    | %SystemRoot%\System32\vfuprov.dll    | 2022-03-10 20:09:00 UTC | 60 days                 |
    |                                          |                                            |                                      | 2022-03-10 21:10:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {DA73FB89-2BEA-4DDC-86B8-6E048C6DA477}   | Energy Estimation Provider                 | %SystemRoot%\System32\eeprov.dll     | No records              | 7 days                  |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    | {DD6636C4-8929-4683-974E-22C046A43763}   | Windows Network Connectivity Usage Monitor | %SystemRoot%\System32\ncuprov.dll    | 2022-03-10 16:34:59 UTC | 60 days                 |
    |                                          |                                            |                                      | 2022-03-10 21:10:00 UTC |                         |
    +------------------------------------------+--------------------------------------------+--------------------------------------+-------------------------+-------------------------+
    [+] SRUM データベースの解析に成功しました
    [+] 出力を "/home/user/Documents/output.json" に保存しています
    [+] 出力を "/home/user/Documents/output.json" に保存しました
フォレンジックインサイト

このアーティファクトに関連する新しいフォレンジックインサイトに関する情報は、wiki で確認できます: https://github.com/WithSecureLabs/chainsaw/wiki/SRUM-Analysis。

ダンプ

root@kitploit:~
USAGE:
    chainsaw dump [OPTIONS] <PATH>

ARGUMENTS:
    <PATH>                  ダンプするアーティファクトへのパス

OPTIONS:
    -j, --json              json 形式でダンプする
        --jsonl             出力を jsonl 形式で表示する
        --load-unknown      chainsaw が識別できないファイルの読み込みを試みることを許可する
    -o, --output <OUTPUT>   結果を出力するパス
    -q                      情報出力を抑制する
        --skip-errors       エラーが発生した場合でもハントを続行する
    -h, --help              ヘルプを表示する

コマンド例

SOFTWARE ハイブをダンプする

root@kitploit:~
./chainsaw dump ./SOFTWARE.hve --json --output ./output.json

謝辞

  • EVTX-ATTACK-SAMPLES by @SBousseaden
  • Sigma 検出ルール
  • EVTX parser ライブラリ by @OBenamram
  • TAU Engine ライブラリ by @AlexKornitzer
  • Shimcache 分析機能は CC-Driver プロジェクトの一環として開発され、欧州連合の Horizon 2020 研究イノベーションプログラムの助成協定番号 883543 の下で資金提供を受けました
  • DFIRArtifactMuseum by Andrew Rathbun (@bunsofwrath12)
ツールをダウンロード
イベントタイプイベントID
プロセス作成 (Sysmon)1
ネットワーク接続 (Sysmon)3
イメージロード (Sysmon)7
ファイル作成 (Sysmon)11
レジストリイベント (Sysmon)13
Powershellスクリプトブロック4104
プロセス作成4688
スケジュールタスク作成4698
サービス作成7045