unified2 icon

unified2 For Linux

  n/a
WTFPL    

unified2 IDS binary log format parser. #IDS binary  #Log format  #IDS parser  #IDS  #Binary  #Log  

Description

Free Download

unified2 is a pure-Python parser for IDS (think [Snort](http://snort.org)) unified2 binary log format.

Module allows to process IDS logs in binary "unified2" format into python objects.

It does not resolve rule ids and is not meant to be a replacement for barnyard2 or Snort itself in that role.

Main purpose is to extract a packet data from the log, associated with some particular triggered (and resolved/logged separately via other means, e.g. alert_syslog or alert_csv snort modules) rule, so I haven't paid much attention to processing event metadata.

Module doesn't have C components and doesn't use ctypes, so should be fairly portable to non-cPython language implementations.

Format definition is derived from Snort headers (src/sfutil/Unified2_common.h) via pyclibrary module and are cached in unified2/_format.py file.

Newer definitions (say, if new data types were added) can be generated by running the same script on the Snort's Unified2_common.h:

        bzr branch lp:pyclibrary         cd pyclibrary         python .../unified2/_format.py .../snort-2.X.Y.Z/src/sfutil/Unified2_common.h

It's a regular package for Python 2.7 (not 3.X).

Using pip is the best way:

        % pip install unified2

If you don't have it, use:

        % easy_install pip         % pip install unified2

Alternatively see also:         % curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python         % pip install unified2

Or, if you absolutely must:

        % easy_install unified2

But, you really shouldn't do that.

Current-git version can be installed like this:

        % pip install -e 'git://github.com/mk-fg/unified2.git#egg=unified2'

Simple example:

        import unified2.parser         for ev, ev_tail in unified2.parser.parse('/var/log/snort/snort.u2.1337060186'):                 print 'Event:', ev                 if ev_tail: print 'Event tail:', ev_tail

Event object here is a dict of metadata and a "tail", which can either be a blob or a similar recursively-parsed tuple of metadata-dict and "tail" (e.g. for UNIFIED2_EXTRA_DATA).

unified2.parser.Parser interface is best illustrated by the unified2.parser.read function:

        parser, buff_agg = Parser(), ''         while True:                 buff = parser.read(src)                 if not buff: break # EOF                 buff_agg += buff                 while True:                         buff_agg, ev = parser.process(buff_agg)                         if ev is None: break                         yield ev Idea here is that Parser.read method should be called with a stream (e.g. a file object), returning however many bytes parser needs to get the next parseable chunk of data (one packet, in case of u2 log) or whatever can be read at the moment, empty string is usually an indication of EOF or maybe non-blocking read return.

Parser.process then should be called with accumulated (by Parser.read calls) buffer, returning the first packet that can be parsed from there (or None, if buffer isn't large enough) and remaining (non-parsed) buffer data.

System requirements

unified2 12.07.0

add to watchlist add to download basket send us an update REPORT
  runs on:
Linux
  filename:
unified2-12.07.0.tar.gz
  main category:
System
  developer:
  visit homepage

Bitdefender Antivirus Free 27.0.35.146

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

Windows Sandbox Launcher 1.0.0

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

ShareX 16.0.1

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

Zoom Client 6.0.0.37205

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

IrfanView 4.67

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

paint.net 5.0.13 (5.13.8830.42291)

Packed with an array of options and an intuitive interface, this application enables you to create professional-looking photographs
paint.net

4k Video Downloader 1.5.2.0077 Plus / 4.30.0.5655

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

Microsoft Teams 24060.2623.2790.8046 Home / 1.7.00.7956 Work

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

calibre 7.8.0

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

7-Zip 23.01 / 24.04 Beta

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

% discount
Microsoft Teams
  • Microsoft Teams
  • calibre
  • 7-Zip
  • Bitdefender Antivirus Free
  • Windows Sandbox Launcher
  • ShareX
  • Zoom Client
  • IrfanView
  • paint.net
  • 4k Video Downloader
essentials


User Comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy