Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jmtaylor90/9b4d4449a0ad12b7424b400a65935df9 to your computer and use it in GitHub Desktop.
Save jmtaylor90/9b4d4449a0ad12b7424b400a65935df9 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
from scapy.all import DNS, DNSQR, IP, sr1, UDP
dns_req = IP(dst='8.8.8.8')/TCP(dport=53)/DNS(opcode=8,rd=1, qd=DNSQR(qname='www.google.com'))
answer = sr1(dns_req, verbose=0)
print(answer[DNS].summary())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment