
POC firewall with rules designed to detect and block Spring4Shell vulnerability (CVE-2022-22965) exploit
This project is a proof-of-concept (POC) firewall server designed to detect and block attacks exploiting the CVE-2022-22965 vulnerability, commonly known as Spring4Shell. The server inspects incoming HTTP requests and blocks any that match known malicious patterns associated with this vulnerability.
The Firewall Server Handler is a simple Python-based HTTP server, built using the http.server library. It monitors incoming HTTP POST requests, looking for specific headers and payload patterns associated with the Spring4Shell vulnerability. If a request matches these patterns, it is blocked, and the server responds with a 403 Forbidden status.
Clone the Repository
git clone https://github.com/BlackBird63030/Block-Spring4Shell
cd Block-Spring4Shell
Run the Server
python frs.py
By default, the server will run on localhost at port 8000.
Test the Firewall Rule
This POC uses two main rules to detect and block CVE-2022-22965 exploit attempts:
Rule 1: Blocking Payload Pattern
Rule 2: Blocking Suspicious Headers
If either rule matches, the server responds with a 403 Forbidden status and returns a JSON message: {"error": "Forbidden Access"}
If no conditions are met, the server responds with 200 OK and: {"message": "Request received"}
To test the firewall, use the tnt.py script. It gonna send 5 POST requests to the firewall script
python tnt.py
The server will respond with: {"error": "Forbidden Access"}
This POC is intended for educational and testing purposes to demonstrate a basic firewall rule that blocks specific attack vectors targeting the Spring4Shell vulnerability. It is not a substitute for a comprehensive firewall solution in production environments.
MIT License