Skip to content

How to remediate the applocker rules: #1

@Karkas66

Description

@Karkas66

For those of you who want to disable the actions the program did, just execute the following Powershell commands:

# Temporary file for empty xml
$tempPath = [System.IO.Path]::GetTempFileName()

$emptyPolicy = @'
<AppLockerPolicy Version="1">
  <RuleCollection Type="Exe" EnforcementMode="NotConfigured" />
  <RuleCollection Type="Msi" EnforcementMode="NotConfigured" />
  <RuleCollection Type="Script" EnforcementMode="NotConfigured" />
  <RuleCollection Type="Dll" EnforcementMode="NotConfigured" />
  <RuleCollection Type="Appx" EnforcementMode="NotConfigured" />
</AppLockerPolicy>
'@

Set-Content -Path $tempPath -Value $emptyPolicy -Encoding UTF8

Write-Host '[*] Removing AppLocker policy (setting to NotConfigured)...'

Set-AppLockerPolicy -XmlPolicy $tempPath -ErrorAction Stop
Remove-Item $tempPath -Force
Write-Host '[*] Forcing Group Policy update...'
gpupdate /force | Out-Null
Write-Host '[+] AppLocker policy has been reset to "NotConfigured" (disabled).'

You could have implemented a remediation switch in the main function...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions