简介
2020年3月,微软公布了一个影响范围堪称windows全版本的本地提权漏洞CVE-2020-0787,根据微软的漏洞描述,攻击者在使用低权限用户登录系统后,可以利用该漏洞构造恶意程序直接提权到administrator或者system权限。
漏洞概述
当Windows背景智能传输服务(BITS)没有正确处理符号链接时,存在特权提升漏洞。成功利用此漏洞的攻击者可以改写目标文件,从而提升权限。要利用这个漏洞,攻击者首先必须登录系统,攻击者可以运行EXP,利用该漏洞来提权进而完全控制受影响的系统。漏洞爆出后的安全更新通过纠正Windows BITS处理符号链接的方式修复了这个漏洞。
EXP进行利用的思路是,首先提供给目标服务一个文件夹路径,该路径最初将作为另一个“物理”目录的 junction (连接)点。我们创建了一个新的任务:“下载”一个本地文件,并且在TMP文件上设置 Oplock 。等任务恢复后,该服务会模拟 RPC 客户端身份开始写入 TMP 文件,触发 Oplock 。然后,我们需要将挂载点切换至对象目录(Object Directory),创建2个符号链接。此时TMP文件会指向我们拥有的任意文件,而“本地”文件将指向 System32 目录中的一个新的 dll 文件。在释放 Oplock 后,服务会继续写入原始的 TMP 文件,但会通过我们设置的2个符号链接执行最终的移动操作,这就是近几年来Windows漏洞中的一类 “任意文件移动” 漏洞,相对于内存破坏漏洞而言,这类漏洞不会导致目标主机蓝屏,在执行时有较高的稳定性和隐蔽性。
影响版本
Windows 10 Version 1809 for ARM64-based Systems
Windows Server 2008 for 32-bit Systems Service Pack 2
Windows RT 8.1
Windows 8.1 for x64-based systems
Windows 8.1 for 32-bit systems
Windows 7 for x64-based Systems Service Pack 1
Windows 7 for 32-bit Systems Service Pack 1
Windows Server 2016 (Server Core installation)
Windows Server 2016
Windows 10 Version 1607 for x64-based Systems
Windows 10 Version 1607 for 32-bit Systems
Windows 10 for x64-based Systems
Windows 10 for 32-bit Systems
Windows Server, version 1903 (Server Core installation)
Windows 10 Version 1903 for ARM64-based Systems
Windows 10 Version 1903 for x64-based Systems
Windows 10 Version 1903 for 32-bit Systems
Windows 10 Version 1709 for ARM64-based Systems
Windows 10 Version 1709 for x64-based Systems
Windows 10 Version 1709 for 32-bit Systems
Windows Server, version 1909 (Server Core installation)
Windows 10 Version 1909 for ARM64-based Systems
Windows 10 Version 1909 for x64-based Systems
Windows 10 Version 1909 for 32-bit Systems
Windows Server 2019 (Server Core installation)
Windows Server 2019
Windows Server 2012 R2 (Server Core installation)
Windows Server 2012 R2
Windows Server 2012 (Server Core installation)
Windows Server 2012
Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
Windows Server 2008 R2 for x64-based Systems Service Pack 1
Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
Windows Server 2008 for x64-based Systems Service Pack 2
Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
Windows 10 Version 1809 for x64-based Systems
Windows 10 Version 1809 for 32-bit Systems
Windows 10 Version 1803 for ARM64-based Systems
Windows Server, version 1803 (Server Core Installation)
Windows 10 Version 1803 for x64-based Systems
Windows 10 Version 1803 for 32-bit Systems
工具
exp:https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION/releases/download/1/BitsArbitraryFileMoveExploit.exe
靶机:windows10 1909
漏洞复现
(1)在靶机中打开cmd,运行exp
(2)运行完后会自动跳出一个新的cmd窗口
(3)可以看到窗口已经显示管理员,成功获取本地系统权限,可以以system权限执行任意操作