Win10存在本地提权0day漏洞
发布时间 2018-08-302018年8月27日,安全研究人员在Twitter上披露了Windows 10系统中的一个0day漏洞。该漏洞是一个本地提权漏洞,存在于Windows的任务调度服务中,允许攻击者从USER权限提权到SYSTEM权限。微软官方目前还没有提供相应的补丁。
二、漏洞影响范围
Windows 10
Windows Server 2016
三、漏洞分析
Microsoft Windows系统的任务调度服务中高级本地过程调用(ALPC)接口存在本地提权漏洞,该漏洞存在于schedsvc.dll模块中的SchRpcSetSecurity函数,SchRpcSetSecurity函数定义如下,函数功能是设置安全描述符。
HRESULT SchRpcSetSecurity(
[in, string] const wchar_t* path,
[in, string] const wchar_t* sddl,
[in] DWORD flags
);
SchRpcSetSecurity第一个参数为路径path,第二个参数为安全描述符定义语言 (SDDL) 字符串sddl,该函数内部调用了SetSecurity::RpcServer函数。
SetSecurity::RpcServer函数首先调用ConvertStringSecurityDescriptorToSecurityDescriptor 将SchRpcSetSecurity函数传入的sddl字符串转换为安全描述符SecurityDescriptor。并调用TaskPathCanonicalize函数对传入path参数路径规范化为Dst。
然后获取Dst路径的JobSecurity安全描述符pSecurityDescriptor,继而调用JobSecurity::Update函数,传入SecurityDescriptor参数,更新pSecurityDescriptor。
最后,调用JobSecurity::AddRemovePrincipalAce函数设置DACL。
那么如何修改指定目标文件的DACL属性呢?首先,使用ZwSetInformationFile函数为目标文件创建硬链接。然后,调用_SchRpcSetSecurity函数设置硬链接文件的DACL,等同于修改目标文件的DACL。通过设置SchRpcSetSecurity的第3个参数,可以为用户Administrators(BA)、Authenticated Users(AU)添加对硬链接文件的写入权限。
以PrintConfig.dll文件为例,调用SchRpcSetSecurity函数前,文件访问权限如下,此时Administrators不具有对文件的写入权限。
四、安全建议
不要运行未知来源的程序;
在微软更新补丁后,及时安装补丁。
五、参考链接
https://thehackernews.com/2018/08/windows-zero-day-exploit.html
https://www.kb.cert.org/vuls/id/906424