سؤال

Is it possible to designate a packet to send with scapy and python, at the byte level?

For instance, instead of building out an 802.11 packet using functionality like scapy.Dot11Elt(), et cetera, before sending, you just scapy.send("\xaa\xbb\x00\x02")

If so, how is this done?

هل كانت مفيدة؟

المحلول

Use the Raw layer. You can specify the bytes directly.

from scapy.all import *


packet = IP(dst="127.0.0.1")/Raw("\xaa\xbb\x00\x02")
send(packet)

You can use Wireshark to verify that a packet was generated as expected.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top