Techniques
Sample rules
Potential Process Injection via PowerShell
- source: elastic
- technicques:
- T1055
- T1059
- T1106
Description
Detects PowerShell scripts that combine Win32 APIs for allocation, protection, process access, or dynamic resolution with injection or execution APIs. Attackers use these API chains for potential process injection or in-memory payload execution.
Detection logic
event.category:process and host.os.type:windows and
powershell.file.script_block_text : (
(VirtualAlloc or VirtualAllocEx or VirtualProtect or LdrLoadDll or LoadLibrary or LoadLibraryA or
LoadLibraryEx or GetProcAddress or OpenProcess or OpenProcessToken or AdjustTokenPrivileges) and
(WriteProcessMemory or CreateRemoteThread or NtCreateThreadEx or CreateThread or QueueUserAPC or
SuspendThread or ResumeThread or GetDelegateForFunctionPointer)
) and not
file.directory: (
"C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\SenseCM" or
"C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Downloads"
)