{"id":33145471,"url":"https://github.com/pralab/secml_malware","last_synced_at":"2026-01-14T07:38:55.127Z","repository":{"id":37728761,"uuid":"229022735","full_name":"pralab/secml_malware","owner":"pralab","description":"Create adversarial attacks against machine learning Windows malware detectors","archived":false,"fork":false,"pushed_at":"2025-09-30T13:26:56.000Z","size":4876,"stargazers_count":241,"open_issues_count":13,"forks_count":55,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-11-22T21:06:04.483Z","etag":null,"topics":["adversarial-machine-learning","attack","infosec","machine-learning","python","security"],"latest_commit_sha":null,"homepage":"https://secml-malware.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pralab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-19T09:41:53.000Z","updated_at":"2025-11-19T11:20:51.000Z","dependencies_parsed_at":"2024-03-15T15:58:50.662Z","dependency_job_id":"d69d23d4-ed34-4ce3-92e1-4259214d2ff9","html_url":"https://github.com/pralab/secml_malware","commit_stats":{"total_commits":159,"total_committers":4,"mean_commits":39.75,"dds":"0.16981132075471694","last_synced_commit":"916dee00206632383391ffcc5223e4e58963aa79"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/pralab/secml_malware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pralab%2Fsecml_malware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pralab%2Fsecml_malware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pralab%2Fsecml_malware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pralab%2Fsecml_malware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pralab","download_url":"https://codeload.github.com/pralab/secml_malware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pralab%2Fsecml_malware/sbom","scorecard":{"id":743540,"data":{"date":"2025-08-11","repo":{"name":"github.com/pralab/secml_malware","commit":"0c3b929059ee6e2ca4859306d3ab1f6a5afaae34"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.4 not signed: https://api.github.com/repos/pralab/secml_malware/releases/189611121","Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/pralab/secml_malware/releases/165305033","Warn: release artifact v0.2.8 not signed: https://api.github.com/repos/pralab/secml_malware/releases/122609059","Warn: release artifact 0.2.7 not signed: https://api.github.com/repos/pralab/secml_malware/releases/65248363","Warn: release artifact 0.2.6 not signed: https://api.github.com/repos/pralab/secml_malware/releases/63033282","Warn: release artifact v0.4 does not have provenance: https://api.github.com/repos/pralab/secml_malware/releases/189611121","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/pralab/secml_malware/releases/165305033","Warn: release artifact v0.2.8 does not have provenance: https://api.github.com/repos/pralab/secml_malware/releases/122609059","Warn: release artifact 0.2.7 does not have provenance: https://api.github.com/repos/pralab/secml_malware/releases/65248363","Warn: release artifact 0.2.6 does not have provenance: https://api.github.com/repos/pralab/secml_malware/releases/63033282"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pralab/secml_malware/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/pralab/secml_malware/python-publish.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.9 to python:3.9@sha256:b93ed1cb6815be1d99908ab629d49680be28024c4183611ded45c425ecf7b907","Warn: pipCommand not pinned by hash: Dockerfile:5","Warn: pipCommand not pinned by hash: Dockerfile:6","Warn: pipCommand not pinned by hash: Dockerfile:7","Warn: pipCommand not pinned by hash: Dockerfile:8","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   6 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259","Warn: Project is vulnerable to: PYSEC-2021-324 / GHSA-22x7-vwh9-5w4g","Warn: Project is vulnerable to: PYSEC-2022-277 / GHSA-2p5h-hpj4-fxgg","Warn: Project is vulnerable to: GHSA-377p-g8gr-5wpg","Warn: Project is vulnerable to: PYSEC-2022-43138 / GHSA-38hf-c37x-32hv","Warn: Project is vulnerable to: PYSEC-2022-276 / GHSA-42vg-2q93-fj6j","Warn: Project is vulnerable to: PYSEC-2022-274 / GHSA-52xx-r3g2-p8jm","Warn: Project is vulnerable to: PYSEC-2022-43140 / GHSA-jvp9-phwp-p738","Warn: Project is vulnerable to: PYSEC-2022-43139 / GHSA-rm2x-hgr8-w343","Warn: Project is vulnerable to: PYSEC-2022-275 / GHSA-x2xx-jw5m-5j86","Warn: Project is vulnerable to: PYSEC-2022-43137","Warn: Project is vulnerable to: PYSEC-2024-231","Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T18:08:34.016Z","repository_id":37728761,"created_at":"2025-08-22T18:08:34.016Z","updated_at":"2025-08-22T18:08:34.016Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial-machine-learning","attack","infosec","machine-learning","python","security"],"created_at":"2025-11-15T13:00:33.471Z","updated_at":"2026-01-14T07:38:55.120Z","avatar_url":"https://github.com/pralab.png","language":"Python","readme":"# SecML Malware\n\n![PyPI](https://img.shields.io/pypi/v/secml_malware?style=flat-square)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/zangobot/secml_malware?style=flat-square)\n![GitHub issues](https://img.shields.io/github/issues/zangobot/secml_malware?style=flat-square)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/secml_malware?style=flat-square)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/secml_malware?style=flat-square)\n[![Documentation Status](https://readthedocs.org/projects/secml-malware/badge/?version=latest)](https://secml-malware.readthedocs.io/en/latest/?badge=latest)\n\nPython library for creating adversarial attacks against Windows Malware detectors.\nBuilt on top of [SecML](https://secml.gitlab.io), SecML Malware includes most of the attack proposed in the state of the art.\nWe include a [pre-trained MalConv](https://github.com/endgameinc/ember) model trained by EndGame, used for testing.\n\n# Included Attacks\n\n* **Partial DOS Header manipulation**, formulated by [Demetrio et al.](https://arxiv.org/abs/1901.03583)\n* **Padding attack**, formulated by [Kolosnjaji et al.](http://pralab.diee.unica.it/sites/default/files/kolosnjaji18-eusipco.pdf)\n* **GAMMA**, formulated by [Demetrio et al.](https://arxiv.org/abs/2003.13526)\n* **FGSM padding + slack** formulated by [Kreuk et al.](https://arxiv.org/abs/1802.04528) and [Suciu et al.](https://arxiv.org/abs/1810.08280)\n* **Content shifting and DOS header extension** formulated by [Demetrio et al.](https://arxiv.org/pdf/2008.07125.pdf)\n* **Header Fields** inspired by [Nisi et al.](https://www.s3.eurecom.fr/~darion/papers/raid2021.pdf)\n\n\n# Installation\n\nNavigate to the folder where you want to clone the project.\nI recommend creating a new environment (I use `conda`):\n```bash\nconda create -n secml_malware_env python=3.9\nconda activate secml_malware_env\npip install git+https://github.com/zangobot/ember.git\npip install secml-malware\n```\n\n[//]: # (You also need to install `pytorch`, [find instructions here]\u0026#40;https://pytorch.org/get-started/locally/\u0026#41;. )\n\n[//]: # (Also, you might neet to install *libmagic as well*. [Follow these instructions]\u0026#40;https://github.com/ahupp/python-magic#installation\u0026#41; to install properly libmagic.)\n\nIf you are an Apple Silicon user, please install *lightgbm* from conda:\n```bash\nconda install -c conda-forge lightgbm\n```\n\n## Optional - Nevergrad\nIf you want speed up blackbox attacks, you can install [Nevergrad](https://github.com/facebookresearch/nevergrad).\nSee the blackbox tutorial for more information on its usage.\n\n# How to use\nActivate your environment, and import the `secml_malware` package inside your script:\n```python\nimport secml_malware\nprint(secml_malware.__version__)\n```\nThe tests included in this project show how the library can be used for applying the manipulation to the input programs.\nThere is also an [example Jupyter notebook tutorial](https://github.com/zangobot/secml_malware/blob/master/attack_tutorial.ipynb) that shows how to build a apply a standard attack.\n\n# Docker\nThere is also a `Dockerfile` that can be used to start a container and test the library without messing with virtual environments!\n```bash\ndocker build --tag secml_malware:0.3.2 .\ndocker run --rm -it secml_malware:0.3.2 bash\n```\nThe container is also shipped with `ipython`, for a more interactive experience with this library.\n\n# Cite\n\nIf you use our library, please cite us!\n```bibtex\n@misc{demetrio2021secmlmalware,\n      title={secml-malware: A Python Library for Adversarial Robustness Evaluation of Windows Malware Classifiers}, \n      author={Luca Demetrio and Battista Biggio},\n      year={2021},\n      eprint={2104.12848},\n      archivePrefix={arXiv},\n      primaryClass={cs.CR}\n}\n```\n\nAlso, depending on the manipulations / formalization you are using, please cite our work:\n\n**Content shifting and DOS header extension  manipulations** or **RAMEn formalization**\n```bibtex\n@article{demetrio2021adversarial,\n    title={Adversarial EXEmples: A Survey and Experimental Evaluation of Practical Attacks on Machine Learning for Windows Malware Detection},\n    author={Luca Demetrio and Scott E. Coull and Battista Biggio and Giovanni Lagorio and Alessandro Armando and Fabio Roli},\n    journal={ACM Transactions on Privacy and Security},\n    year={2021},\n    publisher={ACM}\n}\n``` \n\n**GAMMA**\n```bibtex\n@article{demetrio2021functionality,\n  title={Functionality-preserving black-box optimization of adversarial windows malware},\n  author={Demetrio, Luca and Biggio, Battista and Lagorio, Giovanni and Roli, Fabio and Armando, Alessandro},\n  journal={IEEE Transactions on Information Forensics and Security},\n  year={2021},\n  publisher={IEEE}\n}\n\n```\n\n**Partial DOS manipulation**\n```bibtex\n@inproceedings{demetrio2019explaining,\n  title={Explaining Vulnerabilities of Deep Learning to Adversarial Malware Binaries},\n  author={Luca Demetrio and Battista Biggio and Giovanni Lagorio and Fabio Roli and Alessandro Alessandro},\n  booktitle={ITASEC19},\n  volume={2315},\n  year={2019}\n}\n\n```\n\n# Bug reports\nIf you encounter something strange, feel free to open an issue! I am working a lot, and bugs are present everywhere.\nLet me know, and I'll try to fix them as soon as possible.\n\n# Testing\nI provide a small test suite for the attacks I have developed inside the plugin.\nIf you want to run them, **ADD GOODWARE/MALWARE samples!**\nThere are two distinct folders: \n```\nsecml_malware/data/goodware_samples\nsecml_malware/data/malware_samples/test_folder\n```\nPlease, add samples to both folders (**if and only if** you want to run the internal tests).\n\n# Fundings\nThe maintainance of this project has been partially by the project “SAFER “Robust Models for Safe and Secure AI Systems” (PE0000013).\n\n\u003cimg src=\"https://github.com/pralab/secml_malware/blob/master/logo%20PNRR%20FAIR.png\" alt=\"EU\" width=\"300\"/\u003e\n","funding_links":[],"categories":[":wrench: Tools"],"sub_categories":["Before 2000"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpralab%2Fsecml_malware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpralab%2Fsecml_malware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpralab%2Fsecml_malware/lists"}