Skip to main content

A generator for Velociraptor-based offline collectors

Project description

Generaptor

Introduction

Generaptor is a platform-agnostic command line tool to generate a Velociraptor offline collector based on pre-configured or customizable collection profiles.

All platforms can generate collectors for all targets, there is no limitation thanks to Python on the generation side and velociraptor on the configuration repacking side.

Generation of Darwin collector is not implemented for the moment due to the lack of use case on our side. Feel free to open a pull request regarding this feature.

Dependencies

Dependencies are listed in setup.cfg under install_requires option.

Setup

The setup is the same for Linux, Windows and Darwin as long as Python 3.9+ is installed and registered in the PATH environment variable. Using a Python virtual environment is recommended.

python3 -m pip install git+https://github.com/cert-edf/generaptor

Basic Collector Generation

# First, we fetch latest stable release of velociraptor
generaptor refresh
# Then create a collector for windows for instance
generaptor generate -o /data/case/case-001/collectors/ windows
# keep the private key secret in a password vault to be able to decrypt the archive
# /data/case/case-001/collectors now contains a collector and its configuration file

Advanced Collector Generation

Some options allow to customize collectors:

# Explore generate options using
generaptor generate -h
# Explore linux-specific options using
generaptor generate linux -h
# Explore windows-specific options using
generaptor generate windows -h
# Generate a single-device collector for windows
# (windows default collector collects all devices)
generaptor generate windows --device D:
# Collector targets customization (interactive)
generaptor generate --custom windows
# Collector targets customization using a profile (non interactive)
echo '{"targets":["IISLogFiles"]}' > iis_server.json
generaptor generate --custom-profile iis_server.json windows

Expert Collector Generation

Generaptor can use optional configuration files put in $HOME/.config/generaptor directory to generate collectors.

Target and rules can be extended using this configuration directory.

VQL templates can also be modified to add custom artifacts or modify the collector behavior. Please refer to Velociraptor documentation to learn how to master VQL and write your own configuration files.

After starting generaptor for the first time, you can use the following commands to initialize the configuration directory

# Add variables for directories in current environment
export CACHE="${HOME}/.cache/generaptor"
export CONFIG="${HOME}/.config/generaptor"
# Copy header for each file
head -n 1 "${CACHE}/linux.rules.csv" > "${CONFIG}/linux.rules.csv"
head -n 1 "${CACHE}/linux.targets.csv" > "${CONFIG}/linux.targets.csv"
head -n 1 "${CACHE}/windows.rules.csv" > "${CONFIG}/windows.rules.csv"
head -n 1 "${CACHE}/windows.targets.csv" > "${CONFIG}/windows.targets.csv"
# Copy VQL templates
cp "${CACHE}/linux.collector.yml" "${CONFIG}/"
cp "${CACHE}/windows.collector.yml" "${CONFIG}/"

Collection Processing

# Extract a collection
generaptor extract \
           --directory /data/case/case-001/collection/ \
           private.key.pem \
           Collection_COMPUTERNAME_DEVICENAME_YYYY-mm-ddTHH-MM-SS.zip

Contributors

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

generaptor-9.1.2-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

Details for the file generaptor-9.1.2-py3-none-any.whl.

File metadata

  • Download URL: generaptor-9.1.2-py3-none-any.whl
  • Upload date:
  • Size: 62.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for generaptor-9.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4333ce1d10caaf672c458b38d1c644615d8824280df5e6436a6b5858638653d7
MD5 fdb447fd0b1204948c61f6a52816c082
BLAKE2b-256 7d12a377a6366923fdf388100a2036a45ba1c01fcfbcca82b251a266e953fe3d

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