scapy.layers.dns
DNS: Domain Name System.
- class scapy.layers.dns.DNS(*args, **kargs)
Bases:
scapy.packet.Packet
- aliastypes
- answers(other)
- compress()
Return the compressed DNS packet (using dns_compress()
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Q| OPCODE|A|T|R|R|Z|A|C| RCODE | QDCOUNT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ANCOUNT | NSCOUNT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ARCOUNT | QD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AN | NS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AR | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNS
DNS fields length
ShortField
(Cond)None
id
0
qr
BitField
(1 bit)0
opcode
BitEnumField
(4 bits)0
aa
BitField
(1 bit)0
tc
BitField
(1 bit)0
rd
BitField
(1 bit)1
ra
BitField
(1 bit)0
z
BitField
(1 bit)0
ad
BitField
(1 bit)0
cd
BitField
(1 bit)0
rcode
BitEnumField
(4 bits)0
qdcount
None
ancount
None
nscount
None
arcount
None
qd
None
an
None
ns
None
ar
None
- mysummary()
- post_build(pkt, pay)
- pre_dissect(s)
Check that a valid DNS over TCP message can be decoded
- class scapy.layers.dns.DNSQR(*args, **kargs)
Bases:
scapy.layers.dns.InheritOriginDNSStrPacket
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | QNAME | QTYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | QCLASS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSQR
DNSQR fields qname
b'www.example.com'
qtype
1
qclass
1
- show_indent = 0
- class scapy.layers.dns.DNSQRField(name, countfld, passon=1)
Bases:
scapy.layers.dns.DNSRRField
- decodeRR(name, s, p)
- class scapy.layers.dns.DNSRR(*args, **kargs)
Bases:
scapy.layers.dns.InheritOriginDNSStrPacket
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRR
DNSRR fields rrname
b'.'
type
1
rclass
1
ttl
0
rdlen
None
rdata
b''
- show_indent = 0
- class scapy.layers.dns.DNSRRCountField(name, default, rr)
Bases:
scapy.fields.ShortField
- i2h(pkt, x)
- i2m(pkt, x)
- rr
- class scapy.layers.dns.DNSRRDLV(*args, **kargs)
Bases:
scapy.layers.dns.DNSRRDS
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYTAG | ALGORITHM | DIGESTTYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DIGEST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRDLV
DNSRRDLV fields rrname
b'.'
type
43
rclass
1
ttl
0
rdlen
None
keytag
0
algorithm
5
digesttype
5
digest
b''
- class scapy.layers.dns.DNSRRDNSKEY(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FLAGS | PROTOCOL | ALGORITHM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PUBLICKEY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRDNSKEY
DNSRRDNSKEY fields rrname
b'.'
type
48
rclass
1
ttl
0
rdlen
None
flags
FlagsField
(16 bits)<Flag 256 (Z)>
protocol
3
algorithm
5
publickey
b''
- class scapy.layers.dns.DNSRRDS(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYTAG | ALGORITHM | DIGESTTYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DIGEST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRDS
DNSRRDS fields rrname
b'.'
type
43
rclass
1
ttl
0
rdlen
None
keytag
0
algorithm
5
digesttype
5
digest
b''
- class scapy.layers.dns.DNSRRField(name, countfld, passon=1)
Bases:
scapy.fields.StrField
- countfld
- decodeRR(name, s, p)
- getfield(pkt, s)
- holds_packets = 1
- i2m(pkt, x)
- passon
- class scapy.layers.dns.DNSRRMX(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PREFERENCE | EXCHANGE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRMX
DNSRRMX fields rrname
b'.'
type
6
rclass
1
ttl
0
rdlen
None
preference
0
exchange
b'.'
- class scapy.layers.dns.DNSRRNSEC(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTNAME | TYPEBITMAPS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRNSEC
DNSRRNSEC fields rrname
b'.'
type
47
rclass
1
ttl
0
rdlen
None
nextname
b'.'
typebitmaps
b''
- class scapy.layers.dns.DNSRRNSEC3(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HASHALG | FLAGS | ITERATIONS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SALTLENGTH | SALT | HASHLENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTHASHEDOWNERNAME | TYPEBITMAPS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRNSEC3
DNSRRNSEC3 fields rrname
b'.'
type
50
rclass
1
ttl
0
rdlen
None
hashalg
0
flags
BitEnumField
(8 bits)0
iterations
0
saltlength
0
salt
b''
hashlength
0
nexthashedownername
b''
typebitmaps
b''
- class scapy.layers.dns.DNSRRNSEC3PARAM(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HASHALG | FLAGS | ITERATIONS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SALTLENGTH | SALT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRNSEC3PARAM
DNSRRNSEC3PARAM fields rrname
b'.'
type
51
rclass
1
ttl
0
rdlen
None
hashalg
0
flags
0
iterations
0
saltlength
0
salt
b''
- class scapy.layers.dns.DNSRROPT(*args, **kargs)
Bases:
scapy.layers.dns.InheritOriginDNSStrPacket
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | EXTRCODE | VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Z | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRROPT
DNSRROPT fields rrname
b'.'
type
41
rclass
4096
extrcode
0
version
0
z
BitEnumField
(16 bits)32768
rdlen
None
rdata
[]
- class scapy.layers.dns.DNSRRRSIG(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPECOVERED | ALGORITHM | LABELS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ORIGINALTTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | EXPIRATION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | INCEPTION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYTAG | SIGNERSNAME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRRSIG
DNSRRRSIG fields rrname
b'.'
type
46
rclass
1
ttl
0
rdlen
None
typecovered
1
algorithm
5
labels
0
originalttl
0
expiration
0
inception
0
keytag
0
signersname
b'.'
signature
b''
- class scapy.layers.dns.DNSRRSOA(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MNAME | RNAME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SERIAL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | REFRESH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RETRY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | EXPIRE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MINIMUM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRSOA
DNSRRSOA fields rrname
b'.'
type
6
rclass
1
ttl
0
rdlen
None
mname
b'.'
rname
b'.'
serial
0
refresh
0
retry
0
expire
0
minimum
0
- class scapy.layers.dns.DNSRRSRV(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PRIORITY | WEIGHT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PORT | TARGET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRSRV
DNSRRSRV fields rrname
b'.'
type
33
rclass
1
ttl
0
rdlen
None
priority
0
weight
0
port
0
target
b'.'
- class scapy.layers.dns.DNSRRTSIG(*args, **kargs)
Bases:
scapy.layers.dns._DNSRRdummy
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RRNAME | TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RCLASS | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RDLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ALGO NAME | TIME SIGNED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FUDGE | MAC LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MAC DATA | ORIGINAL ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ERROR | OTHER LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OTHER DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSRRTSIG
DNSRRTSIG fields rrname
b'.'
type
250
rclass
1
ttl
0
rdlen
None
algo_name
b'hmac-sha1'
time_signed
b'\x00\x00\x00\x00\x00\x00'
fudge
0
mac_len
20
mac_data
b''
original_id
0
error
0
other_len
0
other_data
b''
- class scapy.layers.dns.DNSStrField(name, default, fld=None, length_from=None, max_length=None)
Bases:
scapy.fields.StrLenField
Special StrField that handles DNS encoding/decoding. It will also handle DNS decompression. (may be StrLenField if a length_from is passed),
- getfield(pkt, s)
- h2i(pkt, x)
- i2len(pkt, x)
- i2m(pkt, x)
- class scapy.layers.dns.DNSTextField(name, default, fld=None, length_from=None, max_length=None)
Bases:
scapy.fields.StrLenField
Special StrLenField that handles DNS TEXT data (16)
- any2i(pkt, x)
- i2len(pkt, x)
- i2m(pkt, s)
- islist = 1
- m2i(pkt, s)
- class scapy.layers.dns.DNS_am(**kargs)
Bases:
scapy.ansmachine.AnsweringMachine
- filter = 'udp port 53'
- function_name = 'dns_spoof'
- is_request(req)
- make_reply(req)
- parse_options(joker='192.168.1.1', match=None)
- scapy.layers.dns.DNSgetstr(*args, **kwargs)
Legacy function. Deprecated
- class scapy.layers.dns.EDNS0TLV(*args, **kargs)
Bases:
scapy.packet.Packet
- aliastypes
- extract_padding(p)
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OPTCODE | OPTLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OPTDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EDNS0TLV
EDNS0TLV fields optcode
0
optlen
None
optdata
b''
- class scapy.layers.dns.InheritOriginDNSStrPacket(*args, **kargs)
Bases:
scapy.packet.Packet
- aliastypes
- default_fields
- direction
- explicit
- fields
- fieldtype
- name
- original
- overload_fields
- overloaded_fields
- packetfields
- payload
- post_transforms
- raw_packet_cache
- raw_packet_cache_fields
- sent_time
- sniffed_on
- time
- underlayer
- wirelen
- scapy.layers.dns.RRlist2bitmap(lst)
Encode a list of integers representing Resource Records to a bitmap field used in the NSEC Resource Record.
- class scapy.layers.dns.RRlistField(name, default, fmt='H', remain=0)
Bases:
scapy.fields.StrField
- h2i(pkt, x)
- i2repr(pkt, x)
- class scapy.layers.dns.TimeSignedField(name, default)
Bases:
scapy.fields.StrFixedLenField
- h2i(pkt, seconds)
Convert the number of seconds since 1-Jan-70 UTC to the packed representation.
- i2h(pkt, packed_seconds)
Convert the internal representation to the number of seconds since 1-Jan-70 UTC.
- i2repr(pkt, packed_seconds)
Convert the internal representation to a nice one using the RFC format.
- scapy.layers.dns.bitmap2RRlist(bitmap)
Decode the ‘Type Bit Maps’ field of the NSEC Resource Record into an integer list.
- scapy.layers.dns.dns_compress(pkt)
This function compresses a DNS packet according to compression rules.
- scapy.layers.dns.dns_encode(x, check_built=False)
Encodes a bytes string into the DNS format
- Parameters
x – the string
check_built – detect already-built strings and ignore them
- Returns
the encoded bytes string
- scapy.layers.dns.dns_get_str(s, pointer=0, pkt=None, _fullpacket=False)
This function decompresses a string s, starting from the given pointer.
- Parameters
s – the string to decompress
pointer – first pointer on the string (default: 0)
pkt – (optional) an InheritOriginDNSStrPacket packet
- Returns
(decoded_string, end_index, left_string)
- scapy.layers.dns.dyndns_add(nameserver, name, rdata, type='A', ttl=10)
Send a DNS add message to a nameserver for “name” to have a new “rdata” dyndns_add(nameserver, name, rdata, type=”A”, ttl=10) -> result code (0=ok)
example: dyndns_add(“ns1.toto.com”, “dyn.toto.com”, “127.0.0.1”) RFC2136
- scapy.layers.dns.dyndns_del(nameserver, name, type='ALL', ttl=10)
Send a DNS delete message to a nameserver for “name” dyndns_del(nameserver, name, type=”ANY”, ttl=10) -> result code (0=ok)
example: dyndns_del(“ns1.toto.com”, “dyn.toto.com”) RFC2136
- scapy.layers.dns.isdnssecRR(obj)