Windows TCP/IP远程执行代码漏洞分析( 三 )


所以length设置为4,其实和length=3计算结果是相同的:
(4-1)/2 = 1(3-1)/2 = 1因此会按照0x18(一个ipv6地址加上Type/Length/ Reserved/Lifetime) 的偏移进行解析下一个Option,即解析到伪造的Option 。
调用Ipv6UpdateRDNSS前:
kd> dt ndis!_NET_BUFFER @r14+0x000 Next: (null)+0x008 CurrentMdl: 0xffffe20b`aea77e70 _MDL+0x010 CurrentMdlOffset : 0x10+0x018 DataLength: 0x188+0x018 stDataLength: 0x188+0x020 MdlChain: 0xffffe20b`b0a9c220 _MDL+0x028 DataOffset: 0x70+0x000 Link: _SLIST_HEADER+0x000 NetBufferHeader: _NET_BUFFER_HEADER+0x030 ChecksumBias: 0+0x032 Reserved: 0+0x038 NdisPoolHandle: 0xffffe20b`ae45cb40 Void+0x040 NdisReserved: [2] (null)+0x050 ProtocolReserved : [6] 0x00000198`00000000 Void+0x080 MiniportReserved : [4] (null)+0x0a0 DataPhysicalAddress : _LARGE_INTEGER 0x0+0x0a8 SharedMemoryInfo : (null)+0x0a8 ScatterGatherList : (null) kd> dt ndis!_MDL 0xffffe20b`aea77e70+0x000 Next: 0xffffe20b`aea77b10 _MDL+0x008 Size: 0n56+0x00a MdlFlags: 0n4+0x00c AllocationProcessorNumber : 0xffff+0x00e Reserved: 0xffff+0x010 Process: (null)+0x018 MappedSystemVa: 0xffffe20b`aea77eb0 Void+0x020 StartVa: 0xffffe20b`aea77000 Void+0x028 ByteCount: 0x30+0x02c ByteOffset: 0xeb0kd> db 0xffffe20b`aea77eb0+0x10ffffe20b`aea77ec019 04 00 00 00 00 03 84-30 30 30 30 30 30 30 30........00000000// <--- Option1ffffe20b`aea77ed030 30 30 30 30 30 30 30-18 22 fd 81 00 00 03 8400000000."......ffffe20b`aea77ee000 bf 09 02 73 6d 41 72-00 00 03 00 dd bf 04 04....smAr........调用Ipv6UpdateRDNSS后:
kd> dt ndis!_NET_BUFFER @r14+0x000 Next: (null)+0x008 CurrentMdl: 0xffffe20b`aea77e70 _MDL+0x010 CurrentMdlOffset : 0x28+0x018 DataLength: 0x170+0x018 stDataLength: 0x170+0x020 MdlChain: 0xffffe20b`b0a9c220 _MDL+0x028 DataOffset: 0x88+0x000 Link: _SLIST_HEADER+0x000 NetBufferHeader: _NET_BUFFER_HEADER+0x030 ChecksumBias: 0+0x032 Reserved: 0+0x038 NdisPoolHandle: 0xffffe20b`ae45cb40 Void+0x040 NdisReserved: [2] (null)+0x050 ProtocolReserved : [6] 0x00000198`00000000 Void+0x080 MiniportReserved : [4] (null)+0x0a0 DataPhysicalAddress : _LARGE_INTEGER 0x0+0x0a8 SharedMemoryInfo : (null)+0x0a8 ScatterGatherList : (null) kd> dt ndis!_MDL 0xffffe20b`aea77e70+0x000 Next: 0xffffe20b`aea77b10 _MDL+0x008 Size: 0n56+0x00a MdlFlags: 0n4+0x00c AllocationProcessorNumber : 0xffff+0x00e Reserved: 0xffff+0x010 Process: (null)+0x018 MappedSystemVa: 0xffffe20b`aea77eb0 Void+0x020 StartVa: 0xffffe20b`aea77000 Void+0x028 ByteCount: 0x30+0x02c ByteOffset: 0xeb0kd> db 0xffffe20b`aea77eb0+0x28ffffe20b`aea77ed818 22 fd 81 00 00 03 84-00 bf 09 02 73 6d 41 72."..........smAr // <---伪造的optionffffe20b`aea77ee800 00 03 00 dd bf 04 04-00 60 6d b0 0b e2 ff ff.........`m.....(3)进入循环2中的【3】处case:0x18,处理伪造的type为0x18,length为0x22的option 。
对于type为0x18会进入下面的流程处理,调用NdisGetDataBuffer函数,其中第二个参数为长度的实际字节大小,等于length


推荐阅读