MalGuiser: Hard-Label Adversarial Attack Against Machine Learning-Based Malicious Package Detectors
A full-stack research platform with a Vue 3 web interface for managing detectors, generating adversarial samples, clustering analysis, functionality verification, and semantic repair of Python packages.
📋 Prerequisites
Python: Python 3.8+
Node.js: 18+ (for frontend)
Operating System: Linux or Windows
Software Dependencies:
pip (Python package manager)
npm (Node.js package manager)
Git (for cloning the repository)
Access to LLM APIs (OpenAI GPT-4, DeepSeek, etc.)
📊 Dataset
This project works with Python package datasets for malware detection research. Download malicious and benign packages from the following sources:
Note: Due to ethical and legal considerations, datasets are not included in this repository. Use publicly available malware research datasets or create your own in accordance with applicable laws.
🎯 Target Detector
MalGuiser supports testing against various malware detection systems, including ML-based detectors and real-world security tools.
Use this tool only on packages you own or have explicit permission to test
Do not upload malicious packages to public repositories
Follow responsible disclosure practices
Respect all applicable laws and regulations
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📧 Contact
For questions or support, please open an issue on GitHub.
Disclaimer: This tool is intended for research and educational purposes only. The authors do not condone or support the use of this software for malicious purposes. Users are responsible for complying with all applicable laws and regulations. Misuse of this software may result in criminal charges.
MalGuiser
MalGuiser: Hard-Label Adversarial Attack Against Machine Learning-Based Malicious Package Detectors
📋 Prerequisites
📊 Dataset
This project works with Python package datasets for malware detection research. Download malicious and benign packages from the following sources:
Malicious Packages
Benign Packages
Dataset Structure
Note: Due to ethical and legal considerations, datasets are not included in this repository. Use publicly available malware research datasets or create your own in accordance with applicable laws.
🎯 Target Detector
MalGuiser supports testing against various malware detection systems, including ML-based detectors and real-world security tools.
ML Detectors
Real-world Detectors
📁 Project Structure
🔧 Install
1. Clone the Repository
2. Create Virtual Environment & Install Dependencies
3. Install Frontend Dependencies
🚀 How to Run
Web Application (Recommended)
Launch both backend and frontend with one click on Windows:
Or start them manually:
Backend (terminal 1):
API docs available at: http://localhost:8000/docs
Frontend (terminal 2):
App available at: http://localhost:3000
Web App Modules
/dashboard/adversarial/cluster/repair/detector/samplesCLI Adversarial Attack (Standalone)
Run the attack engine directly without the web UI:
This uses a Multi-Armed Bandit (UCB1) algorithm to iteratively apply obfuscation techniques against detectors. Edit
main.pyto configure:base_dir— path to malicious packagesmax_attempts— query budget per packageStandalone Scripts
Embedding & Clustering:
Functionality Verification & Repair:
Adversarial Attack Methods
The engine supports 17 attack methods across 4 categories:
insert_dead_code,insert_spaces,inject_benign_files,code_splittingvariable_rename,string_splitting,base64_encoding,aes_encryption,homoglyph_substitution,binary_conversion,gzip_compression,pyc_compilationmodify_metadata,version_rollback,dependency_shufflinganti_debug,control_flow_flattening⚠️ Ethical Guidelines
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📧 Contact
For questions or support, please open an issue on GitHub.
Disclaimer: This tool is intended for research and educational purposes only. The authors do not condone or support the use of this software for malicious purposes. Users are responsible for complying with all applicable laws and regulations. Misuse of this software may result in criminal charges.