<?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 Search Command to identify a Port Scan attack in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32538#M6783</link>
    <description>&lt;P&gt;Hi, currently I am using t-shark to capture my log on my host and I would like to capture a port scan attack while I am doing my normal stuff on my host like surfing the net.&lt;/P&gt;

&lt;P&gt;I plan to identify the attack by the amount of port being access per 30 sec. On top of that I would like to used if the number of source ip and destination ip equal to 172.20.180.27 and 172.20.180.12 packet appear to be the same amount or exceed a certain range, it would prompt an alert.&lt;/P&gt;

&lt;P&gt;Is it workable?&lt;BR /&gt;
If not, are there any Solution??&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2013 06:42:11 GMT</pubDate>
    <dc:creator>Kai191</dc:creator>
    <dc:date>2013-05-14T06:42:11Z</dc:date>
    <item>
      <title>Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32538#M6783</link>
      <description>&lt;P&gt;Hi, currently I am using t-shark to capture my log on my host and I would like to capture a port scan attack while I am doing my normal stuff on my host like surfing the net.&lt;/P&gt;

&lt;P&gt;I plan to identify the attack by the amount of port being access per 30 sec. On top of that I would like to used if the number of source ip and destination ip equal to 172.20.180.27 and 172.20.180.12 packet appear to be the same amount or exceed a certain range, it would prompt an alert.&lt;/P&gt;

&lt;P&gt;Is it workable?&lt;BR /&gt;
If not, are there any Solution??&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 06:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32538#M6783</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-14T06:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32539#M6784</link>
      <description>&lt;P&gt;please post a few sample events.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 06:52:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32539#M6784</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-14T06:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32540#M6785</link>
      <description>&lt;P&gt;2013-05-13 13:53:17.987923 172.20.180.12 -&amp;gt; 172.20.180.27 TCP 58 55343 &amp;gt; http [SYN] Seq=0 Win=1024 Len=0 MSS=1460&lt;/P&gt;

&lt;P&gt;2013-05-13 13:53:21.199414 172.20.180.12 -&amp;gt; 172.20.180.27 TCP 74 44959 &amp;gt; https [SYN] Seq=0 Win=14600 Len=0 MSS=1460 SACK_PERM=1 TSval=3518195 TSecr=0 WS=16&lt;/P&gt;

&lt;P&gt;2013-05-13 13:53:21.199474 172.20.180.27 -&amp;gt; 172.20.180.12 TCP 74 https &amp;gt; 44959 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1 TSval=1498581 TSecr=3518195&lt;/P&gt;

&lt;P&gt;2013-05-13 13:53:21.199568 172.20.180.12 -&amp;gt; 172.20.180.27 TCP 66 44959 &amp;gt; https [ACK] Seq=1 Ack=1 Win=14608 Len=0 TSval=3518195 TSecr=1498581&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 06:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32540#M6785</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-14T06:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32541#M6786</link>
      <description>&lt;P&gt;172.20.180.12  -  attacker&lt;BR /&gt;
172.20.180.27  -  host&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 06:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32541#M6786</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-14T06:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32542#M6787</link>
      <description>&lt;P&gt;Assuming that you DON'T have these fields extracted already, we'll do that with &lt;CODE&gt;rex&lt;/CODE&gt; inline in the search;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=XXX 
| rex "^\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d\.\d{6}\s+(?&amp;lt;src_ip&amp;gt;\S+)\s+-&amp;gt;\s+(?&amp;lt;dst_ip&amp;gt;\S+)\s+(?&amp;lt;proto&amp;gt;\w+)\s+(?&amp;lt;YYY&amp;gt;\d+)\s+(?&amp;lt;src_port&amp;gt;\d+)\s+&amp;gt;\s+(?&amp;lt;dst_port&amp;gt;\d+)\s+"
| search dst_ip=172.20.180.27
| timechart span=30s dc(dst_port) by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;rex&lt;/CODE&gt; command should give you a new set of fields, called &lt;CODE&gt;src_ip, dst_ip, proto, YYY, src_port&lt;/CODE&gt; and &lt;CODE&gt;dst_port&lt;/CODE&gt;. What does the YYY number signify? Give it a nicer name if you want. Not used here anyway.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;search&lt;/CODE&gt; after the &lt;CODE&gt;rex&lt;/CODE&gt; filters out the outbound traffic.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;timechart&lt;/CODE&gt; command will give you a table with the distinct number of ports per source-IP in 30 second time slots.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 07:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32542#M6787</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-14T07:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32543#M6788</link>
      <description>&lt;P&gt;and if I wan to alert if there is an port scan by 172.20.180.12(attacker) but a refresh on a webpage can sometime shown more than attacker, so what can I do from here??&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 09:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32543#M6788</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-14T09:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32544#M6789</link>
      <description>&lt;P&gt;Not sure I understand, but &lt;CODE&gt;dc(dst_port)&lt;/CODE&gt; will return the &lt;CODE&gt;distinct count&lt;/CODE&gt;, i.e. if the remote user connects 300 times to port 443 and 5 times to port 80, the distinct count is 2.&lt;/P&gt;

&lt;P&gt;If you used &lt;CODE&gt;c(dst_port)&lt;/CODE&gt; instead (&lt;CODE&gt;c&lt;/CODE&gt; for &lt;CODE&gt;count&lt;/CODE&gt;), the number would be 305.&lt;/P&gt;

&lt;P&gt;If you used &lt;CODE&gt;values(dst_port)&lt;/CODE&gt; the answer would be: &lt;CODE&gt;80, 443&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Does this answer your question?&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 17:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32544#M6789</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-14T17:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32545#M6790</link>
      <description>&lt;P&gt;Yes it does, a really big thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2013 06:01:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32545#M6790</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-15T06:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32546#M6791</link>
      <description>&lt;P&gt;With the qns above, if I were to detect a port scan, it's not possible as the number would exceed more high than port scan if I were to used internet, so, any solution??&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2013 09:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32546#M6791</guid>
      <dc:creator>Kai191</dc:creator>
      <dc:date>2013-05-17T09:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command to identify a Port Scan attack</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32547#M6792</link>
      <description>&lt;P&gt;Sorry, I don't really understand that question.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2013 10:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Command-to-identify-a-Port-Scan-attack/m-p/32547#M6792</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-17T10:39:35Z</dc:date>
    </item>
  </channel>
</rss>

