Created
October 2, 2019 03:51
-
-
Save jecsanb/17d18684daa27f50d61a0449142f535f to your computer and use it in GitHub Desktop.
Program used to extract data from pcap file
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
#! /usr/bin/env python2.7 | |
# -#- coding: utf-8 -#- | |
# vim:fenc=utf-8 | |
# read.py | |
# Copyright (C) 2019 Jecsan Blanco <[email protected]> | |
# Distributed under terms of the MIT license. | |
from scapy.all import * | |
def main(): | |
packets = packets = rdpcap('Week5.pcap') | |
data = "" | |
for packet in packets: | |
query = str(packet[DNSQR].qname) | |
if 'fakedns' in query: | |
data += query.split('.')[0] | |
print(data) | |
return | |
# end main | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment