首页
社区
课程
招聘
[推荐] 从 Windows 10 开始,ntdll 增加了一个称为 'ProtectedPolicies' 的安全特性
发表于: 2017-4-12 15:16 2748

[推荐] 从 Windows 10 开始,ntdll 增加了一个称为 'ProtectedPolicies' 的安全特性

2017-4-12 15:16
2748
原文:80cK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4u0W2k6s2m8D9j5h3W2@1i4K6u0W2j5X3I4G2k6%4y4H3L8%4c8Q4x3X3g2U0L8$3#2Q4x3V1j5J5x3o6p5%4i4K6u0r3x3o6c8Q4x3V1k6F1N6r3c8D9L8q4)9J5k6s2m8J5L8%4c8W2j5%4c8W2k6s2m8G2L8r3W2U0K9h3g2K6i4K6u0W2K9s2c8E0L8l9`.`.


ntdll ProtectedPolicies

It seems that since windows 10 ntdll has security feature called "ProtectedPolicies" - you can query it with RtlQueryProtectedPolicyfunction. Prototype of this function is:
NTAPI NTSTATUS RtlQueryProtectedPolicy(GUID *, PDWORD out_flag);

Lets see how it works:
loc_6A277EFB:   ; CODE XREF: RtlQueryProtectedPolicy(x,x)+12 j

  push    edi

  mov     edi, offset _RtlpProtectedPoliciesSRWLock

  push    edi

  call    _RtlAcquireSRWLockShared@4    ; RtlAcquireSRWLockShared(x)

  push    offset _RtlpSearchProtectedPolicyEntry ; PtFuncCompare

  push    14h                           ; SizeOfElements

  push    ds:_RtlpProtectedPoliciesActiveCount ; NumOfElements

  push    ds:_RtlpProtectedPolicies     ; Base

  push    [ebp+Key]                     ; Key

  call    _bsearch
That policies stored in array RtlpProtectedPolicies, count located inRtlpProtectedPoliciesActiveCount and size of each policy is 0x14 bytes (0x18 under x64), so each policy looks like struct:
struct protected_policy
{
  IID guid;
  DWORD flag;
};

Lets see from where RtlQueryProtectedPolicy called

ntdll.dll:
  • from RtlpAddVectoredHandler with GUID {1FC98BCA-1BA9-4397-93F9-349EAD41E057}
  • from RtlGuardCheckLongJumpTarget with GUID {4F6AE3A6-8B1B-4623-A293-294CD743BBD1}
kernel32.dll:
  • from CheckForReadOnlyResourceFilter with GUID GUID_BasepAllowResourceConversion {739C343A-F3E1-4ED8-AC66-8435FEB7C5A5}
KernelBase.dll:



[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回