<?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: SQL Injection Rule - Multivalue count with multiple statistical conditions in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482324#M7787</link>
    <description>&lt;P&gt;your welcome, Happy Splunking.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 12:44:32 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-11-13T12:44:32Z</dc:date>
    <item>
      <title>SQL Injection Rule - Multivalue count with multiple statistical conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482321#M7784</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to add an additional condition to this rule.&lt;/P&gt;

&lt;P&gt;Currently it splits up the raw value from our web logs trying to find SQL injection, although I want to lower the number of commands it needs to alert, but add a count to where the src ip is greater than 5. And I can't seem to make it work. &lt;/P&gt;

&lt;P&gt;The command below is what I currently have already:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo  NOT src="10.0.0.0/8" NOT src="172.16.0.0/12" NOT src="192.168.0.0/16" | eval num_sql_cmds=mvcount(split(_raw, "alter%20table")) + mvcount(split(_raw, "between")) + mvcount(split(_raw, "create%20table")) + mvcount(split(_raw, "create%20database")) + mvcount(split(_raw, "create%20index")) + mvcount(split(_raw, "create%20view")) + mvcount(split(_raw, "delete")) + mvcount(split(_raw, "drop%20database")) + mvcount(split(_raw, "drop%20index")) + mvcount(split(_raw, "drop%20table")) + mvcount(split(_raw, "exists")) + mvcount(split(_raw, "exec")) + mvcount(split(_raw, "group%20by")) + mvcount(split(_raw, "having")) + mvcount(split(_raw, "insert%20into")) + mvcount(split(_raw, "inner%20join")) + mvcount(split(_raw, "left%20join")) + mvcount(split(_raw, "right%20join")) + mvcount(split(_raw, "full%20join")) + mvcount(split(_raw, "select")) + mvcount(split(_raw, "distinct")) + mvcount(split(_raw, "select%20top")) + mvcount(split(_raw, "union")) + mvcount(split(_raw, "xp_cmdshell")) + mvcount(split(_raw, "1=1")) -25 
| where num_sql_cmds &amp;gt;= 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is to eliminate if we see a single IP which hits on legitimate traffic. For example, the following uri will match the conditions but only had event in the logs, where an actual SQL injection would likely hit a number of times from the same IP. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; /Secure/Int/OnlineService/ReviewService/scripts/core/components/select-option/select-option.htm
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 12:08:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482321#M7784</guid>
      <dc:creator>swright_rl</dc:creator>
      <dc:date>2019-11-12T12:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Injection Rule - Multivalue count with multiple statistical conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482322#M7785</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=foo   src!="10.0.0.0/8" src!="172.16.0.0/12" src!="192.168.0.0/16" 
| stats count(eval(searchmatch("alter%20table") OR searchmatch("between") OR ....))) as num_sql_cmds by src
| where num_sql_cmds &amp;gt;= 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about it?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 12:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482322#M7785</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-12T12:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Injection Rule - Multivalue count with multiple statistical conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482323#M7786</link>
      <description>&lt;P&gt;That works great thank you!  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 14:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482323#M7786</guid>
      <dc:creator>swright_rl</dc:creator>
      <dc:date>2019-11-12T14:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Injection Rule - Multivalue count with multiple statistical conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482324#M7787</link>
      <description>&lt;P&gt;your welcome, Happy Splunking.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 12:44:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/SQL-Injection-Rule-Multivalue-count-with-multiple-statistical/m-p/482324#M7787</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-13T12:44:32Z</dc:date>
    </item>
  </channel>
</rss>

