Created
July 23, 2015 02:05
-
-
Save kbandla/1f842398c1a329eb3c50 to your computer and use it in GitHub Desktop.
( 32c3b3810d26dfeb83bf4d6eb3271f4b )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dpkt | |
f = open('dns.pcap') | |
pcap = dpkt.pcap.Reader(f) | |
for ts, buf in pcap: | |
eth = dpkt.ethernet.Ethernet(buf) | |
ip = eth.data | |
udp = ip.data | |
dns = dpkt.dns.DNS(udp.data) | |
print (dns.qd) | |
for x in dns.qd: | |
print (x.name) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment