Showing posts with label FireEye. Show all posts
Showing posts with label FireEye. Show all posts

Saturday, September 24, 2016

Splunk Stacking Redline and MIR host-based forensic artifacts

By Tony Lee, Max Moerles, Ian Ahl, and Kyle Champlin

Introduction

Mandiant’s free forensics tool, Redline®, is well-known for its powerful ability to hunt for evil using IOCs, collect host-based artifacts, and even analyze that collected data.  While this gratis capability is fantastic, it is limited to analyzing data from only one host at a time.  But imagine the power and insight that can be gained when looking at a large set of host-based data; especially when the hosts are standardized using a base build or gold disk image.  This would allow analysts to stack this data and use statistics to find outliers and anomalies within the network.  These discovered anomalies could include:

·         Unique services within an organization (names, paths, service owners)
·         Unique processes within an organization (names, paths, process owners)
·         Unique persistent binaries (names, paths, owners)
·         Drive letters/mappings that don't meet corporate standards
·         Infrequent user authentication (such as forgotten or service accounts)

Any of the above example issues could be misconfigurations or incidents--neither of which should be left unnoticed or unsolved.

Requirements and Prototyping

To solve the stacking problem, we had four major requirements.  We needed a platform that could:

1)      Monitor a directory for incoming data
2)      Easily parse XML data (since both Redline and MIR output evidence to XML)
3)      Handle large files and break them into individual events
4)      Apply “big data” analytics to lots of hosts and lots of data


After looking at the requirements and experimenting a bit, Splunk seemed like a good fit.  We started our prototyping by parsing a few output files and creating dashboards within our freely available side project the Splunk Forensic Investigator App.  The architecture looks like the following:

Figure 1:  Architecture required to process Redline and MIR files within Splunk

We gave this app the ability to process just a few Redline and MIR output files such as system, network, and drivers.  Then we solicited feedback and were pleased with the response.

Results

Since the prototype gained interest, we continued the development efforts and the Splunk Forensic Investigator app now handles the following 15 output files:

System
Network
Processes
Services
Ports
Tasks
Prefetch
ShimCache
DNS
User Accounts
URL History
Driver Modules
Persistence
File Listings
Event Logs

After installation and setup, the first dashboard you will see when processing MIR and Redline output is the MIR Analytics dashboard.  This provides heads up awareness of the number of hosts processed, number of individual events, top source types, top hosts, and much more as shown in Figure 2.

Figure 2:  Main MIR Analytics dashboard

Additionally, every processed output type includes both visualization dashboards and analysis dashboards.  Visualization dashboards are designed flush out the anomalies using statistics such as counts, unique counts, most frequent, and least frequent events.  An example can be seen in Figure 3’s visualization example.

Figure 3:  Example visualization dashboard which shows least and most common attributes
The analysis dashboards parse the XML output from Redline and MIR to display it in a human readable and searchable format.  An example can be seen below in Figure 4.

Figure 4:  Example analysis dashboard which shows raw event data

Conclusion

If you use Redline or MIR and would like to stack data from multiple hosts, feel free to download our latest version of the Splunk Forensic Investigator App.  Follow the instructions on the Splunk download page and you should be up and running in no time.  This work can also be expanded to HX, but it will most likely require a bit of pre-processing by first reading the manifest.json file to determine the contents of the randomized file names.  We hope this is useful for other FireEye/Mandiant/Splunk enthusiasts.

Head nod to the "Add-on for OpenIOC by Megan" for ideas:  https://splunkbase.splunk.com/app/1517/ 

Monday, February 15, 2016

Processing Mandiant Redline Files Using Splunk

By Tony Lee

Introduction

Do you use Mandiant's Redline (https://www.fireeye.com/services/freeware/redline.html) for performing host investigation?  Do you use Splunk for centralized log collection and monitoring?  How about using these two tools together?  The team behind the Splunk Forensic Investigator app (https://splunkbase.splunk.com/app/2895/) is experimenting with ingesting Redline collections.  We have made good progress on proving that it is possible to automate the ingestion of Redline collections and use Splunk to carve and display data from multiple hosts at the same time.  However we were wondering how many people would find this capability useful enough to see the work completed.  Check out the prototyping below and let us know if you would find this useful by leaving a comment below (account not necessary).

