Update packet.py

typo
This commit is contained in:
Tristan 2024-06-09 16:22:42 -04:00 committed by GitHub
parent 1db7abed3e
commit ab37c20ba5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,5 @@
from scapy.all import sendp, Ether, IP, UDP from scapy.all import sendp, Ether, IP, UDP
# Define the parameters
destination_ip = '255.255.255.255' destination_ip = '255.255.255.255'
source_ip = '192.168.1.121' source_ip = '192.168.1.121'
source_mac = '8c:16:45:68:54:80' source_mac = '8c:16:45:68:54:80'
@ -8,8 +7,6 @@ destination_mac = 'ff:ff:ff:ff:ff:ff' # Broadcast MAC address
source_port = 14236 source_port = 14236
destination_port = 14235 destination_port = 14235
# 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) packet = Ether(src=source_mac, dst=destination_mac) / IP(src=source_ip, dst=destination_ip) / UDP(sport=source_port, dport=destination_port)
# Send the packet at layer 2 (Ethernet layer)
sendp(packet) sendp(packet)