scapy.layers.dns
DNS: Domain Name System.
- class scapy.layers.dns.ClientSubnetv4(name: str, default: bytes, length_from: Callable[[Packet], int] | None = None, max_length: Any | None = None)[源代码]
基类:
StrLenField- af_default = b'\xc0'
- af_familly = 2
- af_length = 32
- class scapy.layers.dns.ClientSubnetv6(name: str, default: bytes, length_from: Callable[[Packet], int] | None = None, max_length: Any | None = None)[源代码]
-
- af_default = b' '
- af_familly = 10
- af_length = 128
- class scapy.layers.dns.DNS(_pkt, /, *, length=None, id=0, qr=0, opcode=0, aa=0, tc=0, rd=1, ra=0, z=0, ad=0, cd=0, rcode=0, qdcount=None, ancount=None, nscount=None, arcount=None, qd=[<DNSQR |>], an=[], ns=[], ar=[])[源代码]
-
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Q| OPCODE|A|T|R|R|Z|A|C| RCODE | QDCOUNT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ANCOUNT | NSCOUNT | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ARCOUNT | QD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AN | NS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AR | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. DNSDNS fields length
ShortField(Cond)Noneid
0qr
BitField(1 bit)0opcode
0aa
BitField(1 bit)0tc
BitField(1 bit)0rd
BitField(1 bit)1ra
BitField(1 bit)0z
BitField(1 bit)0ad
BitField(1 bit)0cd
BitField(1 bit)0rcode
0qdcount
Noneancount
Nonenscount
Nonearcount
Noneqd
_DNSPacketListField[<DNSQR |>]an
_DNSPacketListField[]ns
_DNSPacketListField[]ar
_DNSPacketListField[]
- class scapy.layers.dns.DNSCompressedPacket(_pkt, /)[源代码]
基类:
PacketClass to mark that a packet contains DNSStrField and supports compression
- aliastypes
- class scapy.layers.dns.DNSQR(_pkt, /, *, qname=b'www.example.com.', qtype=1, qclass=1)[源代码]
基类:
Packet- 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. DNSQRDNSQR fields qname
b'www.example.com.'qtype
1qclass
1
- show_indent = 0
- class scapy.layers.dns.DNSRR(_pkt, /, *, rrname=b'.', type=1, rclass=1, ttl=0, rdlen=None, rdata=None)[源代码]
基类:
Packet- 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. DNSRRDNSRR fields rrname
b'.'type
1rclass
1ttl
0rdlen
Nonerdata
MultipleTypeField(IPField, IP6Field, DNSStrField, DNSTextField, StrLenField)b''
- show_indent = 0
- class scapy.layers.dns.DNSRRDLV(_pkt, /, *, rrname=b'.', type=43, rclass=1, ttl=0, rdlen=None, keytag=0, algorithm=5, digesttype=5, digest=b'')[源代码]
基类:
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. DNSRRDLVDNSRRDLV fields rrname
b'.'type
43rclass
1ttl
0rdlen
Nonekeytag
0algorithm
5digesttype
5digest
b''
- class scapy.layers.dns.DNSRRDNSKEY(_pkt, /, *, rrname=b'.', type=48, rclass=1, ttl=0, rdlen=None, flags=<Flag 256 (Z)>, protocol=3, algorithm=5, publickey=b'')[源代码]
基类:
_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. DNSRRDNSKEYDNSRRDNSKEY fields rrname
b'.'type
48rclass
1ttl
0rdlen
Noneflags
<Flag 256 (Z)>protocol
3algorithm
5publickey
b''
- class scapy.layers.dns.DNSRRDS(_pkt, /, *, rrname=b'.', type=43, rclass=1, ttl=0, rdlen=None, keytag=0, algorithm=5, digesttype=5, digest=b'')[源代码]
基类:
_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. DNSRRDSDNSRRDS fields rrname
b'.'type
43rclass
1ttl
0rdlen
Nonekeytag
0algorithm
5digesttype
5digest
b''
- class scapy.layers.dns.DNSRRMX(_pkt, /, *, rrname=b'.', type=6, rclass=1, ttl=0, rdlen=None, preference=0, exchange=b'.')[源代码]
基类:
_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. DNSRRMXDNSRRMX fields rrname
b'.'type
6rclass
1ttl
0rdlen
Nonepreference
0exchange
b'.'
- class scapy.layers.dns.DNSRRNSEC(_pkt, /, *, rrname=b'.', type=47, rclass=1, ttl=0, rdlen=None, nextname=b'.', typebitmaps=b'')[源代码]
基类:
_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. DNSRRNSECDNSRRNSEC fields rrname
b'.'type
47rclass
1ttl
0rdlen
Nonenextname
b'.'typebitmaps
b''
- class scapy.layers.dns.DNSRRNSEC3(_pkt, /, *, rrname=b'.', type=50, rclass=1, ttl=0, rdlen=None, hashalg=0, flags=0, iterations=0, saltlength=0, salt=b'', hashlength=0, nexthashedownername=b'', typebitmaps=b'')[源代码]
基类:
_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. DNSRRNSEC3DNSRRNSEC3 fields rrname
b'.'type
50rclass
1ttl
0rdlen
Nonehashalg
0flags
0iterations
0saltlength
0salt
b''hashlength
0nexthashedownername
b''typebitmaps
b''
- class scapy.layers.dns.DNSRRNSEC3PARAM(_pkt, /, *, rrname=b'.', type=51, rclass=1, ttl=0, rdlen=None, hashalg=0, flags=0, iterations=0, saltlength=0, salt=b'')[源代码]
基类:
_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. DNSRRNSEC3PARAMDNSRRNSEC3PARAM fields rrname
b'.'type
51rclass
1ttl
0rdlen
Nonehashalg
0flags
0iterations
0saltlength
0salt
b''
- class scapy.layers.dns.DNSRROPT(_pkt, /, *, rrname=b'.', type=41, rclass=4096, extrcode=0, version=0, z=32768, rdlen=None, rdata=[])[源代码]
基类:
Packet- 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. DNSRROPTDNSRROPT fields rrname
b'.'type
41rclass
4096extrcode
0version
0z
32768rdlen
Nonerdata
[]
- class scapy.layers.dns.DNSRRRSIG(_pkt, /, *, 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'')[源代码]
基类:
_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. DNSRRRSIGDNSRRRSIG fields rrname
b'.'type
46rclass
1ttl
0rdlen
Nonetypecovered
1algorithm
5labels
0originalttl
0expiration
0inception
0keytag
0signersname
b'.'signature
b''
- class scapy.layers.dns.DNSRRSOA(_pkt, /, *, rrname=b'.', type=6, rclass=1, ttl=0, rdlen=None, mname=b'.', rname=b'.', serial=0, refresh=0, retry=0, expire=0, minimum=0)[源代码]
基类:
_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. DNSRRSOADNSRRSOA fields rrname
b'.'type
6rclass
1ttl
0rdlen
Nonemname
b'.'rname
b'.'serial
0refresh
0retry
0expire
0minimum
0
- class scapy.layers.dns.DNSRRSRV(_pkt, /, *, rrname=b'.', type=33, rclass=1, ttl=0, rdlen=None, priority=0, weight=0, port=0, target=b'.')[源代码]
基类:
_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. DNSRRSRVDNSRRSRV fields rrname
b'.'type
33rclass
1ttl
0rdlen
Nonepriority
0weight
0port
0target
b'.'
- class scapy.layers.dns.DNSRRTSIG(_pkt, /, *, rrname=b'.', type=250, rclass=1, ttl=0, rdlen=None, algo_name=b'hmac-sha1.', time_signed=0, fudge=0, mac_len=20, mac_data=b'', original_id=0, error=0, other_len=0, other_data=b'')[源代码]
基类:
_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. DNSRRTSIGDNSRRTSIG fields rrname
b'.'type
250rclass
1ttl
0rdlen
Nonealgo_name
b'hmac-sha1.'time_signed
0fudge
0mac_len
20mac_data
b''original_id
0error
0other_len
0other_data
b''
- class scapy.layers.dns.DNSStrField(name: str, default: bytes, length_from: Callable[[Packet], int] | None = None, max_length: Any | None = None)[源代码]
基类:
StrLenFieldSpecial StrField that handles DNS encoding/decoding. It will also handle DNS decompression. (may be StrLenField if a length_from is passed),
- class scapy.layers.dns.DNSTextField(name: str, default: bytes, length_from: Callable[[Packet], int] | None = None, max_length: Any | None = None)[源代码]
基类:
StrLenFieldSpecial StrLenField that handles DNS TEXT data (16)
- islist = 1
- class scapy.layers.dns.DNS_am(self, joker=None, match=None, srvmatch=None, joker6=False, from_ip=None, from_ip6=None, src_ip=None, src_ip6=None, ttl=10)[源代码]
-
- filter: str | None = 'udp port 53'
- function_name = 'dns_spoof'
- optam0: Dict[str, Any]
- optam1: Dict[str, Any]
- optam2: Dict[str, Any]
- optsend: Dict[str, Any]
- optsniff: Dict[str, Any]
- parse_options(joker=None, match=None, srvmatch=None, joker6=False, from_ip=None, from_ip6=None, src_ip=None, src_ip6=None, ttl=10)[源代码]
- 参数:
joker -- default IPv4 for unresolved domains. (Default: None) Set to False to disable, None to mirror the interface's IP.
joker6 -- default IPv6 for unresolved domains (Default: False) set to False to disable, None to mirror the interface's IPv6.
match -- a dictionary of {name: val} where name is a string representing a domain name (A, AAAA) and val is a tuple of 2 elements, each representing an IP or a list of IPs
srvmatch -- a dictionary of {name: (port, target)} used for SRV
from_ip -- an source IP to filter. Can contain a netmask
from_ip6 -- an source IPv6 to filter. Can contain a netmask
ttl -- the DNS time to live (in seconds)
src_ip --
src_ip6 --
示例
>>> dns_spoof(joker="192.168.0.2", iface="eth0") >>> dns_spoof(match={ ... "_ldap._tcp.dc._msdcs.DOMAIN.LOCAL.": (389, "srv1.domain.local") ... })
- class scapy.layers.dns.EDNS0ClientSubnet(_pkt, /, *, optcode=8, optlen=None, family=1, source_plen=None, scope_plen=0, address=None)[源代码]
基类:
Packet- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OPTCODE | OPTLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FAMILY | SOURCE PLEN | SCOPE PLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ADDRESS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EDNS0ClientSubnetEDNS0ClientSubnet fields optcode
8optlen
Nonefamily
1source_plen
Nonescope_plen
0address
MultipleTypeField(ClientSubnetv4, ClientSubnetv6, ClientSubnetv4)b'192.168.0.0'
- class scapy.layers.dns.EDNS0TLV(_pkt, /, *, optcode=0, optlen=None, optdata=b'')[源代码]
基类:
Packet- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OPTCODE | OPTLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OPTDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EDNS0TLVEDNS0TLV fields optcode
0optlen
Noneoptdata
b''
- 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: str, default: I | None, fmt: str = 'H', remain: int = 0)[源代码]
基类:
StrField
- class scapy.layers.dns.TimeSignedField(name, default)[源代码]
基类:
Field[int,bytes]- i2m(pkt, seconds)[源代码]
Convert the number of seconds since 1-Jan-70 UTC to the packed representation.
- 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
- 参数:
x -- the string
check_built -- detect already-built strings and ignore them
- 返回:
the encoded bytes string
- scapy.layers.dns.dns_get_str(s, full=None, _ignore_compression=False)[源代码]
This function decompresses a string s, starting from the given pointer.
- 参数:
s -- the string to decompress
full -- (optional) the full packet (used for decompression)
- 返回:
(decoded_string, end_index, left_string)
- scapy.layers.dns.dns_resolve(qname, qtype='A', raw=False, verbose=1, **kwargs)[源代码]
Perform a simple DNS resolution using conf.nameservers with caching
- 参数:
qname -- the name to query
qtype -- the type to query (default A)
raw -- return the whole DNS packet (default False)