Skip to main content

Maltorch: Pentesting Suite for AI-based Windows Malware Detectors

PyPI GitHub code size in bytes GitHub issues PyPI - Python Version PyPI - Downloads

Testing the security of AI-based Windows malware detectors has never been easier! You can deploy maltorch, boot up models already trained with PyTorch, and deploy an arsenal of testing techniques before placing an AV in production.

Installation

You can install maltorch through pip, but you also need a custom version of EMBER due to numpy portability issues.

pip install maltorch
pip install git+https://github.com/zangobot/ember.git

Included manipulations

Maltorch contains most of the practical manipulations of this field:

  • DOS header extension and editing (PartialDOS, FullDOS, Extend)
  • Content shifting
  • Section injection with optimized or goodware content (GAMMA)
  • Padding

Most of the manipulations can be used either with gradient-based and gradient-free optimization.

Loading AI-based Models

The library already provides tons of pre-trained models, you can instantiate one by just:

from maltorch.zoo.malconv import MalConv
model = MalConv.create_model()

and it also accepts device parameter to load the model in GPU.

Evasion Attacks

Straight-forward way to compute attacks! You just neet to load the model, instantiate the attack, and then pass the model to the freshly-created technique:

from torch.utils.data import TensorDataset, DataLoader
from maltorch.adv.evasion.partialdos import PartialDOS
from maltorch.data.loader import load_from_folder, create_labels
from maltorch.zoo.malconv import MalConv

model = MalConv.create_model()

# Load data as a Pytorch DataLoader
folder_with_exe = ...
X = load_from_folder(folder_with_exe, "exe",device=device)
y = create_labels(X, 1, device=device)
dl = DataLoader(TensorDataset(X, y), batch_size=3)

# Store adversarial EXEmples into a new DataLoader
attack = PartialDOS(query_budget=3)
adversarial_loader = attack(model, torch_data_loader)

Metadata

Release files for maltorch 0.3.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maltorch 0.3.6.1
File Size Uploaded Provenance Actions
maltorch-0.3.6.1.tar.gz 59.4 kB Without provenance Details for maltorch-0.3.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maltorch 0.3.6.1
File Interpreter ABI Platform Actions
maltorch-0.3.6.1-py3-none-any.whl Python 3 none any Details for maltorch-0.3.6.1-py3-none-any.whl

Total release size: 158.9 kB

Release files / maltorch-0.3.6.1.tar.gz

Download URL maltorch-0.3.6.1.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4c8ab589cabc8475e9e50a0bec7dfa06fe2171fa6dc6b02db6071848eae2f6bd
BLAKE2b-256 checksum
How to use checksums
bccc7f3692bcc43664a959c172aac85e4fdc4924c6a52bc0aaf0149c95f49587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / maltorch-0.3.6.1-py3-none-any.whl

Download URL maltorch-0.3.6.1-py3-none-any.whl
Size 99.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff8db89304cff665275704eff32d6962a9ccc7ae2d4f1515402bb144a54156a8
BLAKE2b-256 checksum
How to use checksums
b428bec37da6673d69368d0adf30e61e1d07d85733a59cf8715f6400b4dfefdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for maltorch 0.3.6.1

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