Reading Raw Bytes using Scapy?

  dns, networking, python, scapy

I have a project in which I am building a DNS Forwarder.

I am using a UDP Server socket to listen to the DNS requests on port 53 (client is using the dig command) and I have to forward the received raw DNS request to scapy for dissecting it. I know that scapy is used to forge/send/manipulate packets.

The raw request looks something like this –

b'xd6tx01x00x01x00x00x00x00x00x01x03wwwx08facebookx03comx00x00x01x00x01x00x00)x10x00x00x00x00x00x00x00'

Is there a method/function in scapy that is used to import the raw DNS requests to get the flags, what record is being asked?

Source: Python Questions

LEAVE A COMMENT