Last active
March 25, 2020 13:32
-
-
Save karimelmel/47172266083bc587265bf902f36e0d93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Apply-MitigationADV20006.ps1 | |
Implements mitigation for ADV200006 | |
PowerShell. x64 only. | |
#> | |
function Apply-MitigationADV20006 | |
{ | |
#Set Location to System32 | |
Set-Location -Path $env:windir"\system32\" | |
$Exists = Test-Path .\atmfd.dll | |
if ($Exists -eq $true) { | |
#Gets the current ACL and modifies it to grant "INTERACTIVE" Full Control. | |
$ObjectAcl = Get-Acl .\atmfd.dll | |
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("INTERACTIVE","FullControl","Allow") | |
#Sets the Acl for the object. | |
$ObjectAcl.SetAccessRule($AccessRule) | |
$ObjectAcl | Set-Acl .\atmfd.dll | |
Rename-Item -LiteralPath .\atmfd.dll -NewName x-atmfd.dll -Verbose | |
Write-Output "Mitigation added.." | |
} | |
else { | |
Write-Output "DLL not found.." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment