Structural File‑Format Exploit Detection (0‑Click Chains)
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
This page summarizes practical techniques to detect 0‑click mobile exploit files by validating structural invariants of their formats instead of relying on byte signatures. The approach generalizes across samples, polymorphic variants, and future exploits that abuse the same parser logic.
Key idea: encode structural impossibilities and cross‑field inconsistencies that only appear when a vulnerable decoder/parser state is reached.
See also:
Why structure, not signatures
When weaponized samples are unavailable and payload bytes mutate, traditional IOC/YARA patterns fail. Structural detection inspects the container’s declared layout versus what is mathematically or semantically possible for the format implementation.
Typical checks:
- Validate table sizes and bounds derived from the spec and safe implementations
- Flag illegal/undocumented opcodes or state transitions in embedded bytecode
- Cross‑check metadata VS actual encoded stream components
- Detect contradictory fields that indicate parser confusion or integer overflow set‑ups
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:
- Contradictory dictionary state that cannot occur in benign content but is required to trigger the overflow in arithmetic decoding.
- Suspicious use of global segments combined with abnormal symbol counts during refinement coding.
Pseudo‑logic:
# 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 streams को पहचानें और निकालें
- pdfid/pdf-parser/peepdf का उपयोग करके streams को locate और dump करें
- JBIG2 spec के अनुरूप arithmetic coding flags और symbol dictionary parameters को verify करें
Notes:
- Embedded payload signatures के बिना भी काम करता है
- प्रैक्टिस में Low FP क्योंकि flagged state गणितीय रूप से inconsistent है
WebP/VP8L – BLASTPASS (CVE‑2023‑4863)
लक्ष्य: WebP lossless (VP8L) Huffman prefix‑code tables.
संरचनात्मक संकेत:
- Constructed Huffman tables का कुल आकार reference/patched implementations द्वारा अपेक्षित सुरक्षित ऊपरी सीमा से अधिक है, जो overflow precondition का संकेत देता है।
छद्म‑लॉजिक:
# 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 container chunks की जाँच करें: VP8X + VP8L
- VP8L prefix codes को पार्स करें और वास्तविक आवंटित तालिका आकारों की गणना करें
नोट्स:
- payload के बाइट‑लेवल polymorphism के खिलाफ मजबूत
- Bound upstream limits/patch analysis से निकाला गया है
TrueType – TRIANGULATION (CVE‑2023‑41990)
लक्ष्य: TrueType bytecode fpgm/prep/glyf programs के अंदर।
संरचनात्मक संकेत:
- exploit chain द्वारा उपयोग किए गए Apple के interpreter में undocumented/forbidden opcodes की उपस्थिति।
छद्म‑लॉजिक:
# Flag undocumented TrueType opcodes leveraged by TRIANGULATION
switch opcode:
case 0x8F, 0x90:
mark_malicious("Undocumented TrueType bytecode")
default:
continue
Practical triage:
- font tables को डंप करें (e.g., using fontTools/ttx) और fpgm/prep/glyf programs स्कैन करें
- presence checks से वैल्यू पाने के लिए interpreter को पूरी तरह emulate करने की ज़रूरत नहीं
Notes:
- यदि nonstandard fonts में unknown opcodes शामिल हों तो यह rare FPs पैदा कर सकता है; secondary tooling से validate करें
DNG/TIFF – CVE‑2025‑43300
Target: DNG/TIFF image metadata VS actual component count in encoded stream (e.g., JPEG‑Lossless SOF3).
Structural signals:
- EXIF/IFD fields (SamplesPerPixel, PhotometricInterpretation) और pipeline द्वारा उपयोग किए गए image stream header से parsed component count के बीच inconsistency।
Pseudo‑logic:
# 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:
- वास्तविक दुनिया में शोषित होने की रिपोर्ट मिली है; संरचनात्मक सुसंगता जाँच के लिए उत्कृष्ट उम्मीदवार
DNG/TIFF – Samsung libimagecodec.quram.so (CVE‑2025‑21042) + संलग्न ZIP payload (LANDFALL)
Target: DNG (TIFF‑derived) images जिनमें EOF पर एक एमबे़डेड ZIP archive अपेंड किया गया होता है ताकि parser RCE के बाद native payloads स्टेज किए जा सकें।
Structural signals:
- File magic संकेत करता है कि यह TIFF/DNG (
II*\x00orMM\x00*) है पर filename JPEG की नकल करता है (उदा.,.jpg/.jpegWhatsApp नामकरण)। - EOF के पास ZIP Local File Header या EOCD magic (
PK\x03\x04orPK\x05\x06) की उपस्थिति जो किसी भी TIFF IFD डेटा क्षेत्र (strips/tiles/JPEGInterchangeFormat) द्वारा संदर्भित नहीं है। - असामान्य रूप से बड़ा ट्रेलिंग डेटा अंतिम संदर्भित IFD डेटा ब्लॉक के बाद मौजूद है (सैकड़ों KB से MB तक), जो .so मॉड्यूल्स के बंडल किए गए आर्काइव के अनुरूप है।
Pseudo‑logic:
# Detect appended ZIP payload hidden after DNG/TIFF data (Samsung chain)
if is_tiff_dng(magic):
ext = file_extension()
if ext in {".jpg", ".jpeg"}: mark_suspicious("Extension/magic mismatch: DNG vs JPEG")
zip_off = rfind_any(["PK\x05\x06", "PK\x03\x04"], search_window_last_n_bytes=8*1024*1024)
if zip_off >= 0:
end_dng = approx_end_of_tiff_data() # max(end of Strip/Tile/JPEGInterchangeFormat regions)
if zip_off > end_dng + 0x200:
mark_malicious("DNG with appended ZIP payload (LANDFALL‑style)")
व्यावहारिक ट्रायेज:
- फ़ॉर्मेट बनाम नाम पहचानें:
- file sample; exiftool -s -FileType -MIMEType sample
- EOF के पास ZIP footer/header खोजें और carve करें:
- off=$(grep -aboa -E $‘PK\x05\x06|PK\x03\x04’ sample.dng | tail -n1 | cut -d: -f1)
- dd if=sample.dng of=payload.zip bs=1 skip=“$off”
- zipdetails -v payload.zip; unzip -l payload.zip
- सुनिश्चित करें कि TIFF डेटा क्षेत्र carved ZIP क्षेत्र के साथ overlap न करें:
- tiffdump -D sample.dng | egrep ‘StripOffsets|TileOffsets|JPEGInterchangeFormat|StripByteCounts|TileByteCounts|JPEGInterchangeFormatLength’
- सत्यापित करें
max(offset+length) << zip_off - One‑shot carving (coarse): binwalk -eM sample.dng
Notes:
- वाइल्ड में Samsung’s libimagecodec.quram.so (CVE‑2025‑21042) के खिलाफ exploited किया गया। जुड़ी हुई ZIP में native modules (e.g., loader + SELinux policy editor) थे, जिन्हें post‑RCE में extracted/executed किया गया।
कार्यान्वयन पैटर्न और प्रदर्शन
एक व्यावहारिक स्कैनर को:
- फ़ाइल प्रकार को ऑटो‑डिटेक्ट करें और केवल संबंधित analyzers (PDF/JBIG2, WebP/VP8L, TTF, DNG/TIFF) को भेजें
- allocations को कम करने और early termination सक्षम करने के लिए stream/partial‑parse का प्रयोग करें
- बड़े पैमाने पर ट्रायेज के लिए analyses को parallel (thread‑pool) में चलाएँ
ElegantBouncer (open‑source Rust implementation of these checks) के साथ उदाहरण वर्कफ़्लो:
# 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 सुझाव और किनारे के मामले
- एम्बेडेड ऑब्जेक्ट्स: PDFs में छवियाँ (JBIG2) और फ़ॉन्ट्स (TrueType) एम्बेड हो सकते हैं; इन्हें निकालें और पुनरावर्ती रूप से स्कैन करें
- डिकम्प्रेशन सुरक्षा: आवंटन से पहले टेबल/बफ़र पर हार्ड‑लिमिट लगाने वाली लाइब्रेरीज़ का उपयोग करें
- False positives: नियमों को कंज़र्वेटिव रखें; उन विरोधाभासों को प्राथमिकता दें जो विनिर्देश के अनुसार असंभव हों
- Version drift: जब upstream पार्सर सीमाएँ बदलें तो सीमाओं को पुनर्बेसलाइन करें (उदाहरण: VP8L टेबल आकार)
संबंधित टूल
- ElegantBouncer – ऊपर दिए गए डिटेक्शनों के लिए structural स्कैनर
- pdfid/pdf-parser/peepdf – PDF ऑब्जेक्ट निकालना और स्थैतिक विश्लेषण
- pdfcpu – PDF लिंटर/सैनिटाइज़र
- fontTools/ttx – TrueType टेबल और बाइटकोड डंप करें
- exiftool – TIFF/DNG/EXIF मेटाडेटा पढ़ें
- dwebp/webpmux – WebP मेटाडेटा और chunks पार्स करें
संदर्भ
- ELEGANTBOUNCER: When You Can’t Get the Samples but Still Need to Catch the Threat
- ElegantBouncer project (GitHub)
- Researching FORCEDENTRY: Detecting the exploit with no samples
- Researching BLASTPASS – Detecting the exploit inside a WebP file (Part 1)
- Researching BLASTPASS – Analysing the Apple & Google WebP PoC file (Part 2)
- Researching TRIANGULATION – Detecting CVE‑2023‑41990 with single‑byte signatures
- CVE‑2025‑43300: Critical vulnerability found in Apple’s DNG image processing
- LANDFALL: New Commercial-Grade Android Spyware in Exploit Chain Targeting Samsung Devices
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।