We have example output below:

System info displayed in Redline


System info displayed in Splunk


Driver modules displayed in Redline



Driver modules displayed in Splunk


Above and beyond replication

Recreating the Redline output is all well and good, however keep in mind that ingesting the data into Splunk allows you to filter, search, and carve across multiple systems at the same time.  Additionally, it would allow you to use Splunk's big data crunching capabilities.  It is very simple to ask Splunk to apply statistical analysis to large data sets to help look for anomalies within hosts such as:
  • Drive letters/mappings that don't meet corporate standards
  • Logged in/on users that occur infrequently (such as service accounts)
  • Forgotten operating systems that may be weak points or exploited first within a network



Or when analyzing drivers on multiple hosts, an investigator could glance at a dashboard and determine any of the following and more:
  • Number of drivers per host
  • Largest driver
  • Smallest driver
  • Most common driver file name
  • Most common driver path
  • Least common driver file name
  • Least common driver path

Conclusion

 These are just some examples of interesting data one might pull from analyzing many collections.  The possibilities are probably endless.  Let us know what you think.  Thanks.



Sunday, August 23, 2015

FireEye Splunk App Introduces the Toolbox

By Tony Lee

Introduction

Splunk development has been a hobby of mine for a while now and the FireEye/Splunk app has been my outlet (when I get a fee night or weekend).  I enjoy it because it is fun to see what you can create and even more fun to see how many people use the app and how they use it.  The latest feature of the FireEye app will hopefully get a lot of use because the potential is unlimited.

The Toolbox

I have helped SOC personnel investigate incidents and found it a bit cumbersome to search for and launch different tools--especially in a segment of the network that has no Internet access.  Therefore, what I would like to do in the next couple of app releases is bring the tools to the analysts.  This effort really started with the last release by introducing Virus Total lookups directly from the app (both hash and IP/URL).  This time we are introducing two new tools:  a base64 converter and a URL decoder.  This could help investigators potentially decode C2 traffic, exploits, and attack URLs all without leaving the app.


Installation Note

After installing version 3.0.7 of the app, you may need to clear the local files--such as:

local/data/ui/nav/default.xml

This local copy of the file may prevent you from seeing the new Toolbox menu that appears in the screenshots below.

VirusTotal Lookup

As mentioned before, this feature was introduced in the last update, but if you have not seen the output, it is worth taking a look.  This tool requires Internet access, but we supply an API key for your convenience.



Base64 Converter

This tool allows responders to encode and decode Base64 data by changing the operation.  This tool does not require Internet access.


URL Decoder

This last tool in the toolbox enables users to decode obfuscated URLs.  This tool does not require Internet access.


Conclusion

Hopefully you will find these tools useful.  Additionally, feel free to provide feedback on any tools you would like to see added to the Toolbox.


Thursday, May 22, 2014

Stopgap: Splunk for FireEye v2 App

By Tony Lee


Introduction
Technology is always progressing… which is great for the most part.  However, progression can sometimes cause compatibility issues when trying to merge two ever-evolving technologies--such as Splunk and FireEye.  This quick post should help get you up and running using the current Splunk for FireEye v2 App.  Preliminary testing shows that the patched version of the app (v2.0.8) should (at a minimum) work with Splunk and FireEye wMPS (NX) OS versions in the table below when following the instructions in this post.


Version
FireEye wMPS (NX) OS 6.X
FireEye wMPS (NX) OS 7.X
Splunk v5
OK
OK
Splunk v6
OK
OK

Outline
  • Background
  • Download
  • Installation from file
  • Creating a Splunk user
  • Configuring FireEye
  • Conclusion


Background
Knowing the background behind the Splunk v2.0.8 patch isn’t needed to make this work, but for those that are curious--see the following link:
http://answers.splunk.com/answers/123168/fireeye-built-in-dashboards-not-working

