<?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 Question about STRING.TCP pattern matching in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321888#M99495</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a problem related within STRING.TCP engine pattern matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within TCPDUMP i see that there is an offset of 43 bytes between two fixed hexadecimal values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to set the RegexString value to "\x26.{43}\x0F" in my custom sig, and i figure out that the it will fires when match \x26, 43 times any values and then \x0f... but it doesn't works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is... how cisco NIDS counts 43 bytes? Is it possible that some de-obfuscation feature or something like this transforms the stream payload before analisys changing the number of bytes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question. I would like to match this string only on the first X tcp packets within a given session. Could the "EndMatchOffset" parameters help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any response.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2019 09:22:51 GMT</pubDate>
    <dc:creator>t.santaguida</dc:creator>
    <dc:date>2019-03-10T09:22:51Z</dc:date>
    <item>
      <title>Question about STRING.TCP pattern matching</title>
      <link>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321888#M99495</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a problem related within STRING.TCP engine pattern matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within TCPDUMP i see that there is an offset of 43 bytes between two fixed hexadecimal values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to set the RegexString value to "\x26.{43}\x0F" in my custom sig, and i figure out that the it will fires when match \x26, 43 times any values and then \x0f... but it doesn't works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is... how cisco NIDS counts 43 bytes? Is it possible that some de-obfuscation feature or something like this transforms the stream payload before analisys changing the number of bytes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question. I would like to match this string only on the first X tcp packets within a given session. Could the "EndMatchOffset" parameters help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any response.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2019 09:22:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321888#M99495</guid>
      <dc:creator>t.santaguida</dc:creator>
      <dc:date>2019-03-10T09:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question about STRING.TCP pattern matching</title>
      <link>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321889#M99496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best way to write this signature uses MinMatch length and MaxInspect length. MinMatch length is the minimum number of bytes required between the byte before the wildcard to the end of the pattern. MaxInspect length is the maximum depth to look in the stream for the match. Also, remember that  &amp;#147;.&amp;#148; is equivalent to [^\n], if you really want to match on anything then you must use [\x00-\xff]. To write the an efficient signature it is important to remember that anytime your repeating large char class (for example [^\n] or \x00-\xff] for more than a few adjacent bytes you need to use a wildcard with match lengths. If you do not have a MaxInspect length then this can create the opportunity for false positives but in this situation it will work perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\x26[\x00-\xff]+\x0F&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MinMatch = 45&lt;/P&gt;&lt;P&gt;MaxInspect = 45 (or X+45 if this is not at the beginning of the stream)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may still run into fidelity problems with this signature depending on how far in you set your max inspect length since you&amp;#146;re only looking for two specific bytes.  If you can add anything else to the regex it would be a very good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Craig&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2005 17:07:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321889#M99496</guid>
      <dc:creator>craiwill</dc:creator>
      <dc:date>2005-04-08T17:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Question about STRING.TCP pattern matching</title>
      <link>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321890#M99497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Craig, it works!&lt;/P&gt;&lt;P&gt;Thanks for your suggest.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2005 06:49:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/question-about-string-tcp-pattern-matching/m-p/321890#M99497</guid>
      <dc:creator>t.santaguida</dc:creator>
      <dc:date>2005-04-13T06:49:16Z</dc:date>
    </item>
  </channel>
</rss>

