Skip to main content

🎯 ApexHunter

Agentic Threat Hunting at Machine Speed

License Stars Python LLM Platform 4715f328-07ea-430d-8b11-c7a5ed872143(1) ApexHunter is an autonomous, agentic threat hunting playbook executor designed for senior SOC analysts and DFIR professionals. It bridges the gap between static detection and intelligent investigation by executing structured YAML playbooks against forensic artifacts (EVTX, CSV, JSON, Parquet) using local LLMs for correlation, triage, and automated discovery.


🚀 Overview

In modern SOC environments, the bottleneck isn't data collection, it's the cognitive load of analysis. ApexHunter automates this by:

  • Offline-First Design: Processes sensitive telemetry 100% locally on your Kali instance. No data ever leaves your air-gapped environment.
  • Agentic Reasoning: Uses local Ollama models (Mistral, Llama3) to autonomously generate SQL queries and triage findings.
  • Forensic Power: Native ingestion of Windows Event Logs (.evtx), Sysmon telemetry, and large-scale CSV/JSON exports.
  • Professional Outputs: Generates interactive HTML dashboards, Mermaid-based execution timelines, and MITRE ATT&CK® layer mappings.

✨ Features

  • 🛡️ Multi-Engine Execution: Run SQL-standard queries via DuckDB for blazing-fast in-memory analysis.
  • 🤖 Discovery Mode: Define high-level hypotheses and let the LLM generate the investigation logic dynamically.
  • 🔎 Forensic Ingestion: Automatically flattens binary .evtx logs into queryable relational tables.
  • 🔗 Intelligent Chaining: Chain hunting steps based on previous hits or LLM-driven "is_suspicious" flags.
  • 📊 Reporting: Produces professional Markdown and dark-mode HTML reports for executive briefings.

🏗️ Architecture

graph TD
    A[YAML Playbook] --> B[ApexHunter Engine]
    C[(Forensic Logs: EVTX/CSV/JSON)] --> B
    B --> D{DuckDB In-Memory}
    D --> E[LLM Agentic Layer]
    E -- Dynamic SQL --> D
    E -- Reasoning --> F[Enrichment & Triage]
    F --> G[HTML/Markdown Report]
    F --> H[ATT&CK Mapping]

🛠️ Installation

1. Install Ollama (Local LLM Engine)

ApexHunter requires a local Ollama instance to perform agentic reasoning.

After installation, pull the recommended model:

ollama pull mistral:latest

2. Install ApexHunter

Ensure you have Python 3.9+ installed.

Linux / macOS

git clone https://github.com/bogdanticu88/ApexHunter.git
cd ApexHunter
python3 -m venv .venv
source .venv/bin/activate
pip install .

Windows (PowerShell)

git clone https://github.com/bogdanticu88/ApexHunter.git
cd ApexHunter
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install .

Global Install (Run from anywhere)

To install ApexHunter globally so you can call it from any directory:

pip install pipx
pipx install .

Now, simply type apexhunter in any terminal to launch the wizard.


📖 Usage

Interactive Wizard (Recommended)

Launch the guided setup to select playbooks and datasets:

apexhunter

Standard CLI Mode

Execute a specific hunt with automated report generation:

apexhunter run --playbook playbooks/ransomware_beacon_hunt.yaml --data-dir /path/to/logs --markdown report.md

Dashboard View

Visualize your findings interactively:

streamlit run dashboard.py

🧩 Example Playbook

name: WMI Persistence Hunt
hypothesis: Attacker established persistence via WMI event subscriptions.
severity: high
steps:
  - id: step_1_wmi_events
    description: "Detect WMI Event IDs 19, 20, 21 in Sysmon logs"
    query_type: sql
    query: "SELECT * FROM sysmon_logs WHERE event_id IN (19, 20, 21)"
    condition: "count > 0"
    next_on_hit: step_2_llm_triage
    llm_instruction: "Analyze the WMI filters for suspicious consumer names like 'Ghost' or 'Backdoor'."

🤝 Contributing

Contributions are what make the open-source community an amazing place to learn, inspire, and create.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

⚖️ License

Distributed under the MIT License. See LICENSE for more information.

Copyright (c) 2026 bogdanticu88

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Developed by bogdanticu88

Metadata

Release files for apex-hunter-dfir 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apex-hunter-dfir 0.1.0
File Size Uploaded
apex_hunter_dfir-0.1.0.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apex-hunter-dfir 0.1.0
File Interpreter ABI Platform
apex_hunter_dfir-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / apex_hunter_dfir-0.1.0.tar.gz

Download URL apex_hunter_dfir-0.1.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f4cca9a84acf1ef4ce6a3b17c4efacade9abde10c478d9165dc912655fa3d6
BLAKE2b-256 checksum
How to use checksums
05141c6dc8eb10f7360bd3ea9a675c86824c1b053b67c2e15258996f19955f90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / apex_hunter_dfir-0.1.0-py3-none-any.whl

Download URL apex_hunter_dfir-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22fce98b7aee217da792687a69b531c240afc5c0b68b6d34d14fa40c67a48052
BLAKE2b-256 checksum
How to use checksums
9548ad05d0f5bceadc616c7d0bb5a6f25ed367de067380240dcd4c21a43d94b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page