
PrintNightmare , escalade de privilèges locale de CVE-2021-1675 ou CVE-2021-34527
Exploit LPE simple de la CVE-2021-1675
CVE-2021-1675-LPE.exe C:\test\MyPigDLL.dll
MyPigDLL.dll est une DLL de test qui créera C:\test.txt en cas de succès
EnumPrinterDriversW pour obtenir pDriverPath, ce qui évite de devoir modifier le chemin codé en dur du pilote à chaque foispDriverPath sur Windows Server 2008 estinfo.pDriverPath = (LPWSTR)L"C:\\Windows\\System32\\DriverStore\\FileRepository\\ntprint.inf_amd64_neutral_4616c3de1949be6d\\Amd64\\UNIDRV.DLL";
Je ne peux pas obtenir ce chemin via EnumPrinterDriversW, donc modifiez info.pDriverPath dans le code source si vous souhaitez tester cet exploit sur Windows Server 2008
Dans certaines situations, il a aussi des bugs... veuillez déboguer avec le code source brut : )
Tests réussis sur :
Microsoft Windows Server 2012 R2 Datacenter [版本 6.3.9600]
Microsoft Windows 10 专业版 [版本 10.0.19041.685]
Microsoft Windows Server 2008 R2 Enterprise [版本 6.1.7601]