Giter VIP home page Giter VIP logo

redlinetimelinedb_extractor's Introduction

RedLineTimelineDB_extractor

Extracts the Timeline of a Redline parsed sqlite database so it can be used e.g. in an ELK stack.

Redline

Redline is a tool developed by Mandiant / Fireeye to do live forensics / Incident response.

The RedLineTimelineDB_extractor is NOT made to replace Redline.

Usage

  • Process the Live response file in redline, to create a SQLlite out of the XML files.
  • Locate the SQLite database file e.g. SystemXYZ.mans
  • python3 -f SystemXYZ.mans
  • wait till the script finishes
  • locate the SystemXYZ.mans.csv
  • continue your analysis with the generated CSV file
  • if you passed a folder + filename as an argument, the CSV will be created in the same folder

Notes

Timestamps

As Redline writes every timestamp with a Z for Zulu at the end of the timeline, but most tools cannot deal with it, it will be removed in every line. Every timestamp is UTC.

Performance

The script was tested on a regular notebook with a SQLite database 1,1 GB with 1920738 enties in timetable and it took around 3 minutes to create the CSV file with a size of 485 MB.

The amount of lines per CSV write can be adjusted, so finetuning is possible to rate IO of the SQLite against IO to write the CSV file.

redlinetimelinedb_extractor's People

Contributors

deralexxx avatar jaegeral avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redlinetimelinedb_extractor's Issues

Exception Thrown When Writing Unicode To CSV

Problem:

It appears that some .mans files generated by HX (from default Comprehensive Investigative Details acquisition script) contain unicode strings - I haven't managed to pinpoint which EventType(s) this applies to.

.mans file was +4.5GB in size, console output below:

2019-08-14 16:29:41,912 - rltldb_application - INFO - Redline Timeline DB <-> CSV Converter
2019-08-14 16:29:41,914 - rltldb_application - INFO - Converting file at .\REDACTED_Comprehensive Investigative Details_2019-08-10T06_04_57Z.mans
2019-08-14 16:31:08,470 - rltldb_application - INFO - Number of rows: 5975022
2019-08-14 16:31:08,472 - rltldb_application - INFO - Processing 1-10001 / 5975022
2019-08-14 16:31:08,774 - rltldb_application - INFO - Processing 10001-20001 / 5975022
2019-08-14 16:31:09,044 - rltldb_application - INFO - Processing 20001-30001 / 5975022
2019-08-14 16:31:09,322 - rltldb_application - INFO - Processing 30001-40001 / 5975022
2019-08-14 16:31:09,697 - rltldb_application - INFO - Processing 40001-50001 / 5975022
2019-08-14 16:31:10,084 - rltldb_application - INFO - Processing 50001-60001 / 5975022
2019-08-14 16:31:10,475 - rltldb_application - INFO - Processing 60001-70001 / 5975022
2019-08-14 16:31:10,778 - rltldb_application - INFO - Processing 70001-80001 / 5975022
<p>Error: <class 'UnicodeEncodeError'></p>

Solution:

Specify utf-8 encoding when opening .csv file.

Current
47: with open(csvfilename, 'w', newline='') as csvfile:
Solution
47: with open(csvfilename, 'w', newline='', encoding='utf-8') as csvfile:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.