From 1db7abed3eec77e04d3cb2c9c0b7cc51e42daf63 Mon Sep 17 00:00:00 2001 From: Tristan Smith Date: Sun, 9 Jun 2024 16:21:45 -0400 Subject: [PATCH] derp --- packet.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packet.py b/packet.py index a6fed4f..e1e3d07 100644 --- a/packet.py +++ b/packet.py @@ -1,10 +1,15 @@ -from scapy.all import send, IP, UDP +from scapy.all import sendp, Ether, IP, UDP +# Define the parameters destination_ip = '255.255.255.255' source_ip = '192.168.1.121' +source_mac = '8c:16:45:68:54:80' +destination_mac = 'ff:ff:ff:ff:ff:ff' # Broadcast MAC address source_port = 14236 destination_port = 14235 -packet = IP(src=source_ip, dst=destination_ip) / UDP(sport=source_port, dport=destination_port) +# Construct the packet with Ethernet layer +packet = Ether(src=source_mac, dst=destination_mac) / IP(src=source_ip, dst=destination_ip) / UDP(sport=source_port, dport=destination_port) -send(packet) \ No newline at end of file +# Send the packet at layer 2 (Ethernet layer) +sendp(packet)