From b5a08380d48eb370b22513592a867b8c2b63309d Mon Sep 17 00:00:00 2001 From: Ming Di Leom <2809763-curben@users.noreply.gitlab.com> Date: Sun, 16 Feb 2025 10:17:08 +0000 Subject: [PATCH] feat(threat-hunting): WinrsHost.exe execution --- source/threat-hunting/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/threat-hunting/index.md b/source/threat-hunting/index.md index 5480973..14312a9 100644 --- a/source/threat-hunting/index.md +++ b/source/threat-hunting/index.md @@ -1583,3 +1583,16 @@ SPL: | lookup ad_users sAMAccountName AS user OUTPUT displayName AS Name, mail AS Email | table Time, host, process, parent_process, EventCode, EventDescription, user, Name, Email, index ``` + +## WinrsHost.exe execution + +References: [1](https://www.elastic.co/security-labs/fragile-web-ref7707), [2](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winrs) +SPL: + +```spl +| tstats summariesonly=true allow_old_summaries=true fillnull_value="unknown" count FROM datamodel=Endpoint.Processes WHERE index="windows" Processes.signature_id=4688 (Processes.parent_process_name="winrshost.exe" OR Processes.process_name="winrs.exe") BY index, host, Processes.signature_id, Processes.signature, Processes.parent_process, Processes.process, Processes.user, _time span=1s +| rename Processes.* AS *, signature_id AS EventCode, signature AS EventDescription +| eval Time = strftime(_time, "%Y-%m-%d %H:%M:%S %z") +| lookup ad_users sAMAccountName AS user OUTPUT displayName AS Name, mail AS Email +| table Time, index, host, EventCode, EventDescription, parent_process, process, user, Name, Email +```