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
3e67399be5
commit
c0ab524bb3
@ -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}}
|
||||
|
||||
## 악성코드 분석
|
||||
## Malware Analysis
|
||||
|
||||
이 **단계는 이미지를 확보한 후 반드시 수행해야 하는 첫 번째 단계는 아닙니다**. 하지만 파일, 파일 시스템 이미지, 메모리 이미지, pcap...가 있다면 이 악성코드 분석 기법을 독립적으로 사용할 수 있으므로 **이 작업들을 염두에 두는 것이 좋습니다**:
|
||||
이것은 **이미지를 확보한 후 반드시 가장 먼저 수행해야 하는 단계는 아닙니다**. 하지만 파일, file-system image, memory image, pcap 등이 있다면 이 malware analysis 기술들을 독립적으로 사용할 수 있으므로 이러한 작업들을 **염두에 두는 것이 좋습니다**:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -20,14 +20,41 @@ malware-analysis.md
|
||||
|
||||
## 이미지 검사
|
||||
|
||||
장치의 **포렌식 이미지**가 주어지면 **파티션, 파일 시스템**을 **분석하고** 잠재적으로 **흥미로운 파일**(삭제된 파일 포함)을 **복구**할 수 있습니다. 방법을 배우려면:
|
||||
만약 장치의 **forensic image**가 주어진다면 사용된 **partitions, file-system**을 분석하고 잠재적으로 **흥미로운 파일들**(삭제된 파일 포함)을 **복구**하는 작업을 시작할 수 있습니다. 방법은 다음을 참조하세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
partitions-file-systems-carving/
|
||||
{{#endref}}# 기본 포렌식 방법론
|
||||
|
||||
|
||||
|
||||
## 이미지 생성 및 마운트
|
||||
|
||||
|
||||
{{#ref}}
|
||||
../../generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md
|
||||
{{#endref}}
|
||||
|
||||
## Malware Analysis
|
||||
|
||||
이것은 **이미지를 확보한 후 반드시 가장 먼저 수행해야 하는 단계는 아닙니다**. 하지만 파일, file-system image, memory image, pcap 등이 있다면 이 malware analysis 기술들을 독립적으로 사용할 수 있으므로 이러한 작업들을 **염두에 두는 것이 좋습니다**:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
malware-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
## 이미지 검사
|
||||
|
||||
만약 장치의 **forensic image**가 주어진다면 사용된 **partitions, file-system**을 분석하고 잠재적으로 **흥미로운 파일들**(삭제된 파일 포함)을 **복구**하는 작업을 시작할 수 있습니다. 방법은 다음을 참조하세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
partitions-file-systems-carving/
|
||||
{{#endref}}
|
||||
|
||||
사용된 OS 및 플랫폼에 따라 다양한 흥미로운 아티팩트를 검색해야 합니다:
|
||||
사용된 OS나 플랫폼에 따라 검색해야 할 다양한 흥미로운 artifacts가 있습니다:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -44,47 +71,101 @@ linux-forensics.md
|
||||
docker-forensics.md
|
||||
{{#endref}}
|
||||
|
||||
## 특정 파일 유형 및 소프트웨어에 대한 심층 검사
|
||||
|
||||
매우 **의심스러운** **파일**이 있는 경우, **파일 유형 및 이를 생성한 소프트웨어**에 따라 여러 **트릭**이 유용할 수 있습니다.\
|
||||
흥미로운 트릭을 배우려면 다음 페이지를 읽어보세요:
|
||||
{{#ref}}
|
||||
ios-backup-forensics.md
|
||||
{{#endref}}
|
||||
|
||||
## 특정 파일형식 및 소프트웨어의 심층 검사
|
||||
|
||||
매우 **의심스러운** **파일**이 있는 경우, 해당 파일을 생성한 **file-type 및 software**에 따라 여러 가지 유용한 **트릭**이 있을 수 있습니다.\
|
||||
다음 페이지를 읽어 몇 가지 흥미로운 트릭을 확인하세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/
|
||||
{{#endref}}
|
||||
|
||||
특히 언급하고 싶은 페이지는 다음과 같습니다:
|
||||
특히 다음 페이지를 별도로 언급하고 싶습니다:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/browser-artifacts.md
|
||||
{{#endref}}
|
||||
|
||||
## 메모리 덤프 검사
|
||||
## Memory Dump Inspection
|
||||
|
||||
|
||||
{{#ref}}
|
||||
memory-dump-analysis/
|
||||
{{#endref}}
|
||||
|
||||
## Pcap 검사
|
||||
## Pcap Inspection
|
||||
|
||||
|
||||
{{#ref}}
|
||||
pcap-inspection/
|
||||
{{#endref}}
|
||||
|
||||
## **안티 포렌식 기법**
|
||||
## **Anti-Forensic Techniques**
|
||||
|
||||
안티 포렌식 기법의 사용 가능성을 염두에 두세요:
|
||||
anti-forensic techniques의 사용 가능성을 염두에 두세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
anti-forensic-techniques.md
|
||||
{{#endref}}
|
||||
|
||||
## 위협 헌팅
|
||||
## Threat Hunting
|
||||
|
||||
|
||||
{{#ref}}
|
||||
file-integrity-monitoring.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
|
||||
## 특정 파일형식 및 소프트웨어의 심층 검사
|
||||
|
||||
매우 **의심스러운** **파일**이 있는 경우, 해당 파일을 생성한 **file-type 및 software**에 따라 여러 가지 유용한 **트릭**이 있을 수 있습니다.\
|
||||
다음 페이지를 읽어 몇 가지 흥미로운 트릭을 확인하세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/
|
||||
{{#endref}}
|
||||
|
||||
특히 다음 페이지를 별도로 언급하고 싶습니다:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
specific-software-file-type-tricks/browser-artifacts.md
|
||||
{{#endref}}
|
||||
|
||||
## Memory Dump Inspection
|
||||
|
||||
|
||||
{{#ref}}
|
||||
memory-dump-analysis/
|
||||
{{#endref}}
|
||||
|
||||
## Pcap Inspection
|
||||
|
||||
|
||||
{{#ref}}
|
||||
pcap-inspection/
|
||||
{{#endref}}
|
||||
|
||||
## **Anti-Forensic Techniques**
|
||||
|
||||
anti-forensic techniques의 사용 가능성을 염두에 두세요:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
anti-forensic-techniques.md
|
||||
{{#endref}}
|
||||
|
||||
## Threat Hunting
|
||||
|
||||
|
||||
{{#ref}}
|
||||
|
@ -0,0 +1,124 @@
|
||||
# iOS Backup Forensics (Messaging‑centric triage)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
||||
|
||||
이 페이지는 메시징 앱 첨부 파일을 통한 0‑click exploit 전달 흔적을 찾기 위해 iOS 백업을 복원하고 분석하는 실무적 절차를 설명합니다. Apple의 해시된 백업 레이아웃을 사람이 읽을 수 있는 경로로 변환한 다음, 일반 앱 전반의 첨부 파일을 열거하고 스캔하는 데 중점을 둡니다.
|
||||
|
||||
Goals:
|
||||
- Manifest.db로부터 읽을 수 있는 경로 재구성
|
||||
- 메시징 데이터베이스 열거 (iMessage, WhatsApp, Signal, Telegram, Viber)
|
||||
- 첨부 파일 경로 해석, 포함된 객체 추출 (PDF/이미지/폰트), 및 구조 기반 탐지기에 전달
|
||||
|
||||
|
||||
## 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!
|
||||
```
|
||||
참고:
|
||||
- 암호화된 백업은 백업 비밀번호를 추출 도구에 제공하여 처리하세요
|
||||
- 증거 가치를 위해 가능하면 원본 타임스탬프/ACL을 보존하세요
|
||||
|
||||
|
||||
## 메시징 앱 첨부파일 열거
|
||||
|
||||
재구성 후, 인기 있는 앱들의 첨부파일을 열거하세요. 정확한 스키마는 앱/버전마다 다르지만 접근 방식은 유사합니다: 메시징 데이터베이스를 쿼리하고, 메시지를 첨부파일에 조인한 다음 디스크상의 경로를 확인합니다.
|
||||
|
||||
### 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 (이름은 버전마다 다름). on‑disk 경로를 얻기 위해 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: 캐시 디렉터리(사진/비디오/문서 캐시)를 검사하고 가능하면 채팅과 매핑하세요
|
||||
- Viber: Viber.sqlite에는 message/attachment 테이블이 있으며 디스크상의 참조를 포함합니다
|
||||
|
||||
팁: 메타데이터가 암호화되어 있어도 media/cache 디렉터리를 스캔하면 악성 객체가 여전히 드러납니다.
|
||||
|
||||
|
||||
## Scanning attachments for structural exploits
|
||||
|
||||
첨부파일 경로를 확보한 후에는, 서명(signatures) 대신 파일 포맷의 불변성(invariants)을 검증하는 구조적 탐지기(structural detectors)에 입력하세요. Example with 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): 과도하게 큰 허프만 테이블 구성
|
||||
- TrueType TRIANGULATION (CVE‑2023‑41990): 문서화되지 않은 바이트코드 옵코드
|
||||
- DNG/TIFF CVE‑2025‑43300: 메타데이터와 스트림 구성 요소 간 불일치
|
||||
|
||||
|
||||
## 검증, 주의사항 및 오탐
|
||||
|
||||
- 시간 변환: 일부 버전에서 iMessage는 날짜를 Apple epoch/단위로 저장합니다; 보고 시 적절히 변환하세요
|
||||
- Schema drift: 앱의 SQLite 스키마는 시간이 지나며 변경됩니다; 기기 빌드별 테이블/열 이름을 확인하세요
|
||||
- Recursive extraction: PDFs는 JBIG2 스트림과 폰트를 포함할 수 있습니다; 내부 객체를 추출하여 스캔하세요
|
||||
- False positives: 구조적 휴리스틱은 보수적이지만 드물게 손상되었지만 무해한 미디어를 표시할 수 있습니다
|
||||
|
||||
|
||||
## 참고자료
|
||||
|
||||
- [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,8 +1,8 @@
|
||||
# 특정 소프트웨어/파일 유형 트릭
|
||||
# 특정 소프트웨어/파일 형식 팁
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
여기에서 특정 파일 유형 및/또는 소프트웨어에 대한 흥미로운 트릭을 찾을 수 있습니다:
|
||||
여기에서는 특정 파일 형식 및/또는 소프트웨어에 대한 흥미로운 팁을 제공합니다:
|
||||
|
||||
|
||||
{{#ref}}
|
||||
@ -35,6 +35,11 @@ pdf-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
structural-file-format-exploit-detection.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
{{#ref}}
|
||||
png-tricks.md
|
||||
{{#endref}}
|
||||
|
@ -0,0 +1,173 @@
|
||||
# Structural File‑Format Exploit Detection (0‑Click Chains)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
이 페이지는 바이트 시그니처에 의존하지 않고 포맷의 구조적 불변성을 검증하여 0‑click 모바일 exploit 파일을 탐지하는 실무 기법을 요약합니다. 이 접근법은 샘플, polymorphic 변종, 및 동일한 parser 로직을 악용하는 향후 exploits에 대해 일반화됩니다.
|
||||
|
||||
Key idea: 취약한 decoder/parser 상태에 도달했을 때에만 나타나는 구조적 불가능성과 필드 간 불일치를 인코딩하는 것.
|
||||
|
||||
See also:
|
||||
|
||||
{{#ref}}
|
||||
pdf-file-analysis.md
|
||||
{{#endref}}
|
||||
|
||||
|
||||
## 왜 구조를 사용하는가, 시그니처가 아닌가
|
||||
|
||||
무기화된 샘플을 구할 수 없고 payload 바이트가 변형되면 전통적인 IOC/YARA 패턴은 실패합니다. 구조 기반 탐지는 컨테이너가 선언한 레이아웃을 해당 포맷 구현에서 수학적·의미론적으로 가능한 것과 비교합니다.
|
||||
|
||||
Typical checks:
|
||||
- 스펙(spec)과 안전한 구현에서 파생된 테이블 크기 및 경계값을 검증
|
||||
- 임베디드 bytecode에서 불법/문서화되지 않은 opcodes나 상태 전환을 플래그
|
||||
- metadata와 실제 인코딩된 스트림 구성 요소를 교차 검증
|
||||
- parser의 혼란이나 integer overflow 설정을 나타내는 모순된 필드를 탐지
|
||||
|
||||
Below are concrete, field‑tested patterns for multiple high‑impact chains.
|
||||
|
||||
---
|
||||
|
||||
## PDF/JBIG2 – FORCEDENTRY (CVE‑2021‑30860)
|
||||
|
||||
Target: JBIG2 symbol dictionaries embedded inside PDFs (often used in mobile MMS parsing).
|
||||
|
||||
Structural signals:
|
||||
- 정상 콘텐츠에서는 발생할 수 없지만 arithmetic decoding에서 오버플로우를 유발하기 위해 필요한 모순된 dictionary 상태
|
||||
- refinement coding 동안 비정상적인 symbol 개수와 결합된 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")
|
||||
```
|
||||
실무 트리아지:
|
||||
- PDF에서 JBIG2 스트림을 식별하고 추출
|
||||
- pdfid/pdf-parser/peepdf를 사용해 스트림을 찾고 덤프
|
||||
- JBIG2 spec에 따라 산술 부호화 플래그(arithmetic coding flags)와 심볼 사전 매개변수(symbol dictionary parameters) 검증
|
||||
|
||||
참고:
|
||||
- 임베디드 payload 서명 없이 동작
|
||||
- 실무에서 오탐률이 낮음 — 플래그된 상태가 수학적으로 일관되지 않기 때문
|
||||
|
||||
---
|
||||
|
||||
## WebP/VP8L – BLASTPASS (CVE‑2023‑4863)
|
||||
|
||||
대상: WebP lossless (VP8L) Huffman prefix‑code tables.
|
||||
|
||||
구조적 신호:
|
||||
- 구성된 Huffman 테이블의 전체 크기가 참조/패치된 구현들이 기대하는 안전 상한을 초과하여, 오버플로우 발생 전제를 시사함.
|
||||
|
||||
의사 로직:
|
||||
```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 프리픽스 코드를 파싱하고 실제 할당된 테이블 크기 계산
|
||||
|
||||
참고:
|
||||
- payload의 바이트 수준 다형성에 대해 강건함
|
||||
- 경계는 upstream의 제한/패치 분석에서 도출됨
|
||||
|
||||
---
|
||||
|
||||
## TrueType – TRIANGULATION (CVE‑2023‑41990)
|
||||
|
||||
대상: fpgm/prep/glyf 프로그램 내부의 TrueType bytecode.
|
||||
|
||||
구조적 신호:
|
||||
- 문서화되지 않았거나 금지된 opcodes가 exploit chain에서 사용되는 Apple의 interpreter에 존재함.
|
||||
|
||||
의사 로직:
|
||||
```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 프로그램을 스캔
|
||||
- presence checks만으로도 가치를 얻을 수 있으므로 인터프리터를 완전히 에뮬레이트할 필요 없음
|
||||
|
||||
참고:
|
||||
- 비표준 폰트가 알 수 없는 opcodes를 포함하면 드물게 오탐(FP)을 발생시킬 수 있음; 보조 툴로 검증
|
||||
|
||||
---
|
||||
|
||||
## DNG/TIFF – CVE‑2025‑43300
|
||||
|
||||
대상: DNG/TIFF 이미지 메타데이터 VS 인코딩된 스트림의 실제 컴포넌트 수(예: 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
|
||||
|
||||
실무용 스캐너는:
|
||||
- 파일 유형을 자동 감지하고 관련 분석기(PDF/JBIG2, WebP/VP8L, TTF, DNG/TIFF)만 실행
|
||||
- 할당을 최소화하고 조기 종료를 가능하게 하기 위해 스트리밍/부분 파싱 수행
|
||||
- 대량 triage를 위해 분석을 스레드 풀(thread‑pool)로 병렬 실행
|
||||
|
||||
Example workflow with ElegantBouncer (이 검사들의 오픈소스 Rust 구현):
|
||||
```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: 할당 전에 테이블/버퍼를 하드 제한하는 라이브러리 사용
|
||||
- False positives: 규칙을 보수적으로 유지하고, 스펙상 불가능한 모순을 우선시
|
||||
- Version drift: 업스트림 파서가 제한을 변경할 때 경계값(예: VP8L table sizes)을 재기준화
|
||||
|
||||
---
|
||||
|
||||
## Related tools
|
||||
|
||||
- ElegantBouncer – 위의 탐지에 대한 구조적 스캐너
|
||||
- pdfid/pdf-parser/peepdf – PDF object extraction and static analysis
|
||||
- pdfcpu – PDF linter/sanitizer
|
||||
- fontTools/ttx – dump TrueType tables and bytecode
|
||||
- exiftool – read TIFF/DNG/EXIF metadata
|
||||
- dwebp/webpmux – parse WebP metadata and chunks
|
||||
|
||||
---
|
||||
|
||||
## 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