A library for extracting malware configurations across multiple frameworks
Project description
ConfigExtractor
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:
- Maco [MIT license]
- MWCP [MIT license]
- CAPE Sandbox [GPL license] via CAPE-parsers fork [MIT License]
- many thanks to @kevoreilly and the CAPESandbox community for releasing so many open source parsers.
MWCFG : https://github.com/c3rb3ru5d3d53c/mwcfg [BSD 3-Clause License]
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
- Inherit from the base
Frameworkclass and implement class accordingly - Add new framework to the ConfigExtractor class'
FRAMEWORK_LIBRARY_MAPPING
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file configextractor_py-1.1.14.tar.gz.
File metadata
- Download URL: configextractor_py-1.1.14.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3acf4b16650ea71ac4242ee82c32180a21eb1e09417a134aac8bb8e67bfbb064
|
|
| MD5 |
fc6e336d06b5fd54e8eca7211334ad4a
|
|
| BLAKE2b-256 |
e60029c691e3524f1d088087a9fcd37694b0d609548013222d3508c6eb2e885f
|
File details
Details for the file configextractor_py-1.1.14-py3-none-any.whl.
File metadata
- Download URL: configextractor_py-1.1.14-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9422493d174dd362346350ee78869baef8b7374c45d0420e4df53e200a1061f
|
|
| MD5 |
5a26e4fd35ae7ebc7e77873fe00c0ebe
|
|
| BLAKE2b-256 |
1335111b8d3040080ec45370fecee6865f10096de72e4b8cf5816eae46573274
|