<?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: Search for account failing a log on at repeating intervals in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305043#M57513</link>
    <description>&lt;P&gt;Try something like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4625 Account_Name !="-"
| eventstats count as repeatcount by Account_Name, dest 
| where repeatcount &amp;gt; 1
| sort 0 Account_Name, dest, _time
| streamstats current=f last(_time) as priorTime by Account_Name, dest
| eval delay= _time - priorTime
| eventstats avg(delay) as avgdelay stdev(delay) as stdevdelay by Account_Name, dest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have all the events, the time delay between them, and an idea whether the time between them is variable or relatively static.  &lt;/P&gt;

&lt;P&gt;You could use that universe to identify what "normal" is for standard deviation relative to delay.  You could throw out delays that are less than a minute either before or after the above calculations, or calculate it both ways.  You could clump them in 5 minute increments either before or after calculating &lt;CODE&gt;delay&lt;/CODE&gt;. Lots of ways to proceed, but the above strategy should handle your current issue.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 18:28:20 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-10-12T18:28:20Z</dc:date>
    <item>
      <title>Search for account failing a log on at repeating intervals</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305042#M57512</link>
      <description>&lt;P&gt;I'm trying to make a search that looks for an account trying to log onto a destination at a repeating interval. This will hopefully cover two potential uses:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Find rogue service accounts with bad passwords or the like repeatedly hitting a location&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Find bot activity / slow brute forces due to scripts.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I've been having pretty serious brain-farts this morning, but so far I have this:&lt;BR /&gt;
&lt;CODE&gt;index=wineventlog EventCode=4625 Account_Name !="-"| stats count by Account_Name, dest | where count &amp;gt; 1&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Which is showing me accounts that have failed authentication multiple times against the same destination. The easy part. Now I need to have them be specific times apart and analyze the trend and that's what's confusing me.&lt;/P&gt;

&lt;P&gt;I'm coming to realize that this is more complex that I had originally thought. If I wanted them to be exactly an hour apart that would be &lt;EM&gt;less&lt;/EM&gt; hard (still struggling) but I'm looking for a more generic trend analysis looking for an account having a periodic repeat of any kind.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Edit:&lt;/P&gt;

&lt;P&gt;I suppose the big question I have is: "How do I create a search that will run over a period of time and find a trend in the data. Is this username failing to log on to this server at a specific period? What's the period? Is it every hour? Every 227 seconds? Is this even possible?"&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 15:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305042#M57512</guid>
      <dc:creator>j4adam</dc:creator>
      <dc:date>2017-10-12T15:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Search for account failing a log on at repeating intervals</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305043#M57513</link>
      <description>&lt;P&gt;Try something like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4625 Account_Name !="-"
| eventstats count as repeatcount by Account_Name, dest 
| where repeatcount &amp;gt; 1
| sort 0 Account_Name, dest, _time
| streamstats current=f last(_time) as priorTime by Account_Name, dest
| eval delay= _time - priorTime
| eventstats avg(delay) as avgdelay stdev(delay) as stdevdelay by Account_Name, dest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have all the events, the time delay between them, and an idea whether the time between them is variable or relatively static.  &lt;/P&gt;

&lt;P&gt;You could use that universe to identify what "normal" is for standard deviation relative to delay.  You could throw out delays that are less than a minute either before or after the above calculations, or calculate it both ways.  You could clump them in 5 minute increments either before or after calculating &lt;CODE&gt;delay&lt;/CODE&gt;. Lots of ways to proceed, but the above strategy should handle your current issue.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:28:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305043#M57513</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-12T18:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search for account failing a log on at repeating intervals</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305044#M57514</link>
      <description>&lt;P&gt;Thank you for the response! From a quick eye test and some tweaking it looks like it's pretty much exactly what I need. Can you confirm I'm reading this correctly? I am also seeing two usernames in one row sometimes. I'm not sure what to make of that.&lt;/P&gt;

&lt;P&gt;The below is going to display a table of accounts that are failing to log into the corresponding server with an average standard deviation in time of less than 30 seconds:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=wineventlog EventCode=4625 Account_Name !="-" &lt;BR /&gt;
 | where NOT LIKE(Account_Name,"%$") &lt;BR /&gt;
 | eventstats count as repeatcount by Account_Name, dest &lt;BR /&gt;
 | where repeatcount &amp;gt; 1&lt;BR /&gt;
 | sort 0 Account_Name, dest, _time&lt;BR /&gt;
 | streamstats current=f last(_time) as priorTime by Account_Name, dest&lt;BR /&gt;
 | eval delay= _time - priorTime&lt;BR /&gt;
 | eventstats avg(delay) as avgdelay stdev(delay) as stdevdelay by Account_Name, dest&lt;BR /&gt;
 | where stdevdelay &amp;lt; 30&lt;BR /&gt;
 | table Account_Name, dest, avgdelay, stdevdelay&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 18:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305044#M57514</guid>
      <dc:creator>j4adam</dc:creator>
      <dc:date>2017-10-12T18:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Search for account failing a log on at repeating intervals</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305045#M57515</link>
      <description>&lt;P&gt;@j4adam.  That is correct, there are often two Account_Name fields, due to the structure of windows events.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4625"&gt;https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4625&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You might find you need to adjust that standard deviation test.  30 seconds stdev is nothing if I try and fail to log on real fast three times in a row... but most installations, 3 is the most that can happen that way, so it wouldn't be quite the kind of thing you are looking for anyway.  &lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Search-for-account-failing-a-log-on-at-repeating-intervals/m-p/305045#M57515</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-12T20:20:05Z</dc:date>
    </item>
  </channel>
</rss>

