-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpcapviz.py
More file actions
35 lines (27 loc) · 987 Bytes
/
pcapviz.py
File metadata and controls
35 lines (27 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python
'''
Leverage scapy to visualize pcaps.
Inspired by Sean T
Written by Blevene
'''
from scapy.all import *
import argparse
parser = argparse.ArgumentParser(description="Visualize a .pcap file using scapy and afterglow.")
parser.add_argument("-c", "--conversations", help="Use this to view a conversations summary.",
action="store_true")
parser.add_argument("-a", "--afterglow", help="Use this to view a complete viz.",
action="store_true")
args = parser.parse_args()
if not len(sys.argv) > 1:
print "Please use one of: -a, -c, or -h as an argument."
else:
infile = raw_input('Please type an absolute path to the .pcap file: ')
p=rdpcap(infile)
print "Reading %s now." % infile
if args.conversations:
p.conversations()
#[Documentation] https://github.com/d1b/scapy/blob/master/scapy/plist.py#L239
elif args.afterglow:
p.afterglow()
#[Documentation] https://github.com/d1b/scapy/blob/master/scapy/plist.py#L264
print "Enjoy your visualization!"