Skip to main content

Bro Analysis Tools

Project description

Bro Analysis Tools

The BAT Python package supports the processing and analysis of Bro IDS data with Pandas, scikit-learn, Spark and more…

Why BAT?

Bro IDS already has a flexible, powerful scripting language why should I use BAT?

Offloading: Running complex tasks like statistics, state machines, machine learning, etc.. should be offloaded from Bro IDS so that Bro can focus on the efficient processing of high volume network traffic.

Data Analysis: We have a large set of support classes that help bridge from raw Bro IDS data to packages like Pandas, scikit-learn, Spark and more. We also have example notebooks that show step-by-step how to get from here to there.

Easy: Make a Python Dictionary

from bat import bro_log_reader
...
    # Run the bro reader on a given log file
    reader = bro_log_reader.BroLogReader('dhcp.log')
    for row in reader.readrows():
        pprint(row)

Output: Each row is a nice Python Dictionary with timestamps and types properly converted.

{'assigned_ip': '192.168.84.10',
'id.orig_h': '192.168.84.10',
'id.orig_p': 68,
'id.resp_h': '192.168.84.1',
'id.resp_p': 67,
'lease_time': datetime.timedelta(49710, 23000),
'mac': '00:20:18:eb:ca:54',
'trans_id': 495764278,
'ts': datetime.datetime(2012, 7, 20, 3, 14, 12, 219654),
'uid': 'CJsdG95nCNF1RXuN5'}
...

Easy: Make a Pandas DataFrame (in one line of code)

from bat.log_to_dataframe import LogToDataFrame
...
    # Create a Pandas dataframe from a Bro log
    bro_df = LogToDataFrame('/path/to/dns.log')

    # Print out the head of the dataframe
    print(bro_df.head())

Output: All the Bro log data is in a Pandas DataFrame with proper types and timestamp as the index

                                                     query      id.orig_h  id.orig_p id.resp_h \
ts
2013-09-15 17:44:27.631940                     guyspy.com  192.168.33.10       1030   4.2.2.3
2013-09-15 17:44:27.696869                 www.guyspy.com  192.168.33.10       1030   4.2.2.3
2013-09-15 17:44:28.060639   devrubn8mli40.cloudfront.net  192.168.33.10       1030   4.2.2.3
2013-09-15 17:44:28.141795  d31qbv1cthcecs.cloudfront.net  192.168.33.10       1030   4.2.2.3
2013-09-15 17:44:28.422704                crl.entrust.net  192.168.33.10       1030   4.2.2.3

More Examples

  • Easy ingestion of any Bro Log into Python (dynamic tailing and log rotations are handled)

  • Bro Logs to Pandas Dataframes and Scikit-Learn

  • Dynamically monitor files.log and make VirusTotal Queries

  • Dynamically monitor http.log and show ‘uncommon’ User Agents

  • Running Yara Signatures on Extracted Files

  • Checking x509 Certificates

  • Anomaly Detection

  • See BAT Examples for more details.

Analysis Notebooks

BAT enables the processing, analysis, and machine learning of realtime data coming from Bro IDS.

Install

$ pip install bat

Documentation

bat-tools.readthedocs.org

Thanks

  • The DummyEncoder is based on Tom Augspurger’s great PyData Chicago 2016 Talk

Kitware Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bat-0.2.6.tar.gz (88.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bat-0.2.6-py2.py3-none-any.whl (105.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file bat-0.2.6.tar.gz.

File metadata

  • Download URL: bat-0.2.6.tar.gz
  • Upload date:
  • Size: 88.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bat-0.2.6.tar.gz
Algorithm Hash digest
SHA256 a25cda17179ebe4e12db27d17d0ef2e7c126a759dd6206f51d11893b134b52db
MD5 1f9bb24b82c18df8cb631cca6cc08050
BLAKE2b-256 1b9627b1352f938495e40fc73c471c40a21fc131b2166b32e0dd68ccd402d303

See more details on using hashes here.

File details

Details for the file bat-0.2.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bat-0.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51ef62d3cb4654615047f2846044c373d0c7b261835731ee392e1f066959beb9
MD5 e6798f24c571da6508e736f1a0c39a13
BLAKE2b-256 9e631b3d0da47f0b1caa41c29785a9c21e3c4628ff81c1fecf42c66deb099074

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page