Python-based simulated firewall to detect and block Spring4Shell (CVE-2022-22965) exploit attempts. This project filters HTTP requests by identifying malicious payload patterns using a custom firewall_server.py and tests them with test_requests.py.# 🛡️ Spring4Shell Firewall Mitigation (Python Script)
This project simulates a firewall using Python's built-in `http.server` module to detect and block malicious requests exploiting the **Spring4Shell (CVE-2022-22965)** vulnerability.
## 🔍 About
Spring4Shell is a critical Remote Code Execution (RCE) vulnerability affecting Spring Core Framework. Attackers use malicious payloads to deploy web shells on servers. This repo demonstrates how to block these using a lightweight custom Python HTTP firewall.
## 🚀 Features
- Detects and blocks known Spring4Shell payloads
- Pattern matching against:
- Dangerous URL path: `/tomcatwar.jsp`
- Exploit parameters like `class.module.classLoader.resources.context.parent.pipeline`
- Encoded payloads: `%7Bc1%7D`, `%7Bc2%7D`
- Responds with `403 Forbidden` if malicious
[4.0K] /data/pocs/997c944663b83d3fe1ab30d8f1d3f99120034578
├── [1.5K] firewall_server.py
└── [ 834] README.md
0 directories, 2 files