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
							
								
									f92c08e205
								
							
						
					
					
						commit
						a1ea1eb90b
					
				@ -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)
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
{{#include ../../banners/hacktricks-training.md}}
 | 
			
		||||
 | 
			
		||||
## 创建和挂载映像
 | 
			
		||||
## 创建和挂载镜像
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
@ -11,23 +11,50 @@
 | 
			
		||||
 | 
			
		||||
## 恶意软件分析
 | 
			
		||||
 | 
			
		||||
这**并不是在获得映像后必须执行的第一步**。但是如果你有一个文件、文件系统映像、内存映像、pcap...你可以独立使用这些恶意软件分析技术,所以**记住这些操作是好的**:
 | 
			
		||||
这**不一定是拿到镜像后首先要做的步骤**。但如果你有一个文件、文件系统镜像、内存镜像、pcap 等,你可以独立使用这些恶意软件分析技术,所以**记住这些操作很重要**:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
malware-analysis.md
 | 
			
		||||
{{#endref}}
 | 
			
		||||
 | 
			
		||||
## 检查映像
 | 
			
		||||
## 检查镜像
 | 
			
		||||
 | 
			
		||||
如果你获得了设备的**取证映像**,你可以开始**分析分区、文件系统**并**恢复**潜在的**有趣文件**(甚至是已删除的文件)。了解如何进行:
 | 
			
		||||
如果你被提供了设备的**取证镜像**,你可以开始**分析所使用的分区、文件系统**并**恢复**潜在的**重要文件**(甚至是已删除的)。在以下内容中了解如何:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#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}}
 | 
			
		||||
 | 
			
		||||
根据使用的操作系统甚至平台,应该搜索不同的有趣文物:
 | 
			
		||||
根据所用的操作系统(OSs)甚至平台,应该搜索不同的有趣痕迹:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
@ -44,9 +71,14 @@ linux-forensics.md
 | 
			
		||||
docker-forensics.md
 | 
			
		||||
{{#endref}}
 | 
			
		||||
 | 
			
		||||
## 深入检查特定文件类型和软件
 | 
			
		||||
 | 
			
		||||
如果你有非常**可疑的****文件**,那么**根据文件类型和创建它的软件**,可能会有几种**技巧**是有用的。\
 | 
			
		||||
{{#ref}}
 | 
			
		||||
ios-backup-forensics.md
 | 
			
		||||
{{#endref}}
 | 
			
		||||
 | 
			
		||||
## 针对特定文件类型和软件的深入检查
 | 
			
		||||
 | 
			
		||||
如果你有一个非常**可疑**的**文件**,那么**根据该文件的类型和生成它的软件**,一些**技巧**可能会很有用。\
 | 
			
		||||
阅读以下页面以了解一些有趣的技巧:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -54,7 +86,56 @@ docker-forensics.md
 | 
			
		||||
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}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 针对特定文件类型和软件的深入检查
 | 
			
		||||
 | 
			
		||||
如果你有一个非常**可疑**的**文件**,那么**根据该文件的类型和生成它的软件**,一些**技巧**可能会很有用。\
 | 
			
		||||
阅读以下页面以了解一些有趣的技巧:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
specific-software-file-type-tricks/
 | 
			
		||||
{{#endref}}
 | 
			
		||||
 | 
			
		||||
我要特别提及页面:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,124 @@
 | 
			
		||||
# iOS 备份取证(以消息为中心的初步检查)
 | 
			
		||||
 | 
			
		||||
{{#include ../../banners/hacktricks-training.md}}
 | 
			
		||||
 | 
			
		||||
本页描述了重建和分析 iOS 备份的实用步骤,以查找通过消息应用附件交付的 0‑click exploit 的迹象。重点是将 Apple 的哈希备份布局转换为可读路径,然后枚举并扫描常见应用中的附件。
 | 
			
		||||
 | 
			
		||||
目标:
 | 
			
		||||
- 从 Manifest.db 重建可读路径
 | 
			
		||||
- 枚举消息数据库(iMessage、WhatsApp、Signal、Telegram、Viber)
 | 
			
		||||
- 解析附件路径,提取嵌入对象(PDF/Images/Fonts),并将它们送入结构检测器
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 重建 iOS 备份
 | 
			
		||||
 | 
			
		||||
存储在 MobileSync 下的备份使用哈希文件名,不可读。Manifest.db SQLite 数据库将每个存储对象映射到其逻辑路径。
 | 
			
		||||
 | 
			
		||||
高层流程:
 | 
			
		||||
1) 打开 Manifest.db 并读取文件记录(domain, relativePath, flags, fileID/hash)
 | 
			
		||||
2) 基于 domain + relativePath 重建原始文件夹层次结构
 | 
			
		||||
3) 将每个存储对象复制或创建硬链接到其重建的路径
 | 
			
		||||
 | 
			
		||||
示例工作流:使用实现此端到端流程的工具(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!
 | 
			
		||||
```
 | 
			
		||||
注意:
 | 
			
		||||
- 通过向 extractor 提供备份密码来处理加密备份
 | 
			
		||||
- 在可能的情况下保留原始时间戳/ACLs 以保留证据价值
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 消息应用附件枚举
 | 
			
		||||
 | 
			
		||||
重建之后,对常用应用的附件进行枚举。具体 schema 会因应用/版本而异,但方法类似:查询消息数据库,将 message 与 attachment 关联,并解析磁盘上的路径。
 | 
			
		||||
 | 
			
		||||
### iMessage (sms.db)
 | 
			
		||||
关键表: message, attachment, message_attachment_join (MAJ), chat, chat_message_join (CMJ)
 | 
			
		||||
 | 
			
		||||
示例查询:
 | 
			
		||||
```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 rows 以获取磁盘上的路径。
 | 
			
		||||
 | 
			
		||||
示例(通用):
 | 
			
		||||
```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;
 | 
			
		||||
```
 | 
			
		||||
根据你的应用版本调整表/列名(ZWAMESSAGE/ZWAMEDIAITEM 在 iOS 构建中常见)。
 | 
			
		||||
 | 
			
		||||
### Signal / Telegram / Viber
 | 
			
		||||
- Signal: the message DB 是加密的;然而,缓存在磁盘上的附件(及缩略图)通常是可扫描的
 | 
			
		||||
- Telegram: 检查缓存目录(照片/视频/文档 缓存),并在可能时将其映射到聊天
 | 
			
		||||
- Viber: Viber.sqlite 包含带有磁盘引用的 message/attachment 表
 | 
			
		||||
 | 
			
		||||
Tip: 即使元数据被加密,扫描媒体/缓存 目录仍能发现恶意对象。
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 对附件进行结构化漏洞扫描
 | 
			
		||||
 | 
			
		||||
一旦获取到附件路径,将它们输入到结构化检测器,这些检测器验证文件格式的不变量而不是基于签名。以下以 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): 不可能的 JBIG2 字典状态
 | 
			
		||||
- WebP/VP8L BLASTPASS (CVE‑2023‑4863): 过大的 Huffman 表构造
 | 
			
		||||
- TrueType TRIANGULATION (CVE‑2023‑41990): 未记录的字节码操作码
 | 
			
		||||
- DNG/TIFF CVE‑2025‑43300: 元数据与流组件不匹配
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 验证、注意事项与误报
 | 
			
		||||
 | 
			
		||||
- 时间转换:iMessage 在某些版本中以 Apple epochs/units 存储日期;在报告时请做相应转换
 | 
			
		||||
- Schema drift:应用的 SQLite schema 随时间变化;请根据设备 build 确认表/列名
 | 
			
		||||
- 递归提取:PDFs 可能嵌入 JBIG2 流和字体;提取并扫描内部对象
 | 
			
		||||
- 误报:结构性启发式方法较为保守,但可能会标记罕见的格式异常但无害的媒体
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 参考资料
 | 
			
		||||
 | 
			
		||||
- [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}}
 | 
			
		||||
@ -2,40 +2,54 @@
 | 
			
		||||
 | 
			
		||||
{{#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 @@
 | 
			
		||||
# 结构化文件格式漏洞检测 (0‑Click Chains)
 | 
			
		||||
 | 
			
		||||
{{#include ../../../banners/hacktricks-training.md}}
 | 
			
		||||
 | 
			
		||||
本页总结了通过验证格式的结构不变量来检测 0‑click 移动利用文件的实用技术,而不是依赖字节签名。该方法可推广到不同样本、多态变体以及滥用相同解析器逻辑的未来漏洞利用。
 | 
			
		||||
 | 
			
		||||
关键思想:编码那些只有在到达易受攻击的解码器/解析器状态时才会出现的结构不可能性和跨字段不一致。
 | 
			
		||||
 | 
			
		||||
See also:
 | 
			
		||||
 | 
			
		||||
{{#ref}}
 | 
			
		||||
pdf-file-analysis.md
 | 
			
		||||
{{#endref}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 为什么用结构,而不是签名
 | 
			
		||||
 | 
			
		||||
当武器化样本不可用且载荷字节发生变化时,传统的 IOC/YARA 策略会失效。结构检测检查容器声明的布局与格式实现从数学或语义上可能的情况之间的差异。
 | 
			
		||||
 | 
			
		||||
常见检查:
 | 
			
		||||
- 验证由规范和安全实现推导出的表大小和边界
 | 
			
		||||
- 标记嵌入字节码中非法/未记录的操作码或状态转换
 | 
			
		||||
- 交叉校验元数据 VS 实际编码流组件
 | 
			
		||||
- 检测表明解析器混淆或整数溢出设置的矛盾字段
 | 
			
		||||
 | 
			
		||||
下面是针对多个高影响链的具体、经过实战验证的模式。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## PDF/JBIG2 – FORCEDENTRY (CVE‑2021‑30860)
 | 
			
		||||
 | 
			
		||||
Target: JBIG2 symbol dictionaries embedded inside PDFs (often used in mobile MMS parsing).
 | 
			
		||||
 | 
			
		||||
结构性信号:
 | 
			
		||||
- 会在正常内容中不可能出现的矛盾字典状态,而该状态是触发算术解码溢出的必要条件。
 | 
			
		||||
- 在细化编码期间,可疑地使用全局段并伴随异常的符号计数。
 | 
			
		||||
 | 
			
		||||
伪逻辑:
 | 
			
		||||
```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 规范验证算术编码标志和符号字典参数
 | 
			
		||||
 | 
			
		||||
Notes:
 | 
			
		||||
- 在没有嵌入 payload 签名的情况下也有效
 | 
			
		||||
- 实际中误报率低,因为被标记的状态在数学上不一致
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 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 容器的 chunks:VP8X + VP8L
 | 
			
		||||
- 解析 VP8L 前缀码并计算实际分配的表大小
 | 
			
		||||
 | 
			
		||||
注:
 | 
			
		||||
- 对 payload 的字节级多态性具有鲁棒性
 | 
			
		||||
- 界限来源于上游限制/补丁分析
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## TrueType – TRIANGULATION (CVE‑2023‑41990)
 | 
			
		||||
 | 
			
		||||
目标:位于 fpgm/prep/glyf 程序内的 TrueType 字节码。
 | 
			
		||||
 | 
			
		||||
结构信号:
 | 
			
		||||
- 利用链使用的 Apple 解释器中存在未记录/禁止的 opcode。
 | 
			
		||||
 | 
			
		||||
伪逻辑:
 | 
			
		||||
```pseudo
 | 
			
		||||
# Flag undocumented TrueType opcodes leveraged by TRIANGULATION
 | 
			
		||||
switch opcode:
 | 
			
		||||
case 0x8F, 0x90:
 | 
			
		||||
mark_malicious("Undocumented TrueType bytecode")
 | 
			
		||||
default:
 | 
			
		||||
continue
 | 
			
		||||
```
 | 
			
		||||
实用分类排查:
 | 
			
		||||
- 导出字体表(例如,使用 fontTools/ttx)并扫描 fpgm/prep/glyf 程序
 | 
			
		||||
- 对于存在性检查,不需要完全模拟解释器即可获得有价值的信息
 | 
			
		||||
 | 
			
		||||
注意:
 | 
			
		||||
- 如果非标准字体包含未知的 opcodes,可能会产生少见的误报;使用辅助工具进行验证
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## DNG/TIFF – CVE‑2025‑43300
 | 
			
		||||
 | 
			
		||||
Target: DNG/TIFF image metadata VS actual component count in encoded stream (e.g., JPEG‑Lossless SOF3).
 | 
			
		||||
 | 
			
		||||
结构性信号:
 | 
			
		||||
- EXIF/IFD 字段(SamplesPerPixel, PhotometricInterpretation)与从用于流水线的图像流头解析出的分量计数不一致。
 | 
			
		||||
 | 
			
		||||
伪逻辑:
 | 
			
		||||
```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)
 | 
			
		||||
- 采用流式/部分解析以最小化内存分配并支持早期终止
 | 
			
		||||
- 并行运行分析(线程池)以进行批量分流
 | 
			
		||||
 | 
			
		||||
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 提示与边缘情况
 | 
			
		||||
 | 
			
		||||
- 嵌入对象:PDF 可能嵌入图像 (JBIG2) 和字体 (TrueType);提取并递归扫描
 | 
			
		||||
- 解压安全:使用在分配前对表/缓冲区进行硬性限制的库
 | 
			
		||||
- 误报:保持规则保守,优先标记在规范下不可能出现的矛盾
 | 
			
		||||
- 版本漂移:当上游解析器更改限制时,重新基准化边界(例如 VP8L 表大小)
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 相关工具
 | 
			
		||||
 | 
			
		||||
- ElegantBouncer – 用于上述检测的结构化扫描器
 | 
			
		||||
- pdfid/pdf-parser/peepdf – PDF 对象提取和静态分析
 | 
			
		||||
- pdfcpu – PDF linter/清理器
 | 
			
		||||
- 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