Skip to content

Commit 0c378cf

Browse files
committed
created processarp.py
1 parent e1491e9 commit 0c378cf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

processarp.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from scapy.all import *
2+
3+
pcap_path = raw_input('Path of pcap file: ')
4+
file_path = raw_input('Enter target file name')
5+
6+
try:
7+
file = open(file_path,'w')
8+
pkts = rdpcap(pcap_path)
9+
for i in range(len(pkts)):
10+
if ARP in pkts[i]:
11+
file.write ('%d,%s,%s,%s,%s,%d,%s\n'%( a[i].time, a[i].hwsrc, a[i].psrc, a[i].hwdst, a[i].pdst, a[i].hwtype, a[i].op))
12+
except:
13+
print 'some error occured'

0 commit comments

Comments
 (0)