How pralab/secml_malware works
SecML Malware is a Python library for evaluating Windows malware detectors through adversarial PE-file manipulation. The principal workflow is to provide a malware sample and detector, run a white-box gradient attack or black-box search, and inspect the resulting evasion sample and detector confidence. The architecture also includes detector adapters and model families, PE transformation utilities, integrated-gradients explainability, and executable visualization. Attack-family interactions are documented in the README; unsampled implementations are represented at their exact paths, with uncertain internal calls omitted.
Main entry points: whitebox White-box attacks · c_wrapper_phi.py Detector adapter · c_blackbox_problem.py Black-box attacks · c_end2end_evasion.py Evasion framework
Components 18
Adversarial attacks
- White-box attacks
secml_malware/attack/whitebox - Gradient attacks
secml_malware/attack/whitebox/c_fast_gradient_sign_evasion.py - Byte optimization
secml_malware/attack/whitebox/c_discretized_bytes_evasion.py - Black-box attacks
secml_malware/attack/blackbox/c_blackbox_problem.py - GAMMA search
secml_malware/attack/blackbox/c_gamma_evasion.py - Genetic optimizer
secml_malware/attack/blackbox/ga/c_base_genetic_engine.py - Detector adapter
secml_malware/attack/blackbox/c_wrapper_phi.py - Evasion framework
secml_malware/attack/whitebox/c_end2end_evasion.py
Detection models
- End-to-end classifier
secml_malware/models/c_classifier_end2end_malware.py - End-to-end model
secml_malware/models/basee2e.py - MalConv model
secml_malware/models/malconv.py - EMBER classifier
secml_malware/models/c_classifier_ember.py - SOREL classifier
secml_malware/models/c_classifier_sorel_net.py - Remote classifier
secml_malware/models/c_classifier_remote.py
Analysis tools
- Integrated gradients
secml_malware/xai/c_integrated_gradients.py - Executable visualization
secml_malware/visualization/exe.py
PE utilities
- PE transformations
secml_malware/utils/pe_operations.py
Other components
- Researcher
Connections 19
- Researcher → White-box attacks: runs attacks
README.md - Researcher → Black-box attacks: runs attacks
README.md - White-box attacks → Gradient attacks: includes
secml_malware/attack/whitebox/__init__.py - White-box attacks → Byte optimization: includes
secml_malware/attack/whitebox/__init__.py - White-box attacks → Evasion framework: uses framework
secml_malware/attack/whitebox/c_discretized_bytes_evasion.py - Gradient attacks → Evasion framework: extends
secml_malware/attack/whitebox/c_fast_gradient_sign_evasion.py - Byte optimization → Evasion framework: extends
secml_malware/attack/whitebox/c_discretized_bytes_evasion.py - Evasion framework → End-to-end classifier: uses classifier
secml_malware/attack/whitebox/c_end2end_evasion.py - Black-box attacks → Detector adapter: scores candidates
secml_malware/attack/blackbox/c_blackbox_problem.py - GAMMA search → Black-box attacks: specializes problem
secml_malware/attack/blackbox/c_gamma_evasion.py - Genetic optimizer → Black-box attacks: optimizes problem
secml_malware/attack/blackbox/ga/c_base_genetic_engine.py - Detector adapter → End-to-end classifier: wraps detector
secml_malware/attack/blackbox/c_wrapper_phi.py - Detector adapter → EMBER classifier: adapts
secml_malware/attack/blackbox/c_wrapper_phi.py - Detector adapter → SOREL classifier: adapts
secml_malware/attack/blackbox/c_wrapper_phi.py - End-to-end classifier → End-to-end model: wraps model
secml_malware/models/c_classifier_end2end_malware.py - MalConv model → End-to-end model: extends
secml_malware/models/malconv.py - Integrated gradients → End-to-end classifier: analyzes
secml_malware/xai/c_integrated_gradients.py - White-box attacks → PE transformations: supports PE edits
secml_malware/attack/whitebox/c_format_exploit_evasion.py - GAMMA search → PE transformations: manipulates PE