Download
There are four components that need to be downloaded--all of them require a free Splunk account, so you will need to register if you don’t already have an account.  Even though it is possible, do not try to download the three apps below from within the Splunk App Manager.  Download them from a web browser and save the apps in a directory that you can find later.


  1. Splunk (if not already installed) - http://www.splunk.com/download
  2. Splunk for FireEye App - https://apps.splunk.com/app/409/
  3. Splunk for Google Maps - http://apps.splunk.com/app/368/
  4. Splunk for Geo Location Lookup Script - http://apps.splunk.com/app/291/


Figure 1:  Downloading the apps using a web browser

Installation from file
First install Splunk if you did not already have it installed.  Now install the apps that we previously downloaded to disk.


For Splunk v6, use Apps Manage Apps -> Install app from file -> Browse


Figure 2:  Using app manager to install from file


Navigate to the following apps that you downloaded in the prior step, installing them one by one:
  • Splunk for Google Maps
    • google-maps_113.tgz
  • Splunk for Geo Location Lookup Script
    • geo-location-lookup-script-powered-by-maxmind_106.tgz
  • Splunk for FireEye App
    • fireeye_208.tgz


(Perform any necessary Splunk restarts when requested)


Figure 3:  Uploading the apps
Now that all of the apps are installed, the FireEye and GoogleMaps app should show up in the Splunk Home.
Figure 4:  Apps are installed

Creating a Splunk User
Since the Splunk for FireEye App uses HTTP Post to send FireEye XML data, we need to create a Splunk account that will be used for authentication to post our event data.
Note:  Make sure the account name is alphanumeric only (no whitespaces)
Example username:  fireeye


For Splunk v6, complete the following steps:
  • Log into the Splunk web UI with an admin account
  • Click “Settings -> Users and authentication -> Access Controls”
  • Click “Users” -> Click the "New" button
  • Fill in the required data
  • Privilege Note:  admin role is required (user and power user are not sufficient)
  • Click the "Save" button


C:\Users\tony.lee\AppData\Local\Temp\SNAGHTML4ac25578.PNG
Figure 5:  Creating the Splunk admin account that will accept our HTTP POST messages.

Configuring FireEye
Complete the following steps to send data to Splunk using extended XML via HTTP Post:
  • Log into the FireEye appliance with an administrator account
  • Click “Settings”
  • Click “Notifications”
  • Click the “http” hyperlink
  • Make sure the "Event type" check box is selected
  • Click the “Apply Settings” button


Next to the "Add HTTP Server" button, type "SplunkHTTP". Then click the "Add HTTP Server" button.
Next to the newly created SplunkHTTP entry, ensure the following check boxes are selected:
  • Enabled
  • Auth
  • SSL Enable


Enter the remaining settings:
Server URL:   https://<SplunkAD.DR.ESS>:<PORT>/services/receivers/simple?source=<FireEyeAddress>&sourcetype=fe_xml&index=fe
Username:  fireeye (or username you created in Splunk)
Password:  <password you created above in Splunk>


Note:  The default port used above is 8089--unless it has been changed.


Ex:  https://192.168.33.152:8089/services/receivers/simple?source=FEwMPS1&sourcetype=fe_xml&index=fe


Notifications: Select All Events (recommended)
Delivery: Select Per Event (recommended)
Message Format: XML Extended (recommended, but any XML option can be used)


Remember to click the “Update” button when finished.
Figure 6:  Steps to configure the FireEye appliance to send data to Splunk
Now test the sending and receiving of notifications on the same FireEye Notifications page by clicking the "Test-Fire" button at the bottom.   Flip back over to the Splunk interface and check out the event data in the FireEye App.
Figure 7:  FireEye Overview dashboard


Figure 8:  Malware Overview dashboard

Conclusion
These instructions are intended to help users bridge the gap to the latest version of Splunk and FireEye while a new app is in the works.  Let us know if this worked for you or if you have any issues that we can help solve in the meantime.  Thanks for reading.


Special Thanks To
Ian Ahl
Dennis Hanzlik
Josh McCarthy
Karen Kukoda
Leianne Lamb