<?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 XQL Query for CVE-2021-1675 exploitation attempts (printnightmare) in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416610#M834</link>
    <description>&lt;P&gt;Hi Community&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help in creating an XQL query for a BIOC which detects exploitation attempts for CVE-2021-1675 (printnightmare). So far I have the following two queries:&lt;/P&gt;
&lt;P&gt;1. A query that detects incoming connections on port 445&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter event_type = NETWORK and event_sub_type = NETWORK_STREAM_ACCEPT and (action_local_port = 139 or action_local_port = 445)
| fields event_type, agent_hostname as Hostname, action_local_ip as Local_IP, action_remote_ip as Remote_IP, action_external_hostname as Remote_Host, action_local_port as Local_Port, actor_process_image_name as Process_Getting_Connection&lt;/LI-CODE&gt;
&lt;P&gt;2. a query to view driverinstallations done by the print spooler service&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter causality_actor_process_image_path = "C:\Windows\System32\spoolsv.exe" and actor_process_image_path = "C:\Windows\System32\drvinst.exe"
| fields agent_hostname as host_name, causality_actor_process_image_name as CGO_Name, causality_actor_process_image_path as CGO_Path, causality_actor_process_command_line as CGO_CMD, causality_actor_primary_username as Username, actor_process_image_path as child_path, actor_process_command_line as child_cmd, actor_process_os_pid as child_pid, actor_process_image_sha256 as child_sha256, actor_process_execution_time as start_date, event_id&lt;/LI-CODE&gt;
&lt;P&gt;Now I'd like to combine them somehow in order so get an alert for incoming connections over SMB which result in a driverinstallation done by the print spooler service. Has anyone done something similar or is able to help me with this XQL query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Remo&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 18:40:45 GMT</pubDate>
    <dc:creator>Remo</dc:creator>
    <dc:date>2021-07-01T18:40:45Z</dc:date>
    <item>
      <title>XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416610#M834</link>
      <description>&lt;P&gt;Hi Community&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help in creating an XQL query for a BIOC which detects exploitation attempts for CVE-2021-1675 (printnightmare). So far I have the following two queries:&lt;/P&gt;
&lt;P&gt;1. A query that detects incoming connections on port 445&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter event_type = NETWORK and event_sub_type = NETWORK_STREAM_ACCEPT and (action_local_port = 139 or action_local_port = 445)
| fields event_type, agent_hostname as Hostname, action_local_ip as Local_IP, action_remote_ip as Remote_IP, action_external_hostname as Remote_Host, action_local_port as Local_Port, actor_process_image_name as Process_Getting_Connection&lt;/LI-CODE&gt;
&lt;P&gt;2. a query to view driverinstallations done by the print spooler service&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter causality_actor_process_image_path = "C:\Windows\System32\spoolsv.exe" and actor_process_image_path = "C:\Windows\System32\drvinst.exe"
| fields agent_hostname as host_name, causality_actor_process_image_name as CGO_Name, causality_actor_process_image_path as CGO_Path, causality_actor_process_command_line as CGO_CMD, causality_actor_primary_username as Username, actor_process_image_path as child_path, actor_process_command_line as child_cmd, actor_process_os_pid as child_pid, actor_process_image_sha256 as child_sha256, actor_process_execution_time as start_date, event_id&lt;/LI-CODE&gt;
&lt;P&gt;Now I'd like to combine them somehow in order so get an alert for incoming connections over SMB which result in a driverinstallation done by the print spooler service. Has anyone done something similar or is able to help me with this XQL query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Remo&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 18:40:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416610#M834</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2021-07-01T18:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416647#M836</link>
      <description>&lt;P&gt;Hi Remo! If it helps, take a look at our blog post on PrintNightmare for suggested XQL queries:&amp;nbsp;&lt;A href="https://www.paloaltonetworks.com/blog/security-operations/hunting-printnightmare/" target="_blank"&gt;https://www.paloaltonetworks.com/blog/security-operations/hunting-printnightmare/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 19:27:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416647#M836</guid>
      <dc:creator>kcross</dc:creator>
      <dc:date>2021-07-01T19:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416668#M837</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/80517"&gt;@kcross&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing that link. This definately helps already.&lt;/P&gt;&lt;P&gt;Even if there are already some queries shared by Paloalto, I am still interested if my initial query is possible with this combination.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 21:35:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416668#M837</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2021-07-01T21:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416913#M838</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/16592"&gt;@Remo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in creating an XQL query for a BIOC which detects exploitation attempts for CVE-2021-1675 (printnightmare). So far I have the following two queries:&lt;/P&gt;&lt;P&gt;1. A query that detects incoming connections on port 445&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter event_type = NETWORK and event_sub_type = NETWORK_STREAM_ACCEPT and (action_local_port = 139 or action_local_port = 445)
