Win32k Dark Composition
Attacking the Shadow Part of Graphic Subsystem
@360Vulcan Team Peng Qiu (@pgboy) SheFang Zhong (@zhong_sf)
Win32k Dark Composition Attacking the Shadow Part of Graphic - - PowerPoint PPT Presentation
Win32k Dark Composition Attacking the Shadow Part of Graphic Subsystem Peng Qiu (@pgboy) SheFang Zhong (@zhong_sf) @360Vulcan Team About US Member of 360 vulcan team. Windows kernel security researcher Pwn2Own winners 2015 .pwned IE pwn2own
Attacking the Shadow Part of Graphic Subsystem
@360Vulcan Team Peng Qiu (@pgboy) SheFang Zhong (@zhong_sf)
Member of 360 vulcan team. Windows kernel security researcher Pwn2Own winners 2016
.pwned Chrome pwn2own 2016 .pwned Flash pwn2own 2016
Pwnfest winners 2016
.pwned Edge PwnFest 2016 .pwned Flash PwnFest 2016
Pwn2Own winners 2015
.pwned IE pwn2own 2015
dwmcore dcomp
. . .
userland kernel
DirectComposiAon CApplicaAonChannel visual
CExpressionMarshaler CFilterEffectMarshaler CScaleTransformMarshaler . . .
submit DWM (desktop windows manager) DXGK (directX graphic kernel) call
Significant Change since win10 RS1
Remove lots of interface. 10+? Lots of funcAon has been rewrite, not fix vuln Add some interface. eg:
Exist independently and some in the win32k filter table
all included in
This func1on is out of Win32k filter list
need later
CScaleTransformMarshaler CTranslateTransformMarshaler CRectangleClipMarshaler CBaseClipMarshaler CSharedSecAonMarshaler CMatrixTransformMarshaler CMatrixTransform3DMarshaler CShadowEffectMarshaler
. . .
By default is 1, we increase those funcAon’s probability to 100.
Free the resource(visual)'s property buffer forget to clear resource->Databuffer. result in free again when resource is free
First time free
Res1
First time free
ResY Free this one Res2 Res3 Res4 … Res1 palette Occupy with palette Res2 Res3 Res4 … Res1 palette Free palette Res2 Res3 Res4 …
Second time free
Res1 ResX Occupy with ResX Res2 Res3 Res4 …
Modify the palette->pEntries to what you want when
palette
pEntries
ResX- >DataBuf
xxxxx
Content Replace
palette
pEntries
bitma p
pScan0
Usually, cover palette1->pEntries to a bitmap address
Read & Write primity Replace process token, exploited
when process exit
DataBuffer, because they share the same kernel buffer
handle table when process exit
handle from handle table before process exit
Clear ResX->DataBuffer
find the channel that Resource belongs to.
_EPROCESS->Win32Process->GenericTable
GenericTable channel1 channel2 channel3 channel4 channel5
Resource address store in channel's resource table
Resource table in channel implement as a array
void* ptrNull=0; AddressWrite(&ResX->DataBuffer, sizeof(void*), &ptrNull);
Clear
Integer overflow while dataOffset < DataSize-0xc if DataSize < 0xc
If (dwOffet < (DWORD)(0x1-0xc)) { if (DataBuffer[dwOffset]==0x66) { DataBuffer[dwOffset+0xc]=xxxx; } }
&& this->DataSize==0
1.this->Databuffer must not NULL 2.this->DataSize < 0xC && this->DataSize!=0 3.*(this->Databuffer + inbuf->offset)==(0x45 or 0x66)
1.this->Databuffer must not NULL
we could call CPropertyBagMarshaler::SetBufferProperty(...) with property==2 to alloc a buffer, then store in this->DataBuffer
Spray lots of bufferX to enable that bufferX behind this->DataBuffer
DataBuffer
bufferX ...
Calc inbuf->offset value, it must be saAsfy:
bufferX
DataBuffer bufferX
...
Offset
0xc Flied1 Flied2
DataBuffer
bitmap
...
Offset 0xc Height pScan0
Now, bitmap->pScan0 has benn changed to the value we set. so we got Read/Write primary
Replace ps token, exploited !
Write what? tagWND.strName ? (UNICODE_STRING)
GetWindowText ? NtUserDefSetText ?
Unfortunately, the destination address has been modify when write to,
just desktop heap range is legal.
Maybe
Pwn2Own:KeenTeam used once. HackingTeam leaked 0day. Someone write it to a public paper
Pwn2Own: We used Twice. Pwn2Own: KeenTeam used Once.
We use Acclerator Object To Guess Bitmap Object Address. Then We used Twice again in PwnFast. Coresecurity guys release a paper to talk about is.
14393 VS 15xxx:
But Only The Object which Allocate at desktop heap: