sequence by host.id with maxspan=30s
[network where host.os.type == "windows" and process.pid == 4 and network.direction : ("incoming", "ingress") and
destination.port in (5985, 5986) and source.ip != "127.0.0.1" and source.ip != "::1"]
[process where host.os.type == "windows" and
event.type == "start" and process.parent.name : "winrshost.exe" and not process.executable : "?:\\Windows\\System32\\conhost.exe"]
Install detection rules in Elastic Security
Detect Incoming Execution via WinRM Remote Shell 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).