<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Detect when a service is stopped in Windows in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224217#M8089</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/504446757"&gt;@VarunPitale&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use below sample:&lt;/P&gt;
&lt;P&gt;dataset = xdr_data &lt;BR /&gt;| filter event_type = ENUM.PROCESS &lt;BR /&gt;| filter event_sub_type = ENUM.PROCESS_STOP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you feel this has answered your query, please let us know by clicking like and&amp;nbsp; on "mark this as a Solution". Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 15:41:10 GMT</pubDate>
    <dc:creator>aspatil</dc:creator>
    <dc:date>2025-03-19T15:41:10Z</dc:date>
    <item>
      <title>Detect when a service is stopped in Windows</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224204#M8088</link>
      <description>&lt;P&gt;One of the rules I am trying to create is to know when a particular service is stopped in Windows. Couple of things I have tried.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. &lt;STRONG&gt;Event IDs&lt;/STRONG&gt;: Typically Event ID 7036/7040 is generated when a service is stopped. But I cannot get a single result with my query&lt;/P&gt;
&lt;P&gt;dataset = xdr_data&lt;BR /&gt;| filter action_evtlog_event_id in (7036,7040)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per&amp;nbsp;&lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Endpoint-Data-Collection" target="_blank"&gt;https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Endpoint-Data-Collection&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;7036 and 7040 are not monitored.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. &lt;STRONG&gt;Looking at host inventory services:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The following query kind of works, but I cannot create a BIOC rule with this.&lt;/P&gt;
&lt;P&gt;config case_sensitive = false &lt;BR /&gt;| preset = host_inventory_services | filter service_name contains "XXX" | fields endpoint_name, ip_address, path_name, service_name, service_state&lt;BR /&gt;| filter service_state != ENUM.SERVICE_RUNNING&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is a good way to do this?&amp;nbsp; Ideally, I am not looking to block this, but just generate a low level alert for the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 12:03:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224204#M8088</guid>
      <dc:creator>VarunPitale</dc:creator>
      <dc:date>2025-03-19T12:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when a service is stopped in Windows</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224217#M8089</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/504446757"&gt;@VarunPitale&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use below sample:&lt;/P&gt;
&lt;P&gt;dataset = xdr_data &lt;BR /&gt;| filter event_type = ENUM.PROCESS &lt;BR /&gt;| filter event_sub_type = ENUM.PROCESS_STOP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you feel this has answered your query, please let us know by clicking like and&amp;nbsp; on "mark this as a Solution". Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 15:41:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224217#M8089</guid>
      <dc:creator>aspatil</dc:creator>
      <dc:date>2025-03-19T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when a service is stopped in Windows</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224443#M8107</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/308232"&gt;@aspatil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this solution, but it did not work in some scenarios. We tries by going to services.msc and then in the GUI, picking the service and stopping it. This behavior should also show up in alerts&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 12:00:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224443#M8107</guid>
      <dc:creator>VarunPitale</dc:creator>
      <dc:date>2025-03-21T12:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when a service is stopped in Windows</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224767#M8126</link>
      <description>&lt;P&gt;The reason your query might not be capturing service stop events from services.msc is that stopping a service via the GUI does not always generate a process stop event. Instead, it often generates a Windows Event Log (Evtlog) event, which might not be covered by the PROCESS_STOP filter.&lt;BR /&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = ENUM.EVENT_LOG&lt;BR /&gt;| filter action_evtlog_event_id in (7036, 7040) &lt;BR /&gt;| fields _time, agent_hostname, action_evtlog_event_id, action_evtlog_message&lt;BR /&gt;| sort desc _time&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Stopping a service via the command line (e.g., sc stop &amp;lt;service-name&amp;gt; or net stop &amp;lt;service-name&amp;gt;) might generate a process execution event. You can check for these:&lt;BR /&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = ENUM.PROCESS&lt;BR /&gt;| filter actor_process_image_name in ("cmd.exe", "powershell.exe", "sc.exe", "net.exe")&lt;BR /&gt;| filter actor_process_command_line contains "stop"&lt;BR /&gt;| fields _time, agent_hostname, actor_process_command_line, actor_effective_username&lt;BR /&gt;| sort desc _time&lt;/P&gt;
&lt;P&gt;Monitor Service State Changes&lt;BR /&gt;config case_sensitive = false&lt;BR /&gt;| preset = host_inventory_services &lt;BR /&gt;//| filter service_name contains "XXX" &lt;BR /&gt;| filter service_state != ENUM.SERVICE_RUNNING&lt;BR /&gt;| fields endpoint_name, service_name, service_state&lt;BR /&gt;| sort desc report_timestamp&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 07:46:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/detect-when-a-service-is-stopped-in-windows/m-p/1224767#M8126</guid>
      <dc:creator>aspatil</dc:creator>
      <dc:date>2025-03-26T07:46:48Z</dc:date>
    </item>
  </channel>
</rss>

