Skip to main content

Kestrel Python Analytics Interface

Project description

Kestrel Threat Hunting Language Python 3 Code Style: Black Code Coverage Latest Version PyPI Downloads Documentation Status

[News] Kestrel session at Black Hat USA 2023


Kestrel is a threat hunting language aiming to make cyber threat hunting fast by providing a layer of abstraction to build reusable, composable, and shareable hunt-flow. Starting with:

  1. Black Hat USA 2022 session recording

  2. Black Hat USA 2022 Kestrel hunting lab

  3. Kestrel live tutorial in a cloud sandbox

The Goal

Software developers write Python or Swift than machine code to quickly turn business logic into applications. Threat hunters write Kestrel to quickly turn threat hypotheses into hunt-flow. We see threat hunting as an interactive procedure to create customized intrusion detection systems on the fly, and hunt-flow is to hunts as control-flow is to ordinary programs.

What does it mean by hunt fast?

  • Do NOT write the same TTP pattern in different data source queries.

  • Do NOT write one-time-use adapaters to connect hunt steps.

  • Do NOT waste your existing analytic scripts/programs in future hunts.

  • Do construct your hunt-flow from smaller reuseable hunt-flow.

  • Do share your huntbook with your future self and your colleagues.

  • Do get interactive feedback and revise hunt-flow on the fly.


Kestrel Hunting Demo

Kestrel in a Nutshell

Kestrel overview.
  • Kestrel language: a threat hunting language for a human to express what to hunt.

    • expressing the knowledge of what in patterns, analytics, and hunt flows.

    • composing reusable hunting flows from individual hunting steps.

    • reasoning with human-friendly entity-based data representation abstraction.

    • thinking across heterogeneous data and threat intelligence sources.

    • applying existing public and proprietary detection logic as analytic hunt steps.

    • reusing and sharing individual hunting steps, hunt-flow, and entire huntbooks.

  • Kestrel runtime: a machine interpreter that deals with how to hunt.

    • compiling the what against specific hunting platform instructions.

    • executing the compiled code locally and remotely.

    • assembling raw logs and records into entities for entity-based reasoning.

    • caching intermediate data and related records for fast response.

    • prefetching related logs and records for link construction between entities.

    • defining extensible interfaces for data sources and analytics execution.

Basic Concepts and Howto

Visit Kestrel documentation to learn Kestrel:

Kestrel Huntbooks And Analytics

Kestrel Hunting Blogs

  1. Building a Huntbook to Discover Persistent Threats from Scheduled Windows Tasks

  2. Practicing Backward And Forward Tracking Hunts on A Windows Host

  3. Building Your Own Kestrel Analytics and Sharing With the Community

  4. Setting Up The Open Hunting Stack in Hybrid Cloud With Kestrel and SysFlow

  5. Try Kestrel in a Cloud Sandbox

  6. Fun with securitydatasets.com and the Kestrel PowerShell Deobfuscator

  7. Kestrel Data Retrieval Explained

Talks And Demos

Talk summary (visit Kestrel documentation on talks to learn details):

Connecting With The Community

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

kestrel_analytics_python-1.8.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

kestrel_analytics_python-1.8.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file kestrel_analytics_python-1.8.0.tar.gz.

File metadata

File hashes

Hashes for kestrel_analytics_python-1.8.0.tar.gz
Algorithm Hash digest
SHA256 a9d5aebcf3d755f643f595f6bde475a8d14a56f84c5e597f19ec063ad3040ed2
MD5 102f069cd98b6fcf3c9cd669fa05f9f5
BLAKE2b-256 a28b5fa2f256e318febaa16d1e2fba33338b8e6b49b6f1803425095985460cf7

See more details on using hashes here.

File details

Details for the file kestrel_analytics_python-1.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kestrel_analytics_python-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3601955edd2168d977cea02aaa7faca2d9f4fe30af38ead00534b389c4e377f9
MD5 2ad1b2f425cf6740e2251f6469e37e1f
BLAKE2b-256 f9fe6d0b10618755520d8b61d0a6d937d657e215ccdcad893747ea18b429be9d

See more details on using hashes here.

Supported by

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