From 9eb925338111a40e0d8cb73c82576dcf075022fe Mon Sep 17 00:00:00 2001 From: Heretic <137451+Heretic312@users.noreply.github.com> Date: Fri, 30 May 2025 14:42:47 -0500 Subject: [PATCH] Add 16-byte-packet.py Scapy is required for use of script --- linux/16-byte-packet-v2.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 linux/16-byte-packet-v2.py diff --git a/linux/16-byte-packet-v2.py b/linux/16-byte-packet-v2.py new file mode 100644 index 0000000..c36eb29 --- /dev/null +++ b/linux/16-byte-packet-v2.py @@ -0,0 +1,25 @@ +# Send 16-byte packets using Scapy for manual network tests +# Author: Victor Bishop (Heretic) | https://github.com/Heretic312/devsecops-wrappers.git +# Date: 5/8/2025 + +from scapy.all import * + +# Get user input +target_ip = input("Enter target IP address: ") +target_port = int(input("Enter target port: ")) +tcp_flags = input("Enter TCP flags (e.g., S for SYN, R for RST, A for ACK, etc.): ") + +# Construct IP and TCP layers +ip = IP(dst=target_ip) +tcp = TCP(sport=RandShort(), dport=target_port, flags=tcp_flags, seq=1000) +payload = b"A" * 16 # 16-byte payload + +# Create and send packet +packet = ip / tcp / Raw(load=payload) +send(packet) + +# Optionally send an RST packet (only if user included 'S' in flags, as example) +if "S" in tcp_flags: + tcp_rst = TCP(sport=RandShort(), dport=target_port, flags="R", seq=1000) + rst_packet = ip / tcp_rst + send(rst_packet)