Last active
September 22, 2023 15:35
-
-
Save thepacketgeek/6919352 to your computer and use it in GitHub Desktop.
Scapy - Creating a TCP Christmas Tree Packet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
from random import randint | |
# Create the skeleton of our packet | |
template = IP(dst="172.16.20.10")/TCP() | |
# Start lighting up those bits! | |
template[TCP].flags = "UFP" | |
# Create a list with a large number of packets to send | |
# Each packet will have a random TCP dest port for attack obfuscation | |
xmas = [] | |
for pktNum in range(0,100): | |
xmas.extend(template) | |
xmas[pktNum][TCP].dport = randint(1,65535) | |
# Send the list of packets | |
send(xmas) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment