Created
September 8, 2014 20:39
-
-
Save BobuSumisu/721fc7d072e546c204ea to your computer and use it in GitHub Desktop.
This file contains 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 logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import * | |
ip_dst = "192.168.1.1" | |
if __name__ == "__main__": | |
if len(sys.argv) != 3: | |
print("Usage: domains2pcap.py DOMAIN-FILE PCAP-FILE") | |
exit() | |
domains = [d.strip() for d in open(sys.argv[1])] | |
packets = [] | |
for domain in domains: | |
packets.append(IP(dst=ip_dst)/UDP()/DNS(rd=1, qd=DNSQR(qname=domain))) | |
wrpcap(sys.argv[2], packets) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment