{"id":"MAL-2026-15862","summary":"Malicious code in py-2equests (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (9bd7b93cf88d0fbcca30c50d9c9de6e14134cd2890be5a7a785e9330e98a988c)\npy-2equests is a typosquat of the popular 'requests' package (substituting '2' for 'r'). On `import py_2equests`, the top-level module body iterates os.environ and collects all variables whose keys start with SECRET, API, TOKEN, or KEY, then opens a TCP socket to a host/port taken from the TS_HOST/TS_PORT environment variables (defaulting to 127.0.0.1:9999 but overridable to any remote destination) and sends the collected secrets over it. The same import path then spawns a python subprocess that connects back to the same TS_HOST:TS_PORT, sends the literal 'SHELL', and holds the socket open as a reverse-shell channel, described in an author comment as a 'reverse shell hook'. A code comment reads 'Exfiltrate env vars and open reverse shell on install' and the CLI prints 'py_2equests installed -- targeting requests', self-documenting the intent. Any process that imports the package leaks credential-shaped environment variables and grants remote shell access to whoever controls the configured destination.\n\n## Source: kam193 (e77ec1203f9d490621144227c797d33bf3271c674bcc248fbaf16aaeca9bd106)\nDuring import, the code exfiltrates potentially sensitive env variables. In all analyzed versions the exfiltration target was a localhost, suggesting it was just a test.\n\n\n---\n\nCategory: PROBABLY_PENTEST - Packages looking like typical pentest packages, but also anything that looks like testing, exploring pre-prepared kits, research & co, with clearly low-harm possibilities.\n\n\nCampaign: 2026-09-0requests\n\n\nReasons (based on the campaign):\n\n\n - exfiltration-env-variables\n\n\n - typosquatting\n","modified":"2026-09-04T01:00:06.003624807Z","published":"2026-09-03T17:01:50Z","database_specific":{"malicious-packages-origins":[{"sha256":"e77ec1203f9d490621144227c797d33bf3271c674bcc248fbaf16aaeca9bd106","source":"kam193","versions":["0.0.1"],"id":"pypi/2026-09-0requests/py-2equests","import_time":"2026-09-03T17:16:47.037286544Z","modified_time":"2026-09-03T17:01:50.51128Z"},{"import_time":"2026-09-04T00:45:54.318499958Z","modified_time":"2026-09-03T23:49:01Z","sha256":"9bd7b93cf88d0fbcca30c50d9c9de6e14134cd2890be5a7a785e9330e98a988c","source":"amazon-inspector","versions":["0.0.1"],"id":"IN-MAL-2026-019378"}]},"references":[{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/package/py-2equests"},{"type":"PACKAGE","url":"https://pypi.org/project/py-2equests/0.0.1/"}],"affected":[{"package":{"name":"py-2equests","ecosystem":"PyPI","purl":"pkg:pypi/py-2equests"},"versions":["0.0.1"],"database_specific":{"cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"package_integrity":[{"filename":"py_2equests-0.0.1-py3-none-any.whl","hashes":{"md5":"e75ed3e1f281ef7fa58dc6562f3bdb1b","sha256":"9fa4dd3ec0b6eb1ac11f51898d1363313a34371dabb5178a858675b6e859abf1","blake2b_256":"ae7abbbc0c3cafea1141b6f05493592ccc639da2e8068cdb6346c957e0659aaa"}},{"filename":"py_2equests-0.0.1.tar.gz","hashes":{"sha256":"5095d0802783fd0197c34885b2c4d0d197317cc636f9e5e8532ff4ceb17292ea","blake2b_256":"ed73029459271648afc30887b464f5775b5ac799c69521a02c7a3f33f20ddcf9","md5":"577abf03376ee927ce140afa1a2d5e0e"}}],"evidence_files":[{"path":"py_2equests/__init__.py","sha256":"b2a6588476f40845a2df173d57d436dc47c0dfd044bcffdc936be1b509cffd3d","tlsh":"00111ee2e859092d307a67428527503da3b3d2415b35680277b85e32af37ba8307a6b8"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/py-2equests/MAL-2026-15862.json"}}],"schema_version":"1.9.0","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":"ANALYST"}]}