> For the complete documentation index, see [llms.txt](https://thmflags.gitbook.io/thm-walkthroughs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thmflags.gitbook.io/thm-walkthroughs/difficulty-info/cve-walkthroughs/spring4shell-cve-2022-22965.md).

# Spring4Shell: CVE-2022-22965

{% embed url="<https://tryhackme.com/room/spring4shell>" %}
<https://tryhackme.com/room/spring4shell>
{% endembed %}

| Room Attributes       | Value                                                                  |
| --------------------- | ---------------------------------------------------------------------- |
| Subscription Required | <mark style="color:green;background-color:green;">False</mark> \[Free] |
| Type                  | Walkthrough                                                            |
| Difficulty            | <mark style="color:blue;background-color:blue;">Info</mark>            |
| Tags                  | Spring4Shell, Vulnerability, RCE, Java, CVE-2022-22965                 |

## Task 1 - <mark style="color:green;background-color:green;">Info</mark> Introduction and Deploy

### Deploy the target machine by clicking the green button at the top of this task!

{% hint style="info" %}
**Note:** This machine will take 2-3 minutes to start up completely!
{% endhint %}

{% hint style="success" %}
No answer needed
{% endhint %}

## Task 2 - <mark style="color:purple;background-color:purple;">Tutorial</mark> Vulnerability Background

### Read the task information and understand how Spring4Shell works at a high level.

{% hint style="success" %}
No answer needed
{% endhint %}

## Task 3 - <mark style="color:orange;background-color:orange;">Practical</mark> **Exploitation**

### Follow the steps in the task to exploit Spring4Shell and obtain a webshell.

{% hint style="success" %}
No answer needed
{% endhint %}

### **\[**<mark style="color:purple;">**Bonus Question: Optional**</mark>**]** Use your webshell to obtain a reverse/bind shell on the target.

{% hint style="success" %}
No answer needed
{% endhint %}

### What is the flag in `/root/flag.txt`?

<details>

<summary>Reveal Flag <span data-gb-custom-inline data-tag="emoji" data-code="1f6a9">🚩</span></summary>

:triangular\_flag\_on\_post:`THM{NjAyNzkyMjU0MzA1ZWMwZDdiM2E5YzFm}`

</details>

## Task 4 - <mark style="color:green;background-color:green;">Info</mark> Conclusion

### I understand and can abuse Spring4Shell!

{% hint style="success" %}
No answer needed
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thmflags.gitbook.io/thm-walkthroughs/difficulty-info/cve-walkthroughs/spring4shell-cve-2022-22965.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
