This is a Discovery and Mitigation Tool for the Miasma malware or Miasma worm which is distributed by TeamPCP also known as APT28/29.
Detailed Blogpost about the Miasma Malware:
https://cookie.engineer/weblog/articles/malware-insights-miasma-campaign.html
If you don't have go installed, ready-to-use downloads are available in the
Releases section
on GitHub.
This shows how to:
antimiasma discover ~/Software; # shows a list of infected repositories
antimiasma mitigate ~/Software; # removes the miasma worm in all infected repositories
A minimal Miasma implant sample is available at miasma-sample. That repository contains the spreading mechanisms and infiltrated files, but not the actual malware implant.
If you're unsure whether antimiasma works on your system, you can clone the miasma-sample repository safely
to test the antimiasma discover and antimiasma mitigate actions against it.
git clone https://github.com/cookiengineer/miasma-sample.git /tmp/miasma-sample;
# shows the /tmp/miasma-sample repository as infected
antimiasma discover /tmp;
# mitigates the infected repository
antimiasma mitigate /tmp;
Take a look at the utils/miasma folder for implementation details.
PS: If you have a malware sample of ongoing miasma campaigns that are not supported, PLEASE don't hesitate to file an issue and send me the malware sample so that I can debug/reverse engineer it and add support for removal. Thank you!
| Name | Type | Infected File | Description | Discover | Mitigate |
|---|---|---|---|---|---|
| Claude Code | IDE | .claude/settings.json | executes on Claude Code session start | [x] | [x] |
| Cursor | IDE | .cursor/rules/setup.mdc | executes on open of folder/repo in Cursor | [x] | [x] |
| Gemini | IDE | .gemini/settings.json | executes on Gemini session start | [x] | [x] |
| VSCode | IDE | .vscode/tasks.json | executes on open of folder/repo in VS Code | [x] | [x] |
| AUR | AUR Packages | PKGBUILD and *.install | executes on prepare, build, install, package | [x] | [2] |
| Composer | PHP Packages | composer.json | executes on composer run script | [x] | [x] |
| Go | Go Packages | go.mod | executes on go generate and go build | NEED SAMPLE | NEED SAMPLE |
| NPM | NPM Packages | package.json | executes on npx or npm run script | [x] | [x] |
| Pacman | Pacman Packages | install | executes on {pre,post}_{install,upgrade,remove} | [x] | [2] |
| PIP | PyPI Packages | *-setup.pth | executes on pip install of dependencies | [x] | [1] |
| Miasma Blight | Bun Implant | .github/setup.js | the Miasma "Blight" campaign worm implant | [x] | [x] |
| Miasma Hades | Bun Implant | _index.js | the Miasma "Hades" campaign worm implant | [x] | [x] |
| Miasma Atomic | eBPF Implant | src/hook/deps | the Miasma "Atomic Arch" campaign worm implant | [x] | [x] |
| Miasma HWGA | NPM Packages | setup.mjs, Math_Symbol.js, math_init.mjs | the Miasma "Here We Go Again" campaign worm implant | [x] | [x] |
[1] pip install commands use compressed whl files for distribution. The *-setup.pth cannot be detected.
Only after an infected package already ran the malware payload, the Miasma implant can be removed.
[2] needs manual mitigation of already installed packages that were discovered in /var/lib/pacman/local/*.
This Mitigation Tool has been prototyped with an abliterated qwen3-coder:30b@Q8 running
inside the exocomp Agentic Environment.
The Code has been carefully reviewed and verified by Cookie Engineer.
Please verify its correct behavior by running it against the Miasma Sample repository which contains safe-to-test samples that use the same mechanism but don't contain the actual malware dropper nor worm implant.
Miasma Blight Campaign:
Miasma Hades Campaign:
Miasma Atomic Campaign:
Miasma Here We Go Again Campaign:
AGPL-3.0
20 commits
Go
93.8%
JavaScript
5.1%
Shell
1.1%
This is a Discovery and Mitigation Tool for the Miasma malware or Miasma worm which is distributed by TeamPCP also known as APT28/29.
Detailed Blogpost about the Miasma Malware:
https://cookie.engineer/weblog/articles/malware-insights-miasma-campaign.html
If you don't have go installed, ready-to-use downloads are available in the
Releases section
on GitHub.
This shows how to:
antimiasma discover ~/Software; # shows a list of infected repositories
antimiasma mitigate ~/Software; # removes the miasma worm in all infected repositories
A minimal Miasma implant sample is available at miasma-sample. That repository contains the spreading mechanisms and infiltrated files, but not the actual malware implant.
If you're unsure whether antimiasma works on your system, you can clone the miasma-sample repository safely
to test the antimiasma discover and antimiasma mitigate actions against it.
git clone https://github.com/cookiengineer/miasma-sample.git /tmp/miasma-sample;
# shows the /tmp/miasma-sample repository as infected
antimiasma discover /tmp;
# mitigates the infected repository
antimiasma mitigate /tmp;
Take a look at the utils/miasma folder for implementation details.
PS: If you have a malware sample of ongoing miasma campaigns that are not supported, PLEASE don't hesitate to file an issue and send me the malware sample so that I can debug/reverse engineer it and add support for removal. Thank you!
| Name | Type | Infected File | Description | Discover | Mitigate |
|---|---|---|---|---|---|
| Claude Code | IDE | .claude/settings.json | executes on Claude Code session start | [x] | [x] |
| Cursor | IDE | .cursor/rules/setup.mdc | executes on open of folder/repo in Cursor | [x] | [x] |
| Gemini | IDE | .gemini/settings.json | executes on Gemini session start | [x] | [x] |
| VSCode | IDE | .vscode/tasks.json | executes on open of folder/repo in VS Code | [x] | [x] |
| AUR | AUR Packages | PKGBUILD and *.install | executes on prepare, build, install, package | [x] | [2] |
| Composer | PHP Packages | composer.json | executes on composer run script | [x] | [x] |
| Go | Go Packages | go.mod | executes on go generate and go build | NEED SAMPLE | NEED SAMPLE |
| NPM | NPM Packages | package.json | executes on npx or npm run script | [x] | [x] |
| Pacman | Pacman Packages | install | executes on {pre,post}_{install,upgrade,remove} | [x] | [2] |
| PIP | PyPI Packages | *-setup.pth | executes on pip install of dependencies | [x] | [1] |
| Miasma Blight | Bun Implant | .github/setup.js | the Miasma "Blight" campaign worm implant | [x] | [x] |
| Miasma Hades | Bun Implant | _index.js | the Miasma "Hades" campaign worm implant | [x] | [x] |
| Miasma Atomic | eBPF Implant | src/hook/deps | the Miasma "Atomic Arch" campaign worm implant | [x] | [x] |
| Miasma HWGA | NPM Packages | setup.mjs, Math_Symbol.js, math_init.mjs | the Miasma "Here We Go Again" campaign worm implant | [x] | [x] |
[1] pip install commands use compressed whl files for distribution. The *-setup.pth cannot be detected.
Only after an infected package already ran the malware payload, the Miasma implant can be removed.
[2] needs manual mitigation of already installed packages that were discovered in /var/lib/pacman/local/*.
This Mitigation Tool has been prototyped with an abliterated qwen3-coder:30b@Q8 running
inside the exocomp Agentic Environment.
The Code has been carefully reviewed and verified by Cookie Engineer.
Please verify its correct behavior by running it against the Miasma Sample repository which contains safe-to-test samples that use the same mechanism but don't contain the actual malware dropper nor worm implant.
Miasma Blight Campaign:
Miasma Hades Campaign:
Miasma Atomic Campaign:
Miasma Here We Go Again Campaign:
AGPL-3.0
20 commits
Go
93.8%
JavaScript
5.1%
Shell
1.1%