📜  dns 请求 scapy - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:36.844000             🧑  作者: Mango

代码示例1
from scapy.all import DNS, DNSQR, IP, sr1, UDP

dns_req = IP(dst='8.8.8.8') / UDP(dport=53) / DNS(rd=1, qd=DNSQR(qname='www.thepacketgeek.com'))
answer = sr1(dns_req, verbose=0)