Malduck

4.4.1 · active · verified Thu Apr 16

Malduck is a Python utility library designed for malware researchers, offering a comprehensive suite of tools for malware analysis. It provides functionalities for cryptography, compression, memory model objects (for PE/ELF/raw files and IDA dumps), a modular extraction engine for configuration, fixed integer types, and string operations. Currently at version 4.4.1, the project is actively maintained with frequent updates addressing bugfixes and introducing new features.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic AES-CBC encryption and decryption using Malduck's built-in cryptography functions. This is a common task in malware analysis for handling encrypted configuration data.

from malduck import aes

key = b'\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10'
iv = b'\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20'
plaintext = b'This is a secret message.'

ciphertext = aes.cbc.encrypt(key, iv, plaintext)
decrypted_text = aes.cbc.decrypt(key, iv, ciphertext)

print(f"Original Plaintext: {plaintext}")
print(f"Ciphertext (hex): {ciphertext.hex()}")
print(f"Decrypted Text: {decrypted_text}")

view raw JSON →