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.1.18

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.1.18
File Size Uploaded
configextractor_py-1.1.18.tar.gz 25.4 kB Details

Built distribution (wheel)

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

Total release size: 53.2 kB

Release files / configextractor_py-1.1.18.tar.gz

Download URL configextractor_py-1.1.18.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f95ec1d34c5cf7c80baad6f0101bccc864d01ab3c062c1265aebca399dab08d3
BLAKE2b-256 checksum
How to use checksums
767a586ca2cb20702b2ec8345324d94b315d11b3c75ba7ad924f12d589e78a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

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

Download URL configextractor_py-1.1.18-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9f61e832a68eabed4136d89555030f52903f3c429860e30882f6aeeb36a44ca
BLAKE2b-256 checksum
How to use checksums
4e089b0685ccc8df85c1a84df021d7a072048d7857852f1a6766d9822ec63ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.1.18 This release

2 release files

1.1.17

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

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