<?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: XQL Query Assistance in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/530093#M3572</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/270330"&gt;@WilliamHolloway&lt;/a&gt;&amp;nbsp;if you are using Cortex XDR Pro, there are several &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR-Analytics-Alert-Reference" target="_blank"&gt;Analytics Detectors&lt;/A&gt; that are automatically triggered during brute force attempts once the tenant has met the minimum requirements for Analytics. You can refer to this documentation as to &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Set-up-your-Data-Sources-and-Alert-Sensors" target="_blank"&gt;how to enable Analytics&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 10:18:21 GMT</pubDate>
    <dc:creator>bbarmanroy</dc:creator>
    <dc:date>2023-02-07T10:18:21Z</dc:date>
    <item>
      <title>XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/528896#M3482</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm new to Cortex and creating XQL queries. I was looking for a way to detect a brute force attack (failed logins followed by a successful login). Are there any good resources available online or can someone help me get this query built?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#Cortex XDR&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 15:59:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/528896#M3482</guid>
      <dc:creator>WilliamHolloway</dc:creator>
      <dc:date>2023-01-27T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/530093#M3572</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/270330"&gt;@WilliamHolloway&lt;/a&gt;&amp;nbsp;if you are using Cortex XDR Pro, there are several &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR-Analytics-Alert-Reference" target="_blank"&gt;Analytics Detectors&lt;/A&gt; that are automatically triggered during brute force attempts once the tenant has met the minimum requirements for Analytics. You can refer to this documentation as to &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Set-up-your-Data-Sources-and-Alert-Sensors" target="_blank"&gt;how to enable Analytics&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 10:18:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/530093#M3572</guid>
      <dc:creator>bbarmanroy</dc:creator>
      <dc:date>2023-02-07T10:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/530840#M3616</link>
      <description>&lt;P&gt;Hi William , we can build a XQL Query and search for an event id like 4624 for successfully login and 4625 for failed login &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 08:43:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/530840#M3616</guid>
      <dc:creator>Alex_Necula</dc:creator>
      <dc:date>2023-02-13T08:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/562420#M5386</link>
      <description>&lt;P&gt;Has anyone created the XQL Query for this failed and successful logon? CrowdStrike had a great dashboard for this and I am looking to create inside our Cortex setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 13:31:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/562420#M5386</guid>
      <dc:creator>TDoerr</dc:creator>
      <dc:date>2023-10-19T13:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/562916#M5405</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/270330"&gt;@WilliamHolloway&lt;/a&gt;&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/323487"&gt;@TDoerr&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This probably answer half of your question, the query below is calculating the number of authentication failures per user/endpoint with the failure reason.&lt;BR /&gt;I figure you could start from here.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data // Using the xdr dataset

//Query against Windows Security Event ID 4625 - Authentication Failure
| filter event_type = ENUM.EVENT_LOG and action_evtlog_event_id = 4625
| alter Workstation_Name = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.WorkstationName" ))
| alter Target_UserName = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.TargetUserName" ))
| alter Target_DomainName = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.TargetDomainName" ))
| alter Workstation_IP = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.IpAddress" ))
| alter Status = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.Status" ))
| alter SubStatus = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.SubStatus" ))
| alter LogonType = lowercase(json_extract_scalar(to_json_string(action_evtlog_data_fields), "$.LogonType" ))
| filter Target_UserName not contains "$"
| comp count(Status) as EventCount by Workstation_Name, Target_UserName, Target_DomainName , Status, SubStatus

// If the status/substatus description is empty, See https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
| alter Status_Description = if(to_string(Status) = "0xC000006d", replace(Status, "0xC000006d", "This is either due to a bad username or authentication information"))
| alter Status_Description = if(to_string(Status) = "0xC0000234", replace(Status, "0xC0000234", "User is currently locked out"), Status_Description )
| alter Status_Description = if(to_string(Status) = "0xC000006e", replace(Status, "0xC000006e", "Valid authentication, but restricted."), Status_Description )

| alter SubStatus_Description = if(to_string(SubStatus) = "0xC000006a", replace(SubStatus, "0xC000006a", "User name is correct but the password is wrong"))
| alter SubStatus_Description = if(to_string(SubStatus) = "0xC0000064", replace(SubStatus, "0xC0000064", "User name does not exist"), SubStatus_Description )
| alter SubStatus_Description = if(to_string(SubStatus) = "0xC0000071", replace(SubStatus, "0xC0000071", "Expired password"), SubStatus_Description )
| alter SubStatus_Description = if(to_string(SubStatus) = "0xC0000072", replace(SubStatus, "0xC0000072", "Account is currently disabled"), SubStatus_Description )
| alter SubStatus_Description = if(to_string(SubStatus) = "0xC0000193", replace(SubStatus, "0xC0000193", "Account expiration"), SubStatus_Description )

| sort desc Workstation_Name 
| fields Workstation_Name as Hostname , Target_UserName as Username, Target_DomainName as Domain, EventCount, Status, Status_Description , SubStatus , SubStatus_Description 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;hope this help.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 10:04:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/562916#M5405</guid>
      <dc:creator>Antony_Chan</dc:creator>
      <dc:date>2023-10-24T10:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/565645#M5535</link>
      <description>&lt;P&gt;That works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 17:14:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/565645#M5535</guid>
      <dc:creator>TDoerr</dc:creator>
      <dc:date>2023-11-14T17:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query Assistance</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/577558#M6090</link>
      <description>&lt;P&gt;Thank you! I've been trying to find a query to identify specific user authentications (which was proving devilishly hard for some reason) and this got me close enough to be workable.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any ideas on how to do something similar for a O365 Azure account? The dataset is going to be way different obviously&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 00:04:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-assistance/m-p/577558#M6090</guid>
      <dc:creator>Jesse_Siegrist</dc:creator>
      <dc:date>2024-02-17T00:04:15Z</dc:date>
    </item>
  </channel>
</rss>

