<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="https://keepwatch.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://keepwatch.github.io/" rel="alternate" type="text/html" /><updated>2019-06-19T02:36:36+00:00</updated><id>https://keepwatch.github.io/feed.xml</id><title type="html">keepwatch</title><subtitle>infosec monitoring musings</subtitle><entry><title type="html">Splunk Sysmon Correlation</title><link href="https://keepwatch.github.io/splunk-sysmon-correlation/" rel="alternate" type="text/html" title="Splunk Sysmon Correlation" /><published>2018-06-18T00:00:00+00:00</published><updated>2018-06-18T00:00:00+00:00</updated><id>https://keepwatch.github.io/splunk-sysmon-correlation</id><content type="html" xml:base="https://keepwatch.github.io/splunk-sysmon-correlation/">&lt;h2 id=&quot;correlating-sysmon-data-in-splunk-part-1&quot;&gt;Correlating Sysmon data in Splunk: Part 1&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.splunk.com/&quot;&gt;Splunk&lt;/a&gt; is a great tool for log management (assuming you have $$$, licensing gets expensive). It uses functions which can be chained together to accomplish almost anything imaginable. However, understanding how to use these functions well is challenging. This series of posts will expose several Splunk functions, how they interact, and how to correlate data (connecting two different events) in Splunk.&lt;/p&gt;

&lt;h3 id=&quot;why-correlate-at-all&quot;&gt;Why correlate at all?&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon&quot;&gt;Sysmon&lt;/a&gt; events are amazing when correlated. This open-source host monitoring tool generates &lt;code class=&quot;highlighter-rouge&quot;&gt;process create&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;network connection&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;file create&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;registry add/modify/remove&lt;/code&gt; event types (to name a few). These events are associated with an &lt;code class=&quot;highlighter-rouge&quot;&gt;Image&lt;/code&gt; (the program that performs the logged action) and &lt;code class=&quot;highlighter-rouge&quot;&gt;ProcessGuid&lt;/code&gt; field (identifying the exact instance of the Image that performed the action). Correlating a suspicious network connection with the CommandLine that launched the instance of that Image is invaluable.&lt;/p&gt;

&lt;p&gt;Note that many data sources can be correlated - proxy and DNS logs could be correlated on a hostname, Ironport logs can be correlated on a Message ID (&lt;code class=&quot;highlighter-rouge&quot;&gt;MID&lt;/code&gt;), etc - so the Splunk principles we’ll discuss are useful beyond Sysmon data.&lt;/p&gt;

&lt;h3 id=&quot;how-to-correlate-manually&quot;&gt;How to correlate manually&lt;/h3&gt;

&lt;p&gt;First, let’s state some assumptions about your Splunk and Sysmon configuration. Swap these fieldnames with the appropriate values for your environment.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Sysmon data stored in Splunk at: &lt;code class=&quot;highlighter-rouge&quot;&gt;index=sysmon&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Sysmon event ID field name: &lt;code class=&quot;highlighter-rouge&quot;&gt;EventID&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OK, so how can we correlate?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Find a non-process Sysmon event you want to investigate further - like a network connection: &lt;code class=&quot;highlighter-rouge&quot;&gt;index=sysmon EventID=3 | head 1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Identify the &lt;code class=&quot;highlighter-rouge&quot;&gt;ProcessGuid&lt;/code&gt; field value&lt;/li&gt;
  &lt;li&gt;Search Splunk for the associated process create event: &lt;code class=&quot;highlighter-rouge&quot;&gt;index=sysmon EventID=1 &quot;&amp;lt;ProcessGuid field value&amp;gt;&quot; ProcessGuid=&quot;&amp;lt;ProcessGuid field value&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;That’s it! Now you have access to &lt;code class=&quot;highlighter-rouge&quot;&gt;User&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;CommandLine&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;ParentCommandLine&lt;/code&gt;, along with every other event (if you remove &lt;code class=&quot;highlighter-rouge&quot;&gt;EventID=1&lt;/code&gt;) spawned by that process!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Doing this correlation in a single search is quite a bit harder. Our next post will talk about correlation using &lt;code class=&quot;highlighter-rouge&quot;&gt;| join&lt;/code&gt; and subsearches.&lt;/p&gt;</content><author><name></name></author><summary type="html">Correlating Sysmon data in Splunk: Part 1</summary></entry></feed>