recontech404 / Kairos

Open Source eBPF Malware Analysis Framework
GNU Affero General Public License v3.0
43 stars 5 forks source link

Kairos

An Open Source eBPF Malware Analysis Framework

License

Features


Mirai Nerfed

Pyloose

https://github.com/user-attachments/assets/61c858c2-91c7-4be0-9dc2-4b12e50333ad

https://github.com/user-attachments/assets/d9aeccce-3b5e-489d-8d84-ba0435122c9c

Tech Stack

Getting Started

Prerequisites

Ollama Model Setup

On the Ollama host pull the llama3.1:8b model

ollama pull llama3.1:8b

1. Clone the repository

git clone git@github.com:recontech404/Kairos.git
cd Kairos

2. Install dependencies (for Debian)

sudo apt install build-essential libbpf-dev clang linux-tools-$(uname -r)

Note: Modify the env values for network in the docker-compose.yml's if needed

3. Build and deploy the Server in docker (populate Ollama host first in build/docker-compose.yml)

cd Server
make build && make deploy

4. Build and deploy the UI in docker (from root dir)

cd UI/kairos-ui
make build && make deploy

5. Build the Runner (from root dir) -- see Arm64 for building on arm64

cd Runner
make

Note: when running the make command in the Runner folder for the first time, you will may need to re-install the correct linux headers for bpf for your kernel version if the make command fails:

WARNING: bpftool not found for kernel 6.5.0-44

  You may need to install the following packages for this specific kernel:
    linux-tools-6.5.0-44-generic
    linux-cloud-tools-6.5.0-44-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic

->example fix: sudo apt install linux-tools-6.5.0-44-generic

6. Start the Runner (modify makefile run phony if you modified the server listen address/port)

make run

Note:

For testing this is done on the same machine as the Server and UI, but the main binary and eBPF/main.bpf.o can be copied to a VM or another machine (see Runner Future State for more info)

Ensure that the main.bpf.o is in a subfolder called eBPF/ and then the command

sudo WS_ADDRESS=127.0.0.1 WS_PORT=8080 SKIP_VERIFY_TLS=TRUE ./main

If you wish to enable verbose logging you can add the LOG_V=TRUE env value. If you are running the server with a certificate you can enable TLS verfication

7. Open the app in your browser

Visit http://localhost:8000 in your browser

How To Use Kairos

Field Explanations


System Settings


Arm64 Runner Details

Future State

Runner Future State


Architecture

alt text