<?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: How do I find top 10 ports used by attackers? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465894#M191769</link>
    <description>&lt;P&gt;I run those 12 commands seperately, or as one? And do I need the source and sourcetype?&lt;/P&gt;</description>
    <pubDate>Sun, 15 Dec 2019 16:48:59 GMT</pubDate>
    <dc:creator>jpsnlyle</dc:creator>
    <dc:date>2019-12-15T16:48:59Z</dc:date>
    <item>
      <title>How do I find top 10 ports used by attackers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465891#M191766</link>
      <description>&lt;P&gt;I'm not using Regex. There are over 370,00 events, and the payload of the data reads like this:&lt;/P&gt;

&lt;P&gt;payload: {"attackerPort": 4031, "victimPort": 8080, "victimIP": "172.31.14.66", "attackerIP": "222.486.21.184", "connectionType": &lt;BR /&gt;
"initial"}&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2019 23:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465891#M191766</guid>
      <dc:creator>jpsnlyle</dc:creator>
      <dc:date>2019-12-14T23:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find top 10 ports used by attackers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465892#M191767</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;KV_MODE = json&lt;/CODE&gt; for your &lt;CODE&gt;sourcetype&lt;/CODE&gt; on your &lt;CODE&gt;Search Head&lt;/CODE&gt; and you will get all of those fields extracted for free.  Then depending on what you mean, start with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then do either this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| top 10 victimPort
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| top 10 attackerPort
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Dec 2019 06:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465892#M191767</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-15T06:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find top 10 ports used by attackers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465893#M191768</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"payload\": {\"attackerPort\": 4031, \"victimPort\": 8080, \"victimIP\": \"172.31.14.66\", \"attackerIP\": \"222.486.21.184\", \"connectionType\": \"initial\"}}"
| spath
| fields - _*
`comment("the logic is blow")` 
| rename payload.* as *
| table attackerPort victimPort victimIP attackerIP
| eventstats count as attackerPort_count by attackerPort
| eventstats count as victimPort_count by victimPort
| eventstats count as victimIP_count by victimIP
| eventstats count as attackerIP_count by attackerIP
| sort 10 - attackerPort_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think that &lt;CODE&gt;top&lt;/CODE&gt;  is certainly good.&lt;BR /&gt;
However, it might be nice to have other information.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 09:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465893#M191768</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-15T09:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find top 10 ports used by attackers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465894#M191769</link>
      <description>&lt;P&gt;I run those 12 commands seperately, or as one? And do I need the source and sourcetype?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 16:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465894#M191769</guid>
      <dc:creator>jpsnlyle</dc:creator>
      <dc:date>2019-12-15T16:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I find top 10 ports used by attackers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465895#M191770</link>
      <description>&lt;P&gt;First of all, please copy and run all of them.&lt;BR /&gt;
Erase once&lt;BR /&gt;
Then add a comment below to your query and run it&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 22:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-find-top-10-ports-used-by-attackers/m-p/465895#M191770</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-15T22:22:47Z</dc:date>
    </item>
  </channel>
</rss>

