Skip to main content

PyLOOBins

PyLOOBins is a Python SDK and command-line utility for programmatically interacting with LOOBins.

You can download PyLOOBins from PyPI by running the following command: pip install pyloobins

PyLOOBins requires Python 3.8 or later.

Usage

Command-line

You can run pyloobins --help to see the available commands and options.

>>> pyloobins --help

Usage: pyloobins [OPTIONS] COMMAND [ARGS]...

  Create, validate, and view LOOBin objects.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  create       Create a YAML template file for a new LOOBin.
  export-stix  Export the LOOBins STIX bundle file.
  get          Get a LOOBin object.
  validate     Validate a LOOBin YAML file.

You can run pyloobins <command> --help to see the available options for a specific command.

>>> pyloobins validate --help
Usage: pyloobins validate [OPTIONS]

  Validate a LOOBin YAML file.

Options:
  --path TEXT  The path of the LOOBin YAML file to validate.  [required]
  --help       Show this message and exit.

SDK

You can use pyloobins as a Python SDK to programmatically interact with LOOBins.

pyloobins.util

The util module can be used to get LOOBin objects from the LOOBins API, validate LOOBin YAML files, and create LOOBin YAML templates.

Example: get all LOOBins and print a list of the use case code.

from pyloobins import util

loobins = util.get_loobins()

for loobin in loobins:
  for uc in loobin.example_use_cases:
    print(f"{loobin.name}: {uc.code}")

pyloobins.models

The models module contains the classes that represent a LOOBin and its various components.

Example: programmitcally create a LOOBin object.

from pyloobins.models import Detection, ExampleUseCase, LOOBin, Resource

l = LOOBin(
        name="",
        short_description="A short description of the binary goes here.",
        full_description="A full length description of the binary goes here.",
        author="Enter your name or alias here.",
        created=date.today(),
        example_use_cases=[
            ExampleUseCase(
                name="An Example Use Case",
                description="A description of the use case goes here.",
                code="A code snippet goes here.",
                tactics=["Discovery"],
                tags=["example_tag", "another_tag"],
            )
        ],
        paths=["/enter/binary/path/here"],
        detections=[
            Detection(
                name="A detection source (e.g. Sigma)",
                url="https://urltodetection.here",
            )
        ],
        resources=[
            Resource(
                name="Name of resources.",
                url="https://urlofexternalreference.here",
            )
        ],
        acknowledgements=["Enter any acknowledgements here."],
    )

with open ("loobin.yaml", "w") as f:
  f.write(l.to_yaml())

Download files

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

Source Distribution

pyloobins-2.0.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

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

pyloobins-2.0.0-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

File details

Details for the file pyloobins-2.0.0.tar.gz.

File metadata

  • Download URL: pyloobins-2.0.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for pyloobins-2.0.0.tar.gz
Algorithm Hash digest
SHA256 03eae4ca199d16fe33ed53dc6619f9b6f4789d004342f9659715145cbaf5c6ce
MD5 55b1fb279afaf3b9c068bd6edd37d984
BLAKE2b-256 77762e0de3d93202a40b0963f82fe57af5ce69c7a0d110cee4bc34b7395da983

See more details on using hashes here.

File details

Details for the file pyloobins-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyloobins-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for pyloobins-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a974f88b8df263677c194e7fc1667db32e8471cc5af985c9142587a4bbb6cb4
MD5 c0e4a483a4e6b14ab557aebacf4c3540
BLAKE2b-256 3b8db437322a13bb951862dbd4b057e5e3fd00185854817e8a1e14b85670ca07

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 Sentry Error logging StatusPage Status page