The malicious PDF initially reported to Microsoft as a potential exploit for an unknown Windows kernel vulnerability but the detailed research leads to find another 2 new zero-day exploit within the same PDF.
Initially, this malicious PDF discovered from virustotal which is uploaded by someone. At that time it wasn’t fully prepared to attack and the exploit was in an earlier stage of the development.
Zero-Day Exploitation Process
Later malicious JPEG 2000 stream triggers an out-of-bounds access operation and the access operation is called upon out-of-bounds memory laid out by the heap spray.
After that e corrupted vftable transfers execution into ROP chains then it transfers it into main shellcode.
Later Main EoP module loads through reflective DLL loading and finally it launch the Win32k EoP exploit.
After the successful exploitation, it will drop the .vbs file that designed to download additional payloads to compromise the Victims.
Main Win32k EoP Exploit
A loaded PE module exploits the main Win32k elevation-of-privilege (EoP) that was taking advantages of previously unknown vulnerability that affected the windows 7 machine and not present on Windows 10 and newer products.
This exploits using the NULL page to pass malicious records and copies arbitrary data to an arbitrary kernel location.
Intially exploit calls the DLL NtAllocateVirtualMemory to allocate a fake data structure at the NULL page.
According to Microsoft, the Exploit is working in following ways.
- It passes a malformed MEINFOEX structure to the SetImeInfoEx Win32k kernel function.
- SetImeInfoEx picks up the fake data structure allocated at the NULL page.
- The exploit uses the fake data structure to copy malicious instructions to +0x1a0 on the Global Descriptor Table (GDT).
- It calls an FWORD instruction to call into the fake GDT entry instructions.
- The exploit successfully calls instructions in the fake GDT entry.
- The instructions run shellcode allocated in user mode from kernel mode memory space.
Finally, the exploit modifies the EPROCESS.Token of the shellcode process and bypass the System and gain the access.
You can also read the ESET Research regarding this Double Zero day Exploits.
Indicators of compromise