event.category:"process" and host.os.type:windows and
(
powershell.file.script_block_text : (
"System.Management.Automation.AmsiUtils" or
amsiInitFailed or
"Invoke-AmsiBypass" or
"Bypass.AMSI" or
"amsi.dll" or
AntimalwareProvider or
amsiSession or
amsiContext or
AmsiInitialize or
unloadobfuscated or
unloadsilent or
AmsiX64 or
AmsiX32 or
FindAmsiFun or
"AllocHGlobal((9076" or
"[cHAr](65)+[cHaR]([byTe]0x6d)+[ChaR]([ByTe]0x73)+[CHaR]([BYte]0x69"
) or
powershell.file.script_block_text:("[System.Runtime.InteropServices.Marshal]::Copy" and "VirtualProtect") or
powershell.file.script_block_text:("[Ref].Assembly.GetType(('System.Management.Automation" and ".SetValue(") or
powershell.file.script_block_text:("::AllocHGlobal((" and ("System.Management.Automation.$([" or "System.$([cHAr]" or "[cHaR]([byTe]")) or
powershell.file.script_block_text:("::AllocHGlobal((" and ".SetValue(" and "-replace" and ".NoRMALiZe(")
) and
not powershell.file.script_block_text : (
"sentinelbreakpoints" and "Set-PSBreakpoint"
)
Install detection rules in Elastic Security
Detect Potential Antimalware Scan Interface Bypass via PowerShell in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).