Skip to main content

ConfigExtractor

Latest Stable Release License

Maintainer: @cccs-rs

Python Library for performing configuration extraction across multiple extraction frameworks (ie. Maco, MWCP, etc.). This tool is actively used in the Assemblyline project as a service.

The code found in this repository contains a command line interface that acts as a wrapper for popular malware configuration data decoders from:

Installation Guide

Running in a Container

docker container run \
  -v /path/to/parsers:/mnt/parsers \
  -v /path/to/samples:/mnt/samples \
  cccs/assemblyline-service-configextractor \
  "cx -p /mnt/parsers -s /mnt/samples"

Usage

Command-line

You can use configextractor or cx to make use of the CLI:

Usage: cx [OPTIONS] PARSERS_PATH SAMPLE_PATH

Options:
  --block_list TEXT  Comma-delimited list of parsers to ignore
  --help             Show this message and exit.

Python

from configextractor.main import ConfigExtractor
import logging

# Create a logger to track ongoings
logger = logging.getLogger()
logger.handlers = [logging.StreamHandler()]
logger.setLevel('DEBUG')

# Instantiate instance of class with path(s) to extractors
# Attaching a logger will allow some insight into what's going on if parser detection is the issue
cx = ConfigExtractor(["/path/to/extractors/"], logger=logger)

# List all parsers actively detected and loaded into instance
# cx.parsers.keys() lists all the relative module paths to the parsers
# The value of each key is an Extractor object containing details for running the extractor (ie. venv location, YARA rule, etc.)
print([cx.get_details(p)['name'] for p in cx.parsers.values()])

# Run all loaded parsers against sample
results = cx.run_parsers('/path/to/sample')

# Output raw results to stdout, each should be organized by the parsers that generated an output
print(results)

Adding a new Parser Framework

  1. Inherit from the base Framework class and implement class accordingly
  2. Add new framework to the ConfigExtractor class' FRAMEWORK_LIBRARY_MAPPING

Metadata

Release files for configextractor-py 1.2.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 configextractor-py 1.2.0
File Size Uploaded Provenance Actions
configextractor_py-1.2.0.tar.gz 25.6 kB Without provenance Details for configextractor_py-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for configextractor-py 1.2.0
File Interpreter ABI Platform Actions
configextractor_py-1.2.0-py3-none-any.whl Python 3 none any Details for configextractor_py-1.2.0-py3-none-any.whl

Total release size: 53.4 kB

Release files / configextractor_py-1.2.0.tar.gz

Download URL configextractor_py-1.2.0.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b12995dbba2da3d244e2f191c438c381d6c7f95da85735fbcc2af77826985e8e
BLAKE2b-256 checksum
How to use checksums
5c343b213701b18f3abf52e771e7986e4dd808e4ca7908f438a28c0eae7116dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / configextractor_py-1.2.0-py3-none-any.whl

Download URL configextractor_py-1.2.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30dd706fe7527009f950d30703221e9afccd8975b597362ad38f0c5408add88b
BLAKE2b-256 checksum
How to use checksums
7e701329a204c167310919a3e15495e6bf759034812f08522a5377f132cd2f7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for configextractor-py 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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