Created
November 28, 2010 22:56
-
-
Save diogomonica/719373 to your computer and use it in GitHub Desktop.
Scapy Packet interarrival (http://blog.diogomonica.com/measuring-packet-inter-arrival-time-with-scap)
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
from scapy.all import * | |
capture = rdpcap(sys.argv[1]) | |
for packet in capture: | |
if packet.haslayer(UDP) and packet.haslayer(IP) and packet.haslayer(Raw): | |
if packet.getlayer(Raw).load == sys.argv[2]: | |
start = packet.time | |
if packet.getlayer(Raw).load == sys.argv[3]: | |
end = packet.time | |
print (end - start)*1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment