{"id":"MAL-2026-10192","summary":"Malicious code in defi-tools (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (5a2562ad49633ee8c845db08a485394cb31c7de12d9f87eb3f8ef0ab61fb5128)\nOn first import, defi_tools/__init__.py decodes a base64-embedded ~486KB Linux ELF, writes it to ~/.config/.npm-cache/snapd-network, sets mode 0777, and installs a user crontab entry (0 */12 * * *) to re-execute it every 12 hours. The binary is disguised under a system-service-like name in a hidden.npm-cache directory that maps to no real npm or snapd path. The init code then recursively removes the package's own dist-info/egg-info and __pycache__ directories, erasing evidence while the dropped binary and cron entry persist.\n\n## Source: kam193 (965dc1bdb2af9e6f1c5965554eeb9a789ff0b4f8ef2c46e76f05774ac9f3535a)\nThe package embeds an executable stealing cryptocurrency wallets data. During import, code saves the executable under a name suggesting system utility and configures cron to run it periodically. The exfiltrated data is encrypted using embedded RSA code before uploading to file-sharing services or IPFS.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-07-py-base58\n\n\nReasons (based on the campaign):\n\n\n - crypto-related\n\n\n - exfiltration-crypto\n\n\n - persistence\n","modified":"2026-07-13T07:47:05.314867708Z","published":"2026-07-12T08:17:43Z","database_specific":{"malicious-packages-origins":[{"sha256":"965dc1bdb2af9e6f1c5965554eeb9a789ff0b4f8ef2c46e76f05774ac9f3535a","import_time":"2026-07-12T09:13:05.572641938Z","id":"pypi/2026-07-py-base58/defi-tools","modified_time":"2026-07-12T08:17:44.037269Z","versions":["0.8.0"],"source":"kam193"},{"versions":["0.8.0"],"source":"amazon-inspector","sha256":"5a2562ad49633ee8c845db08a485394cb31c7de12d9f87eb3f8ef0ab61fb5128","import_time":"2026-07-13T07:40:11.282295611Z","id":"IN-MAL-2026-009825","modified_time":"2026-07-13T06:36:27Z"}]},"references":[{"type":"EVIDENCE","url":"https://www.virustotal.com/gui/file/4dd018d84f2f9c35caed7a2c684cff2c1ea3af3a113cceb078a0788eefb93f66/detection"},{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/defi-tools"},{"type":"PACKAGE","url":"https://pypi.org/project/defi-tools/0.8.0/"}],"affected":[{"package":{"name":"defi-tools","ecosystem":"PyPI","purl":"pkg:pypi/defi-tools"},"versions":["0.8.0"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"package_integrity":[{"filename":"defi_tools-0.8.0-py3-none-any.whl","hashes":{"sha256":"0776a595a233dde88b0f87c5731b69a6cfcf991a3f7987004dd21f525d9e7a13","blake2b_256":"6d64198abcd357e5c241e0b7e4a267cf126057ef58a99df6abc8468c17646299","md5":"b08c6bb8a871b0114251906fe658ad96"}},{"filename":"defi_tools-0.8.0.tar.gz","hashes":{"sha256":"c4ed2ca13509dfffcfa4937755d52eb7ceb8306c8e116af20dbd1c155f5c5404","blake2b_256":"00796fe0af14af65342d0612a61777c8dc05716d467cbe2b9a6bffb2ada4543b","md5":"017f9d7736b67b856c05a1c9e4594101"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/defi-tools/MAL-2026-10192.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]}