Skip to main content

Python client for MalwareDB

Project description

Malware DB Python Client

TestLintReleaseDocumentationCrates.io Version

This is a Python module for interacting with an instance of Malware DB.

Installation

Assuming you already have Malware DB checked out:

  1. python3 -m venv mdb-venv
  2. source mdb-venv/bin/activate
  3. pip install maturin
  4. cd client-py
  5. maturin develop (or maturin build to create a distributable wheel)

Features

If using this crate with another library, be sure to use the rust_lib feature flag to avoid creating the Malware DB client module type. This could be useful for reusing the functions defined in this crate with another Python module.

Use

  1. Import the module: from malwaredb import MalwareDBClient
  2. Create a client object from one of three ways:
    • MalwareDBClient.from_file() to use a configuration file
    • MalwareDBClient() to have the client library find a configuration file
    • MalwareDBClient.connect(url, api_key, [cert_path]) to provide the URL, API key, and optional path for a certificate for encrypted communication
    • MalwareDBClient.login(url, username, password, save, [cert_path]) to provide the URL, username, password, whether to save the configuration, and optional path for a certificate for encrypted communication
    • MalwareDBCLient.discover() to find local servers via multicast DNS
  3. Client functionality:
    • .get_file_bytes() get a file from Malware DB
    • .server_info() get server information
    • .submit_file() submit a file to Malware DB
    • .get_supported_file_types() get a list of file types supported by the Malware DB server
    • .search() search for files based on some criteria. Some optional keyword arguments, a minimum of one criterion is required:
      • hash=: specify a partial hash
      • hash_type=: specify the type of the partial hash, options are md5, sha1, sha256, or sha512, default is sha256
      • file_name=: specify all or part of a file name
      • labels=: specify a list of labels
      • file_type=: specify a file type, which must match a file type from .get_supported_file_types()
      • magic=: specify all or part of the file command (libmagic) output for a given file
      • response_hash=: specify the hash type to be returned, options are md5, sha1, sha256, or sha512, default is sha256
      • limit=: integer specifying the maximum results to be returned, must be greater than zero
    • .labels() get available labels for samples
    • .whoami() get information about the user's account
    • .yara_search() search for files using Yara, if the server supports it
    • .yara_result() get results of Yara search using UUID
  4. CaRT functionality:
    • malwaredb.cart.create_cart() encodes bytes into a CaRT bytes
    • malwaredb.cart.decode_cart() decodes CaRT bytes back into the original binary long with header and footer data. See client-py/py_test/cart.py.
    • Current limitations:
      • create_cart() doesn't allow setting custom fields.
      • decode_cart() will not be able to return fields which aren't plain float, integer, or string types.
    • See cart as an alternative CaRT module which is probably more feature-rich.

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 Distributions

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

malwaredb-0.3.3-cp37-abi3-manylinux_2_31_riscv64.whl (2.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.31+ riscv64

malwaredb-0.3.3-cp37-abi3-manylinux_2_28_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ x86-64

malwaredb-0.3.3-cp37-abi3-manylinux_2_28_ppc64le.whl (3.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ppc64le

malwaredb-0.3.3-cp37-abi3-manylinux_2_28_i686.whl (2.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ i686

malwaredb-0.3.3-cp37-abi3-manylinux_2_28_armv7l.whl (2.6 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARMv7l

malwaredb-0.3.3-cp37-abi3-manylinux_2_28_aarch64.whl (2.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ ARM64

malwaredb-0.3.3-cp37-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

malwaredb-0.3.3-cp37-abi3-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_31_riscv64.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_31_riscv64.whl
Algorithm Hash digest
SHA256 5c5d540a3ceff927a8a3ea8b94bed9085b63198a712968ca038d96890fe4b6b0
MD5 a338d6599be5c6ede733b7bc1777b5a0
BLAKE2b-256 b1fd2860ecfce92182f9aa9008f71a3487513f766581001e55a7d5ec63f81bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_31_riscv64.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0fbca92529bd8ccf0392c042c9b02f582e38cd31ec0a0b9c4892349fdb13ebf5
MD5 1fd0cea1a1d77d18d69e4e151549bc50
BLAKE2b-256 bd0d3978ba67f99d2bf4a81d5070ca213b573a67b55805e325d00d90a8e6febf

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 d60d3efd3f9a7501764abfbb87f1fc611ead6919a9b1bf788082d3aa57785bd0
MD5 8f358a7e2066e6538cae6e825b6e73f2
BLAKE2b-256 7d455c8084734a44f2ebe7201ded2f346650957ce16f11e481c68e6eca642c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_ppc64le.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 041a484206c267821b19622259f6de6676c6e6897b26cf4a7dea3b27f306c765
MD5 193091798c06e826a438559641dcccad
BLAKE2b-256 930b2e09c2b5451ef5a08942e1a02077483032c216ed94bee1cc11204be0990e

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_i686.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 dec34c76813aea3ce97b7cd20bfe873744b81209f2d101ffb9972dacc2f042f7
MD5 0d5246fabaa1fd878b216c3a71d53119
BLAKE2b-256 a316eb5ac90e973adb1d7ad9fdcb1bf20b5cf9197bc6a63eeaa2ad2d58b174b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_armv7l.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d0cacfbe516a0218469d4e6de36019b435caf638c67d48d209630cd2ac380d50
MD5 1ea91ec19de1a44992c33d346e074308
BLAKE2b-256 10f1f131bb1585267008791a4a40f72288c03020007aae88c9ed2a235e01a65e

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8de6284ac0e6742f3f17d98f734b8cc640ee0a99fcb1ea868899d461b4908482
MD5 143fd0b4f9c28bc949663f46dec223be
BLAKE2b-256 e48643d0c3eff3c495801a00d8afe6773e4f99daed1a9d8d125d20e6e7b7fae4

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwaredb-0.3.3-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for malwaredb-0.3.3-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af27c25a55ed4e1b4f59cc256eb8767817ea7e27af7df715281d2d4cb62d4fb9
MD5 c7bd209bcaa9c665303f292ec22a852f
BLAKE2b-256 50a5aa2f7812116a4f17bd06e5bbe837490894067f9313d27886bcc53bc44a89

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwaredb-0.3.3-cp37-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on malwaredb/malwaredb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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