<?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: Drop a certain type of inbound DNS query in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42267#M980</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just wanted to follow up to let you know this worked for the problem I am experiencing.&amp;nbsp; At this time, the offensive queries are for the same FQDN, so we were able to make a custom vulnerability addressing that FQDN and drop it - worked like a charm.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although, it would be nice to be able to drop all Type A queries...&amp;nbsp; but as you mentioned, this doesn't seem possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2014 20:19:02 GMT</pubDate>
    <dc:creator>jgardner</dc:creator>
    <dc:date>2014-11-26T20:19:02Z</dc:date>
    <item>
      <title>Drop a certain type of inbound DNS query</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42264#M977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a MS DNS server that handles some (very few) reverse PTR records...&amp;nbsp; We consistently see people trying to use this server for reflection attacks - whereby they perform a recursive forward lookup for the same domain over and over (likely spoofing the source IP to try and flood their target); our DNS server dutifully respond with a list of the root-hint servers (but we have since removed all root-hint servers from this server), or now a failed query response.&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Because this is a MS DNS server, we are limited on how to handle these forward lookup requests.&amp;nbsp; We have recursion disabled, no forward lookup zones...&amp;nbsp; But we are still responding for the (probably spoofed) requestor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have implemented DoS protections to discard based one source and max concurrent session count, but would like to drop this unwanted traffic altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My dilemma: Is there a way with the PAN to construct a rule that would drop DNS *forward* lookup queries from any source?&amp;nbsp; All we care about are the reverse PTR queries, and would be happy to never let any forward lookups reach our DMZd DNS server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Palo Alto, so I don't know if this is or isn't possible, but it seems it should be a simple task to peek inside that UDP traffic to drop anything with the targeted UDP DNS query type of type A.&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Any PAN ninjas out there who can help me with this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 21:03:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42264#M977</guid>
      <dc:creator>jgardner</dc:creator>
      <dc:date>2014-11-25T21:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Drop a certain type of inbound DNS query</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42265#M978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My first thought here is to create a custom vulnerability object using a pattern-match on the query. Then make the default action to drop the packet and apply the vulnerability object to a rule (through a new profile or non-default profile). However, custom vulnerability objects using pattern-matching require 7 &lt;STRONG&gt;fixed&lt;/STRONG&gt; bytes of data. For example, a DNS query for record type A class IN only contains 4 bytes (0x00010001) in the "dns-req-section" context. So we have a problem, we don't have enough data to pattern-match against for specific record type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: Can we use bytes immediately before or after the data we care about to help us out? Maybe. The A record request would typically not contain additional RRs (at least none we can reliably pattern match) so after the query, there is no data to match on. We could match on data before the type A class IN, but then we have to know what the actual query would be (ie. the host, subs, domain, and tld.) There is a compromise if you wouldn't be opposed to some tedium. Within the custom vulnerability object you can create multiple signatures, each that include just the common TLDs (com, org, gov, info).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a fairly detailed write-up of creating custom threat signatures and I'll also provide an example: &lt;A href="https://live.paloaltonetworks.com/docs/DOC-5534"&gt;Creating Custom Threat Signatures&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Creating the Object&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;On the device or Panorama go to 'Objects' -&amp;gt; 'Vulnerability' under custom objects. Click 'Add'&lt;/LI&gt;&lt;LI&gt;Give it a Threat ID, Name, Comment etc. I'd just be sure to make the severity 'high' or greater and select 'Drop Packets' as the default action.&lt;/LI&gt;&lt;LI&gt;Click on the Signatures tab. Standard is what you want.&lt;/LI&gt;&lt;LI&gt;Click Add to add a new signature&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2014-11-25 at 6.59.36 PM.png" class="image-1 jive-image" src="https://live.paloaltonetworks.com/legacyfs/online/17046_Screen Shot 2014-11-25 at 6.59.36 PM.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Creating the Patterns&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You'll want it to be 'Transaction' based and the order shouldn't matter since I'd create 'OR' conditions for different TLDs&lt;/LI&gt;&lt;LI&gt;Add Or Condition (for .com A record queries)&lt;OL&gt;&lt;LI&gt;Operator - pattern-match&lt;/LI&gt;&lt;LI&gt;Context - dns-req-section&lt;/LI&gt;&lt;LI&gt;Pattern - \x03636f6d0000010001\x&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Repeat step 2 for other TLDs you want to include. Make sure they are 'Or' conditions and not 'And' or it'll never trigger.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2014-11-26 at 9.52.51 AM.png" class="image-0 jive-image" src="https://live.paloaltonetworks.com/legacyfs/online/17053_Screen Shot 2014-11-26 at 9.52.51 AM.png" style="height: 437px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a 9 byte pattern and if you only care about PTR records making it passed, this shouldn't trigger on false positives. Anyone else using this might want to put it in 'alert' mode and enable packet capture to make sure it doesn't trigger. You should be able to create multiple 'OR' conditions for the .org .info .gov etc domains in the same object. I didn't test that though. My splunk guy gets mad when I shovel a bunch of new logs into the indexer without telling him &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://live.paloaltonetworks.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this achieves what you want. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 16:56:32 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42265#M978</guid>
      <dc:creator>lwheelock</dc:creator>
      <dc:date>2014-11-26T16:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Drop a certain type of inbound DNS query</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42266#M979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&amp;nbsp; This looks promising...&amp;nbsp; as I'm trying to understand the pattern, what should the pattern be for a .ru domain query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 19:25:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42266#M979</guid>
      <dc:creator>jgardner</dc:creator>
      <dc:date>2014-11-26T19:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Drop a certain type of inbound DNS query</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42267#M980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just wanted to follow up to let you know this worked for the problem I am experiencing.&amp;nbsp; At this time, the offensive queries are for the same FQDN, so we were able to make a custom vulnerability addressing that FQDN and drop it - worked like a charm.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although, it would be nice to be able to drop all Type A queries...&amp;nbsp; but as you mentioned, this doesn't seem possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 20:19:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42267#M980</guid>
      <dc:creator>jgardner</dc:creator>
      <dc:date>2014-11-26T20:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Drop a certain type of inbound DNS query</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42268#M981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome, glad it worked for you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you need it, the pattern I'm using is broken down like so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.com&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;\x03 &lt;SPAN style="color: #3b3b3b; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;63 6f 6d 00 00 01 00 01\x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;03 - Indicates the TLD is 3 bytes&lt;/P&gt;&lt;P&gt;63 6f 6d - com&lt;/P&gt;&lt;P&gt;00 - end of host query&lt;/P&gt;&lt;P&gt;00 01 - A record&lt;/P&gt;&lt;P&gt;00 01 - class IN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.ru&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;\x02 72 75 &lt;SPAN style="color: #3b3b3b; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;00 00 01 00 01\x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;02 - Indicates the TLD is 2 bytes&lt;/P&gt;&lt;P&gt;72 75 - ru&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You've got the rest. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://live.paloaltonetworks.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 22:35:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/drop-a-certain-type-of-inbound-dns-query/m-p/42268#M981</guid>
      <dc:creator>lwheelock</dc:creator>
      <dc:date>2014-11-26T22:35:51Z</dc:date>
    </item>
  </channel>
</rss>

