Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE_2022_22947漏报 #18

Open
zy696 opened this issue Mar 5, 2024 · 1 comment
Open

CVE_2022_22947漏报 #18

zy696 opened this issue Mar 5, 2024 · 1 comment

Comments

@zy696
Copy link

zy696 commented Mar 5, 2024

师傅的漏洞检测逻辑是访问注册的hacktest路由,读取id命令的回显,但是这个只使用于linux系统,看师傅内置了payload2用于执行whoami,但是并没有针对windows漏洞检测逻辑,如果Spring Cloud Gateway部署在windows上,漏洞会误报。
而且师傅的逻辑是只要读取到id的回显时,才会删除注册的hacktest路由
if ('uid=' in str(re3.text)) and ('gid=' in str(re3.text)) and ('groups=' in str(re3.text)):
cprint(f'[+] [CVE-2022-22947] {url}', "red")
f2 = open("vulout.txt", "a")
f2.write("[+] [CVE-2022-22947] " + url + '\n')
f2.close()
re4 = requests.delete(url=url + "actuator/gateway/routes/hacktest", headers=headers2, timeout=10 ,verify=False, proxies=proxies)
re5 = requests.post(url=url + "actuator/gateway/refresh", headers=headers2, timeout=10 ,verify=False, proxies=proxies)
但是如果是windows平台,由于执行的是id命令,java.lang.ProcessBuilder.start会抛出异常,也就走不到删除路由的逻辑了,导致注册的路由持久性的留着了服务器上面,渗透结束后,需要手工清除,可以调整一下逻辑。官方补丁中是用SimpleEvaluationContext 替换 StandardEvaluationContext,限制了SPEL表达式的执行,并没有限制路由注册。

还有一个问题就是,SPEL表达式执行发生在/refresh刷新路由缓存逻辑的时候,后续所有正常的/refresh操作也会抛出异常,影响服务器正常功能以及其它扫描器对CVE_2022_22947漏洞的探测

@AabyssZG
Copy link
Owner

AabyssZG commented Mar 6, 2024

已经收到师傅的反馈,感谢师傅的建议🤩
对于漏洞利用和Poc扫描模块,已经收到了诸多反馈,目前相关代码还需完善,已经放入下一个版本更新计划了,同时也欢迎师傅提交PR😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants