{"id":22563916,"url":"https://github.com/leeyangee/pyanonymous","last_synced_at":"2026-03-17T14:21:51.396Z","repository":{"id":239416013,"uuid":"779917277","full_name":"Leeyangee/PyAnonymous","owner":"Leeyangee","description":"PyAnonymous是一个应用于渗透测试场景下基于Python3的无落地内存马加载解决方案","archived":false,"fork":false,"pushed_at":"2024-05-16T07:56:00.000Z","size":488,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T10:21:19.582Z","etag":null,"topics":["cyber-security","cybersecurity","memory-trojan","penetration-testing","pentest","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Leeyangee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-31T06:26:14.000Z","updated_at":"2025-01-08T12:41:21.000Z","dependencies_parsed_at":"2024-05-12T09:48:02.527Z","dependency_job_id":null,"html_url":"https://github.com/Leeyangee/PyAnonymous","commit_stats":null,"previous_names":["leeyangee/pyanonymous"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leeyangee%2FPyAnonymous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leeyangee%2FPyAnonymous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leeyangee%2FPyAnonymous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leeyangee%2FPyAnonymous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Leeyangee","download_url":"https://codeload.github.com/Leeyangee/PyAnonymous/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248209124,"owners_count":21065288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cyber-security","cybersecurity","memory-trojan","penetration-testing","pentest","python","python3"],"created_at":"2024-12-07T23:13:30.356Z","updated_at":"2026-03-17T14:21:51.341Z","avatar_url":"https://github.com/Leeyangee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### [繁體中文](README_en.md)\n\n\u003cdiv align=\"center\"\u003e \u003cimg src=\"https://leeyabug-top-1309475701.cos-website.ap-nanjing.myqcloud.com/PyAnonymous/bugctf.png\" width = 135 height = 99 /\u003e\u003c/div\u003e\n\u003cp align=\"center\"\u003ePyAnonymous: 基于Python3的无落地项目加载解决方案\u003c/p\u003e\n\nPyAnonymous(Py匿名)是一个基于Python3的无落地内存马加载解决方案，它可以将一个完整的简单Py项目变为一行简单的Py表达式.  \n\n📕PyAnonymous的原理是：使用反射等手段将用户的Py项目注入到其他计算机的默认的官方库(如: math、socket)中，并在该官方库下预留项目入口，使得用户的Py项目在其他计算机的内存中持久化并方便调用\n\n👊PyAnonymous相比于其他项目的优点在于：  \n1. PyAnonymous将会自动处理简单的依赖，会将依赖和主文件一起打包至表达式中. \n2. PyAnonymous倡导全程无落地，在加载时无需任何文件落地.\n3. PyAnonymous为项目入口文件提供预留攻击者接口，将入口文件以模块的形式注入进默认math库中，方便攻击者调用\n\n在PyAnonymous生成表达式后，当攻击者发现目标Python应用的代码执行点，可以在目标服务代码执行点(如exec、eval)执行该行表达式，将会自动将该项目加载进目标内存并可通过预设的math手动调用\n\n\u003cdiv align=\"center\"\u003e \u003cimg src=\"https://leeyabug-top-1309475701.cos-website.ap-nanjing.myqcloud.com/PyAnonymous/pic1.png\" width = 350 /\u003e\u003c/div\u003e\n\n💡对于绝大部分项目，都可以一键将其转化为Payload. 对于全部应用(Web应用、框架)的代码执行处，都可以一键向内存中写入项目并运行\n\n\u003cdiv align=\"center\"\u003e \u003cimg src=\"https://leeyabug-top-1309475701.cos-website.ap-nanjing.myqcloud.com/PyAnonymous/pic2.png\" width = 350 /\u003e\u003c/div\u003e\n\n### [点这里查看如何将示例项目转换](使用例子/示例test.md)\n\n### [点这里查看如何将一个XMR挖矿项目转换](使用例子/XMR转换.md)\n\n\n🦙这是我自己的一个练手项目，希望师傅们多多包涵. 各位师傅可以提issue反馈问题\n\n由leeya_bug开发\n\n# 安装\n\n下载并进入PyAnonymous: \n```vb\ngit clone https://github.com/Leeyangee/PyAnonymous\ncd PyAnonymous\n```\n\n# 快速开始\n\n1. 以默认命名空间生成test项目的Payload\n\n    \n\n    ```vb\n    python main.py -e './测试项目/test/test_main.py'\n    ```\n\n    在其他计算机运行Payload后，项目入口文件 test_main.py 作为模块被注入至 math 模块中即: math.test_main，以下代码调用注入到内存的test项目入口中的函数\n\n    ```py\n    import math\n    math.test_main.main()\n    ```\n\n2. 以默认命名空间生成ReadableCryptoMiner项目的Payload\n\n    ```vb\n    python main.py -e './测试项目/ReadableCryptoMiner/ggminer.py'\n    ```\n\n    在其他计算机运行Payload后，项目入口文件 ggminer.py 作为模块被注入至 math 模块中即: math.ggminer，以下代码调用注入到内存的ReadableCryptoMiner项目入口中的函数\n\n    ```py\n    import math\n    math.ggminer.main()\n    ```\n\n在默认情况下，项目将会被加载至 math.\u003c入口文件名称\u003e中，您可以使用以下代码调用加载至内存中的项目\n```py\nimport math\nmath.\u003c入口文件名\u003e.\u003c文件中的函数\u003e()\n```\n\n\n\n### [点这里查看如何将示例项目转换](使用例子/示例test.md)\n\n\n# 注意事项\n\n1. ⚠在您的项目中引入模块时，如果您是手动引入模块(如下列代码所示)\n   ```py\n    __import__('test_mod').get()\n   ```\n   请在该文件前添加格式为#dep \u003c模块名\u003e 的注释使得PyAnonymous在打包时能将该依赖一同打包，如下所示\n   ```py\n    #dep test_mod\n\n    __import__('test_mod').get()\n   ```\n\n2. ❌当前版本暂时不支持相对路径引入(正在努力适配中)\n   ```py\n   from .display import dis #不支持相对路径导入，请更改为绝对路径导入\n   ```\n\n3. ⚠PyAnonymous生成的Payload跨平台\n   \n4. ⚠一般来说，在test项目中支持的导入方式，正式环境中都完美支持\n\n# 鸣谢\n\n在开发的过程中，少不了以下开源/开放代码的支持\n\n* 作为测试项目被引入: https://github.com/wkta/ReadableCryptoMiner\n\n* 作为测试项目被引入: https://github.com/kingkaki/weblogic-scan\n\n\u003cdiv align=\"center\"\u003e \u003cimg src=\"https://leeyabug-top-1309475701.cos-website.ap-nanjing.myqcloud.com/PyAnonymous/bugctf.png\" width = 135 height = 99 /\u003e\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleeyangee%2Fpyanonymous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleeyangee%2Fpyanonymous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleeyangee%2Fpyanonymous/lists"}