| fields event_type, agent_hostname as Hostname, action_local_ip as Local_IP, action_remote_ip as Remote_IP, action_external_hostname as Remote_Host, action_local_port as Local_Port, actor_process_image_name as Process_Getting_Connection&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. a query to view driverinstallations done by the print spooler service&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dataset = xdr_data
| filter causality_actor_process_image_path = "C:\Windows\System32\spoolsv.exe" and actor_process_image_path = "C:\Windows\System32\drvinst.exe"
| fields agent_hostname as host_name, causality_actor_process_image_name as CGO_Name, causality_actor_process_image_path as CGO_Path, causality_actor_process_command_line as CGO_CMD, causality_actor_primary_username as Username, actor_process_image_path as child_path, actor_process_command_line as child_cmd, actor_process_os_pid as child_pid, actor_process_image_sha256 as child_sha256, actor_process_execution_time as start_date, event_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I'd like to combine them somehow in order so get an alert for incoming connections over SMB which result in a driverinstallation done by the print spooler service. Has anyone done something similar or is able to help me with this XQL query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Remo&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello Remo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can combine both queries with an union statement.&amp;nbsp; Here is an example union statement;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XQL Helper Screenshot:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yalonso_0-1625251254867.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/34730i81014127D0661817/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="yalonso_0-1625251254867.png" alt="yalonso_0-1625251254867.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I've taken the liberty of combining your queries using the union statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = NETWORK and event_sub_type = NETWORK_STREAM_ACCEPT and (action_local_port = 139 or action_local_port = 445)&lt;BR /&gt;| fields event_type, agent_hostname as Hostname, action_local_ip as Local_IP, action_remote_ip as Remote_IP, action_external_hostname as Remote_Host, action_local_port as Local_Port, actor_process_image_name as Process_Getting_Connection&lt;BR /&gt;| union (dataset = xdr_data&lt;BR /&gt;| filter causality_actor_process_image_path = "C:\Windows\System32\spoolsv.exe" and actor_process_image_path = "C:\Windows\System32\drvinst.exe"&lt;BR /&gt;| fields agent_hostname as host_name, causality_actor_process_image_name as CGO_Name, causality_actor_process_image_path as CGO_Path, causality_actor_process_command_line as CGO_CMD, causality_actor_primary_username as Username, actor_process_image_path as child_path, actor_process_command_line as child_cmd, actor_process_os_pid as child_pid, actor_process_image_sha256 as child_sha256, actor_process_execution_time as start_date, event_id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 19:37:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416913#M838</guid>
      <dc:creator>yalonso</dc:creator>
      <dc:date>2021-07-02T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416967#M839</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/185345"&gt;@yalonso&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply. I tried this command shortly but unfortunately this gives way too much results. Mainly because it simply shows all results from both queries in one resulttable. My goal still somehow is to search for driverinstallations by spoolsv.exe that are triggered from a remote host.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 12:54:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/416967#M839</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2021-07-03T12:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query for CVE-2021-1675 exploitation attempts (printnightmare)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/420092#M868</link>
      <description>&lt;P&gt;You may have to tweak your queries to combine by using "join". Here's a sample of join&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcandelaria_0-1626485737372.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/35097i14776E3458E9A3DC/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="jcandelaria_0-1626485737372.png" alt="jcandelaria_0-1626485737372.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 01:36:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-for-cve-2021-1675-exploitation-attempts-printnightmare/m-p/420092#M868</guid>
      <dc:creator>jcandelaria</dc:creator>
      <dc:date>2021-07-17T01:36:19Z</dc:date>
    </item>
  </channel>
</rss>

