In staeless, can I use scapy to build dns packet

209 views
Skip to first unread message

xmyy...@gmail.com

unread,
Jun 21, 2017, 3:32:36 AM6/21/17
to TRex Traffic Generator
Hi trex,

I have got a question. I want to send dns query packet in stateless mode. I use scapy to build the packet like this,

pkt=Ether()/IP(src=srcip)/UDP()/DNS(aa=1,qd=DNSQR(qname="www.baidu.com"))

But the running result met an error:

pkt=Ether()/IP(src=srcip)/UDP()/DNS(aa=1,qd=DNSQR(qname="www.baidu.com"))
NameError: global name 'DNS' is not defined


Does that mean it not support scapy to build dns packet?
Is there any solution to fix it ?

Yaroslav Brustinov

unread,
Jun 21, 2017, 3:45:49 AM6/21/17
to xmyy...@gmail.com, TRex Traffic Generator
from scapy.layers.dns import *


--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+unsubscribe@googlegroups.com.
To post to this group, send email to trex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/32a0b252-7ffa-44bb-9030-9b365d3795f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hanoh haim

unread,
Jun 21, 2017, 3:50:19 AM6/21/17
to Yaroslav Brustinov, xmyy...@gmail.com, TRex Traffic Generator
Hi, 

to use contrib protocols e.g.  MPLS use the same 

from scapy.contrib.mpls import * 




For more options, visit https://groups.google.com/d/optout.



--
Hanoh
Sent from my iPhone

xmyy...@gmail.com

unread,
Jun 21, 2017, 4:46:04 AM6/21/17
to TRex Traffic Generator, xmyy...@gmail.com
It works! Thank you!

I have another question.
Can I use " from scapy.all import *" to import scapy all?
I tried,but it dosen't work.

在 2017年6月21日星期三 UTC+8下午3:45:49,y.brustinov写道:
> from scapy.layers.dns import *
>
>
>
> On Wed, Jun 21, 2017 at 10:32 AM, <xmyy...@gmail.com> wrote:
> Hi trex,
>
>
>
> I have got a question. I want to send dns query packet in stateless mode. I use scapy to build the packet like this,
>
>
>
> pkt=Ether()/IP(src=srcip)/UDP()/DNS(aa=1,qd=DNSQR(qname="www.baidu.com"))
>
>
>
> But the running result met an error:
>
>
>
> pkt=Ether()/IP(src=srcip)/UDP()/DNS(aa=1,qd=DNSQR(qname="www.baidu.com"))
>
> NameError: global name 'DNS' is not defined
>
>
>
>
>
> Does that mean it not support scapy to build dns packet?
>
> Is there any solution to fix it ?
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.

hanoh haim

unread,
Jun 21, 2017, 4:55:20 AM6/21/17
to TRex Traffic Generator, xmyy...@gmail.com
You can't in our Scapy port


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages