-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathWindows10_ExploitGuard-Config.ps1
More file actions
28 lines (21 loc) · 1.55 KB
/
Windows10_ExploitGuard-Config.ps1
File metadata and controls
28 lines (21 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$WindowsVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" -Name CurrentVersion).CurrentVersion
$WindowsRelease = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" -Name ReleaseID).ReleaseId
if ($WindowsVersion -ne "6.3") { throw "Exploit-Guard Configuration only supported on Windows 10, but Version is $WindowsVersion" }
if ($WindowsRelease -lt 1709) { throw "Exploit-Guard Configuration only supported on Windows 10 Release 1709 and higher, but Release is $WindowsRelease" }
Write-Host "Removing all Process Mitigations"
Write-Host "---------------------------------------------------------------------"
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\Remove-all-ProcessMitigations.ps1
Write-Host "---------------------------------------------------------------------"
Write-Host "Resetting ExploitGuard System-Settings"
Set-ProcessMitigation -System -Reset
$XMLConfig = ".\Windows10-v" + $WindowsRelease + "_ExploitGuard-DefaultSettings.xml"
if (Test-Path $XMLConfig) {
Write-Host "Applying $XMLConfig"
Set-ProcessMitigation -PolicyFilePath $XMLConfig
} else { Write-Host "ERROR: Config-File $XMLConfig for Windows 10 Release $WindowsRelease is missing!" }
$XMLConfig = ".\Windows10-v" + $WindowsRelease + "_ExploitGuard-Security-Baseline.xml"
if (Test-Path $XMLConfig) {
Write-Host "Applying $XMLConfig"
Set-ProcessMitigation -PolicyFilePath $XMLConfig
} else { Write-Host "ERROR: Config-File $XMLConfig for Windows 10 Release $WindowsRelease is missing!" }