Pytorch-based library for creating Adversarial EXEmples against Windows Malware detectors.
Project description
Maltorch: Pentesting Suite for AI-based Windows Malware Detectors
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)
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 maltorch-0.3.5.tar.gz.
File metadata
- Download URL: maltorch-0.3.5.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62fd2485e4938b99a0b5e6ae2f2e7fcb2b2f01ff83942248a38929697831135d
|
|
| MD5 |
c855a8eb57491ff85c396430b84c7e6d
|
|
| BLAKE2b-256 |
13e4fa04843a05088c0b143e6a343905abbac7c40bbc7cde8d2eb328a32c0754
|
File details
Details for the file maltorch-0.3.5-py3-none-any.whl.
File metadata
- Download URL: maltorch-0.3.5-py3-none-any.whl
- Upload date:
- Size: 98.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48772cbc038e051d1a6827f92af06139d53a70d6da836ec580b9842001464fde
|
|
| MD5 |
d3f6a8beeec302d5b37741412537a958
|
|
| BLAKE2b-256 |
e0d20f6d128ebe91b21c0c87a8c7ed2ec353e7c59e4d9b4f4d3a232172957086
|