WinAPI Library Calls Via PowerShell Scripts

Last updated on:

About the rule

Rule Type

Standard

Rule Description

Detects calls to WinAPI libraries from PowerShell scripts. Attackers can often leverage these APIs to avoid detection based on typical PowerShell function calls. Use this rule as a basis to hunt for interesting scripts.

Severity

Trouble

Rule Requirement

Criteria

Action1: actionname = "PowerShell Script Block Logged" AND SCRIPTEXECUTED contains "Advapi32.dll,kernel32.dll,KernelBase.dll,ntdll.dll,secur32.dll,user32.dll" select Action1.HOSTNAME,Action1.MESSAGE,Action1.SCRIPTEXECUTED

Detection

Execution Mode

realtime

Log Sources

Windows

Author

Nikita Nazarov, oscd.community, Nasreddine Bencherchali (Nextron Systems)