mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['src/generic-methodologies-and-resources/basic-forensic-meth
This commit is contained in:
parent
105a8b5030
commit
0e752eab04
@ -41,6 +41,7 @@
|
||||
- [Anti-Forensic Techniques](generic-methodologies-and-resources/basic-forensic-methodology/anti-forensic-techniques.md)
|
||||
- [Docker Forensics](generic-methodologies-and-resources/basic-forensic-methodology/docker-forensics.md)
|
||||
- [Image Acquisition & Mount](generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md)
|
||||
- [Ios Backup Forensics](generic-methodologies-and-resources/basic-forensic-methodology/ios-backup-forensics.md)
|
||||
- [Linux Forensics](generic-methodologies-and-resources/basic-forensic-methodology/linux-forensics.md)
|
||||
- [Malware Analysis](generic-methodologies-and-resources/basic-forensic-methodology/malware-analysis.md)
|
||||
- [Memory dump analysis](generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/README.md)
|
||||
@ -61,6 +62,7 @@
|
||||
- [Office file analysis](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/office-file-analysis.md)
|
||||
- [PDF File analysis](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/pdf-file-analysis.md)
|
||||
- [PNG tricks](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/png-tricks.md)
|
||||
- [Structural File Format Exploit Detection](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/structural-file-format-exploit-detection.md)
|
||||
- [Video and Audio file analysis](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/video-and-audio-file-analysis.md)
|
||||
- [ZIPs tricks](generic-methodologies-and-resources/basic-forensic-methodology/specific-software-file-type-tricks/zips-tricks.md)
|
||||
- [Windows Artifacts](generic-methodologies-and-resources/basic-forensic-methodology/windows-forensics/README.md)
|
||||
|
@ -9,9 +9,9 @@
|
||||
../../generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md
|
||||
{{#endref}}
|
||||
|
||||
## マルウェア分析
|
||||
## マルウェア解析
|
||||
|
||||
これは**イメージを取得した後に最初に行うべきステップではありません**。しかし、ファイル、ファイルシステムイメージ、メモリイメージ、pcapなどがある場合は、このマルウェア分析技術を独立して使用できますので、**これらのアクションを念頭に置いておくことが重要です**。
|
||||
この作業は **イメージを入手した直後に必ず最初に行う必要があるわけではありません**。しかし、ファイル、ファイルシステムイメージ、メモリイメージ、pcap... を持っている場合は、これらのマルウェア解析手法を独立して使用できます。したがって、これらの操作を**念頭に置いておく**ことが有用です:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -20,14 +20,41 @@ malware-analysis.md
|
||||
|
||||
## イメージの検査
|
||||
|
||||
デバイスの**フォレンジックイメージ**が与えられた場合、**パーティションやファイルシステム**を**分析し**、潜在的に**興味深いファイル**(削除されたものも含む)を**回復する**ことができます。方法を学ぶには以下を参照してください。
|
||||
デバイスの**フォレンジックイメージ**が与えられた場合、使用されている**パーティションやファイルシステムの解析**を開始し、潜在的に**興味深いファイル**(削除されたものも含む)の**復元**を行うことができます。方法は次を参照してください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
partitions-file-systems-carving/
|
||||
{{#endref}}# 基本的なフォレンジック手法
|
||||
|
||||
|
||||
|
||||
## イメージの作成とマウント
|
||||
|
||||
|
||||
{{#ref}}
|
||||
../../generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md
|
||||
{{#endref}}
|
||||
|
||||
## マルウェア解析
|
||||
|
||||
この作業は **イメージを入手した直後に必ず最初に行う必要があるわけではありません**。しかし、ファイル、ファイルシステムイメージ、メモリイメージ、pcap... を持っている場合は、これらのマルウェア解析手法を独立して使用できます。したがって、これらの操作を**念頭に置いておく**ことが有用です:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
malware-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
## イメージの検査
|
||||
|
||||
デバイスの**フォレンジックイメージ**が与えられた場合、使用されている**パーティションやファイルシステムの解析**を開始し、潜在的に**興味深いファイル**(削除されたものも含む)の**復元**を行うことができます。方法は次を参照してください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
partitions-file-systems-carving/
|
||||
{{#endref}}
|
||||
|
||||
使用されるOSやプラットフォームによって、異なる興味深いアーティファクトを検索する必要があります。
|
||||
使用されている OS やプラットフォームによって、検索すべき興味深いアーティファクトは異なります:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -44,31 +71,36 @@ linux-forensics.md
|
||||
docker-forensics.md
|
||||
{{#endref}}
|
||||
|
||||
## 特定のファイルタイプとソフトウェアの深い検査
|
||||
|
||||
非常に**疑わしい****ファイル**がある場合、**ファイルタイプとそれを作成したソフトウェア**に応じて、いくつかの**トリック**が役立つかもしれません。\
|
||||
興味深いトリックを学ぶには以下のページをお読みください。
|
||||
{{#ref}}
|
||||
ios-backup-forensics.md
|
||||
{{#endref}}
|
||||
|
||||
## 特定のファイルタイプやソフトウェアの詳細な解析
|
||||
|
||||
非常に**疑わしい****ファイル**を持っている場合、そのファイルを作成した**ファイルタイプやソフトウェア**に応じて、いくつかの**トリック**が有効な場合があります。\
|
||||
次のページを読んで、いくつかの興味深いトリックを学んでください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/
|
||||
{{#endref}}
|
||||
|
||||
特に言及したいページがあります。
|
||||
特に次のページを推奨します:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/browser-artifacts.md
|
||||
{{#endref}}
|
||||
|
||||
## メモリダンプの検査
|
||||
## メモリダンプの解析
|
||||
|
||||
|
||||
{{#ref}}
|
||||
memory-dump-analysis/
|
||||
{{#endref}}
|
||||
|
||||
## Pcapの検査
|
||||
## pcap の解析
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -77,7 +109,7 @@ pcap-inspection/
|
||||
|
||||
## **アンチフォレンジック技術**
|
||||
|
||||
アンチフォレンジック技術の使用の可能性を念頭に置いてください。
|
||||
アンチフォレンジック技術が使用されている可能性を念頭に置いてください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -91,4 +123,53 @@ anti-forensic-techniques.md
|
||||
file-integrity-monitoring.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
|
||||
## 特定のファイルタイプやソフトウェアの詳細な解析
|
||||
|
||||
非常に**疑わしい****ファイル**を持っている場合、そのファイルを作成した**ファイルタイプやソフトウェア**に応じて、いくつかの**トリック**が有効な場合があります。\
|
||||
次のページを読んで、いくつかの興味深いトリックを学んでください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/
|
||||
{{#endref}}
|
||||
|
||||
特に次のページを推奨します:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/browser-artifacts.md
|
||||
{{#endref}}
|
||||
|
||||
## メモリダンプの解析
|
||||
|
||||
|
||||
{{#ref}}
|
||||
memory-dump-analysis/
|
||||
{{#endref}
|
||||
|
||||
## pcap の解析
|
||||
|
||||
|
||||
{{#ref}}
|
||||
pcap-inspection/
|
||||
{{#endref}
|
||||
|
||||
## **アンチフォレンジック技術**
|
||||
|
||||
アンチフォレンジック技術が使用されている可能性を念頭に置いてください:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
anti-forensic-techniques.md
|
||||
{{#endref}
|
||||
|
||||
## 脅威ハンティング
|
||||
|
||||
|
||||
{{#ref}}
|
||||
file-integrity-monitoring.md
|
||||
{{#endref}
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
||||
|
@ -0,0 +1,124 @@
|
||||
# iOS Backup Forensics (Messaging‑centric triage)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
||||
|
||||
このページでは、メッセージングアプリの添付ファイルを介した 0‑click エクスプロイト配信の痕跡を検出するため、iOS バックアップを再構築および解析する実践的な手順を説明します。Apple のハッシュ化されたバックアップレイアウトを人間が読めるパスに変換し、その後一般的なアプリの添付ファイルを列挙してスキャンすることに焦点を当てています。
|
||||
|
||||
Goals:
|
||||
- Manifest.db から読みやすいパスを再構築する
|
||||
- メッセージングデータベースを列挙する (iMessage, WhatsApp, Signal, Telegram, Viber)
|
||||
- 添付ファイルのパスを解決し、埋め込まれたオブジェクト(PDF/Images/Fonts)を抽出して、構造検出器に投入する
|
||||
|
||||
|
||||
## Reconstructing an iOS backup
|
||||
|
||||
MobileSync 配下に保存されたバックアップは、可読性のないハッシュ化されたファイル名を使用します。Manifest.db SQLite データベースは、保存された各オブジェクトを論理パスにマッピングします。
|
||||
|
||||
High‑level procedure:
|
||||
1) Manifest.db を開き、ファイルレコード(domain、relativePath、flags、fileID/hash)を読み取る
|
||||
2) domain + relativePath に基づいて元のフォルダ階層を再作成する
|
||||
3) 保存された各オブジェクトを再構築したパスにコピーまたはハードリンクする
|
||||
|
||||
Example workflow with a tool that implements this end‑to‑end (ElegantBouncer):
|
||||
```bash
|
||||
# Rebuild the backup into a readable folder tree
|
||||
$ elegant-bouncer --ios-extract /path/to/backup --output /tmp/reconstructed
|
||||
[+] Reading Manifest.db ...
|
||||
✓ iOS backup extraction completed successfully!
|
||||
```
|
||||
Notes:
|
||||
- 暗号化されたバックアップは、バックアップパスワードを抽出ツールに渡して処理する
|
||||
- 証拠価値のため、可能な限り元のタイムスタンプ/ACLを保持する
|
||||
|
||||
|
||||
## Messaging app attachment enumeration
|
||||
|
||||
復元後、主要なアプリの添付ファイルを列挙する。スキーマはアプリ/バージョンごとに異なるが、アプローチは類似している:messaging データベースをクエリし、message を attachment に結合し、ディスク上のパスを解決する。
|
||||
|
||||
### iMessage (sms.db)
|
||||
Key tables: message, attachment, message_attachment_join (MAJ), chat, chat_message_join (CMJ)
|
||||
|
||||
Example queries:
|
||||
```sql
|
||||
-- List attachments with basic message linkage
|
||||
SELECT
|
||||
m.ROWID AS message_rowid,
|
||||
a.ROWID AS attachment_rowid,
|
||||
a.filename AS attachment_path,
|
||||
m.handle_id,
|
||||
m.date,
|
||||
m.is_from_me
|
||||
FROM message m
|
||||
JOIN message_attachment_join maj ON maj.message_id = m.ROWID
|
||||
JOIN attachment a ON a.ROWID = maj.attachment_id
|
||||
ORDER BY m.date DESC;
|
||||
|
||||
-- Include chat names via chat_message_join
|
||||
SELECT
|
||||
c.display_name,
|
||||
a.filename AS attachment_path,
|
||||
m.date
|
||||
FROM chat c
|
||||
JOIN chat_message_join cmj ON cmj.chat_id = c.ROWID
|
||||
JOIN message m ON m.ROWID = cmj.message_id
|
||||
JOIN message_attachment_join maj ON maj.message_id = m.ROWID
|
||||
JOIN attachment a ON a.ROWID = maj.attachment_id
|
||||
ORDER BY m.date DESC;
|
||||
```
|
||||
添付ファイルのパスは絶対パスであるか、または再構築されたツリーの Library/SMS/Attachments/ 以下の相対パスである可能性があります。
|
||||
|
||||
### WhatsApp (ChatStorage.sqlite)
|
||||
一般的な関連付け: message table ↔ media/attachment table(名称はバージョンによって異なる)。media 行をクエリしてオンディスクのパスを取得する。
|
||||
|
||||
例(一般的):
|
||||
```sql
|
||||
SELECT
|
||||
m.Z_PK AS message_pk,
|
||||
mi.ZMEDIALOCALPATH AS media_path,
|
||||
m.ZMESSAGEDATE AS message_date
|
||||
FROM ZWAMESSAGE m
|
||||
LEFT JOIN ZWAMEDIAITEM mi ON mi.ZMESSAGE = m.Z_PK
|
||||
WHERE mi.ZMEDIALOCALPATH IS NOT NULL
|
||||
ORDER BY m.ZMESSAGEDATE DESC;
|
||||
```
|
||||
Adjust table/column names to your app version (ZWAMESSAGE/ZWAMEDIAITEM are common in iOS builds).
|
||||
|
||||
### Signal / Telegram / Viber
|
||||
- Signal: メッセージ DB は暗号化されているが、ディスクにキャッシュされた添付ファイル(サムネイルを含む)は通常スキャン可能
|
||||
- Telegram: キャッシュディレクトリ(photo/video/document caches)を調査し、可能な場合はチャットに紐付ける
|
||||
- Viber: Viber.sqlite はメッセージ/添付ファイルのテーブルを含み、オンディスク参照が存在する
|
||||
|
||||
ヒント: メタデータが暗号化されている場合でも、media/cache ディレクトリをスキャンすれば悪意のあるオブジェクトが検出されることがある。
|
||||
|
||||
|
||||
## 添付ファイルを構造的エクスプロイト用にスキャンする
|
||||
|
||||
添付ファイルのパスが取得できたら、それらを構造ベースの検出器に投入し、シグネチャの代わりにファイル形式の不変条件を検証させる。ElegantBouncer を使った例:
|
||||
```bash
|
||||
# Recursively scan only messaging attachments under the reconstructed tree
|
||||
$ elegant-bouncer --scan --messaging /tmp/reconstructed
|
||||
[+] Found N messaging app attachments to scan
|
||||
✗ THREAT in WhatsApp chat 'John Doe': suspicious_document.pdf → FORCEDENTRY (JBIG2)
|
||||
✗ THREAT in iMessage: photo.webp → BLASTPASS (VP8L)
|
||||
```
|
||||
構造ルールでカバーされる検出例には以下が含まれる:
|
||||
- PDF/JBIG2 FORCEDENTRY (CVE‑2021‑30860): impossible JBIG2 dictionary states
|
||||
- WebP/VP8L BLASTPASS (CVE‑2023‑4863): oversized Huffman table constructions
|
||||
- TrueType TRIANGULATION (CVE‑2023‑41990): undocumented bytecode opcodes
|
||||
- DNG/TIFF CVE‑2025‑43300: metadata vs. stream component mismatches
|
||||
|
||||
|
||||
## 検証、注意点、および誤検知
|
||||
|
||||
- Time conversions: iMessage stores dates in Apple epochs/units on some versions; convert appropriately during reporting
|
||||
- Schema drift: app SQLite schemas change over time; confirm table/column names per device build
|
||||
- Recursive extraction: PDFs may embed JBIG2 streams and fonts; extract and scan inner objects
|
||||
- False positives: structural heuristics are conservative but can flag rare malformed yet benign media
|
||||
|
||||
|
||||
## References
|
||||
|
||||
- [ELEGANTBOUNCER: When You Can't Get the Samples but Still Need to Catch the Threat](https://www.msuiche.com/posts/elegantbouncer-when-you-cant-get-the-samples-but-still-need-to-catch-the-threat/)
|
||||
- [ElegantBouncer project (GitHub)](https://github.com/msuiche/elegant-bouncer)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
@ -1,41 +1,55 @@
|
||||
# 特定のソフトウェア/ファイルタイプのトリック
|
||||
# 特定のソフトウェア/ファイルタイプ向けトリック
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
ここでは、特定のファイルタイプおよび/またはソフトウェアに関する興味深いトリックを見つけることができます:
|
||||
ここでは、特定のファイルタイプやソフトウェア向けの興味深いトリックを紹介します:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
.pyc.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
browser-artifacts.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
desofuscation-vbs-cscript.exe.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
local-cloud-storage.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
office-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
pdf-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
structural-file-format-exploit-detection.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
png-tricks.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
video-and-audio-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
zips-tricks.md
|
||||
{{#endref}}
|
||||
|
@ -0,0 +1,173 @@
|
||||
# Structural File‑Format Exploit Detection (0‑Click Chains)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
このページでは、バイト署名に依存する代わりにフォーマットの構造的不変量を検証することで、0‑clickのモバイル向けエクスプロイトファイルを検出する実践的手法をまとめる。 このアプローチはサンプルやポリモーフィックな亜種、同じパーサーロジックを悪用する将来のエクスプロイトにも一般化可能である。
|
||||
|
||||
Key idea: 脆弱なデコーダ/パーサ状態に到達したときにのみ現れる構造的に不可能な事象やフィールド間の矛盾を符号化すること。
|
||||
|
||||
See also:
|
||||
|
||||
{{#ref}}
|
||||
pdf-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
## Why structure, not signatures
|
||||
|
||||
武装化されたサンプルが入手できない、あるいはペイロードバイトが変化する場合、従来のIOC/YARAパターンは機能しない。構造的検出は、コンテナが宣言するレイアウトと、そのフォーマット実装にとって数学的または意味論的に可能な範囲とを比較検査する。
|
||||
|
||||
Typical checks:
|
||||
- 仕様や安全な実装から導出されるテーブルサイズや境界を検証する
|
||||
- 埋め込みバイトコード内の違法/未文書化のopcodesや状態遷移をフラグする
|
||||
- メタデータと実際のエンコード済みストリーム要素をクロスチェックする
|
||||
- パーサの混乱やinteger overflowのセットアップを示す矛盾するフィールドを検出する
|
||||
|
||||
以下は複数の高影響チェーンに対してフィールドで検証された具体的なパターンである。
|
||||
|
||||
---
|
||||
|
||||
## PDF/JBIG2 – FORCEDENTRY (CVE‑2021‑30860)
|
||||
|
||||
Target: JBIG2 symbol dictionaries embedded inside PDFs (often used in mobile MMS parsing).
|
||||
|
||||
Structural signals:
|
||||
- 通常のコンテンツでは発生し得ない矛盾した辞書状態で、arithmetic decodingにおけるオーバーフローを引き起こすために必要なもの
|
||||
- refinement coding中の異常なシンボル数と組み合わさったglobal segmentsの疑わしい使用
|
||||
|
||||
Pseudo‑logic:
|
||||
```pseudo
|
||||
# Detecting impossible dictionary state used by FORCEDENTRY
|
||||
if input_symbols_count == 0 and (ex_syms > 0 and ex_syms < 4):
|
||||
mark_malicious("JBIG2 impossible symbol dictionary state")
|
||||
```
|
||||
Practical triage:
|
||||
- PDFからJBIG2ストリームを特定して抽出する
|
||||
- ストリームの検索とダンプにpdfid/pdf-parser/peepdfを使用
|
||||
- 算術符号化フラグとシンボル辞書のパラメータをJBIG2 specに照らして検証する
|
||||
|
||||
Notes:
|
||||
- 埋め込まれたペイロード署名がなくても機能する
|
||||
- フラグ付けされた状態が数学的に矛盾しているため、実運用での偽陽性は少ない
|
||||
|
||||
---
|
||||
|
||||
## WebP/VP8L – BLASTPASS (CVE‑2023‑4863)
|
||||
|
||||
Target: WebP lossless (VP8L) Huffman prefix‑code tables.
|
||||
|
||||
Structural signals:
|
||||
- 構築されたHuffmanテーブルの合計サイズがリファレンス/パッチ適用済み実装で期待される安全上限を超えており、オーバーフローの前提条件を示唆する。
|
||||
|
||||
Pseudo‑logic:
|
||||
```pseudo
|
||||
# Detect malformed Huffman table construction triggering overflow
|
||||
let total_size = sum(table_sizes)
|
||||
if total_size > 2954: # example bound: FIXED_TABLE_SIZE + MAX_TABLE_SIZE
|
||||
mark_malicious("VP8L oversized Huffman tables")
|
||||
```
|
||||
実践的トリアージ:
|
||||
- WebP コンテナのチャンクを確認: VP8X + VP8L
|
||||
- VP8L のプレフィックスコードを解析し、実際に割り当てられたテーブルサイズを算出する
|
||||
|
||||
Notes:
|
||||
- payload のバイトレベルのポリモーフィズムに対して堅牢
|
||||
- 境界は上流の制限およびパッチ分析から導出される
|
||||
|
||||
---
|
||||
|
||||
## TrueType – TRIANGULATION (CVE‑2023‑41990)
|
||||
|
||||
Target: fpgm/prep/glyf プログラム内の TrueType bytecode.
|
||||
|
||||
Structural signals:
|
||||
- exploit chain で使用される Apple の interpreter に、ドキュメント化されていない/禁止された opcodes が存在する。
|
||||
|
||||
Pseudo‑logic:
|
||||
```pseudo
|
||||
# Flag undocumented TrueType opcodes leveraged by TRIANGULATION
|
||||
switch opcode:
|
||||
case 0x8F, 0x90:
|
||||
mark_malicious("Undocumented TrueType bytecode")
|
||||
default:
|
||||
continue
|
||||
```
|
||||
Practical triage:
|
||||
- フォントテーブルをダンプ(例: fontTools/ttx を使用)し、fpgm/prep/glyf プログラムをスキャンする
|
||||
- 存在チェックから得られる情報のためにインタプリタを完全にエミュレートする必要はない
|
||||
|
||||
Notes:
|
||||
- 非標準フォントに未知の opcodes が含まれる場合、稀に FPs を生むことがある; 二次的なツールで検証すること
|
||||
|
||||
---
|
||||
|
||||
## DNG/TIFF – CVE‑2025‑43300
|
||||
|
||||
Target: DNG/TIFF 画像のメタデータと、エンコードされたストリーム内の実際のコンポーネント数(例: JPEG‑Lossless SOF3)との不一致
|
||||
|
||||
Structural signals:
|
||||
- パイプラインが使用するイメージストリームヘッダから解析されたコンポーネント数と、EXIF/IFD フィールド(SamplesPerPixel, PhotometricInterpretation)との不一致。
|
||||
|
||||
Pseudo‑logic:
|
||||
```pseudo
|
||||
# Metadata claims 2 samples per pixel but stream header exposes only 1 component
|
||||
if samples_per_pixel == 2 and sof3_components == 1:
|
||||
mark_malicious("DNG/TIFF metadata vs. stream mismatch")
|
||||
```
|
||||
Practical triage:
|
||||
- 主要な IFD と EXIF タグを解析する
|
||||
- 埋め込まれた JPEG‑Lossless ヘッダ (SOF3) を特定して解析し、コンポーネント数を比較する
|
||||
|
||||
Notes:
|
||||
- 実際の攻撃で悪用が報告されている。構造的一貫性チェックの優れた候補
|
||||
|
||||
---
|
||||
|
||||
## Implementation patterns and performance
|
||||
|
||||
A practical scanner should:
|
||||
- ファイルタイプを自動検出し、関連するアナライザのみをディスパッチする (PDF/JBIG2, WebP/VP8L, TTF, DNG/TIFF)
|
||||
- 割り当てを最小化し早期終了を可能にするためにストリーム/部分解析を行う
|
||||
- バルクトリアージのために解析を並列(thread‑pool)で実行する
|
||||
|
||||
Example workflow with ElegantBouncer (open‑source Rust implementation of these checks):
|
||||
```bash
|
||||
# Scan a path recursively with structural detectors
|
||||
$ elegant-bouncer --scan /path/to/directory
|
||||
|
||||
# Optional TUI for parallel scanning and real‑time alerts
|
||||
$ elegant-bouncer --tui --scan /path/to/samples
|
||||
```
|
||||
---
|
||||
|
||||
## DFIR のヒントとエッジケース
|
||||
|
||||
- Embedded objects: PDFs may embed images (JBIG2) and fonts (TrueType); extract and recursively scan
|
||||
- Decompression safety: use libraries that hard‑limit tables/buffers before allocation
|
||||
- False positives: keep rules conservative, favor contradictions that are impossible under the spec
|
||||
- Version drift: re‑baseline bounds (e.g., VP8L table sizes) when upstream parsers change limits
|
||||
|
||||
---
|
||||
|
||||
## 関連ツール
|
||||
|
||||
- ElegantBouncer – 上記の検出向けの構造的スキャナ
|
||||
- pdfid/pdf-parser/peepdf – PDFオブジェクトの抽出と静的解析
|
||||
- pdfcpu – PDFのリンタ/サニタイズツール
|
||||
- fontTools/ttx – TrueTypeのテーブルとバイトコードをダンプする
|
||||
- exiftool – TIFF/DNG/EXIF メタデータを読む
|
||||
- dwebp/webpmux – WebPのメタデータとチャンクを解析する
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- [ELEGANTBOUNCER: When You Can't Get the Samples but Still Need to Catch the Threat](https://www.msuiche.com/posts/elegantbouncer-when-you-cant-get-the-samples-but-still-need-to-catch-the-threat/)
|
||||
- [ElegantBouncer project (GitHub)](https://github.com/msuiche/elegant-bouncer)
|
||||
- [Researching FORCEDENTRY: Detecting the exploit with no samples](https://www.msuiche.com/posts/researching-forcedentry-detecting-the-exploit-with-no-samples/)
|
||||
- [Researching BLASTPASS – Detecting the exploit inside a WebP file (Part 1)](https://www.msuiche.com/posts/researching-blastpass-detecting-the-exploit-inside-a-webp-file-part-1/)
|
||||
- [Researching BLASTPASS – Analysing the Apple & Google WebP PoC file (Part 2)](https://www.msuiche.com/posts/researching-blastpass-analysing-the-apple-google-webp-poc-file-part-2/)
|
||||
- [Researching TRIANGULATION – Detecting CVE‑2023‑41990 with single‑byte signatures](https://www.msuiche.com/posts/researching-triangulation-detecting-cve-2023-41990-with-single-byte-signatures/)
|
||||
- [CVE‑2025‑43300: Critical vulnerability found in Apple’s DNG image processing](https://www.msuiche.com/posts/cve-2025-43300-critical-vulnerability-found-in-apples-dng-image-processing/)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
Loading…
x
Reference in New Issue
Block a user