Skip to content

Instantly share code, notes, and snippets.

@evelinad
Forked from perone/gist:3837297
Created May 14, 2014 14:34
Show Gist options
  • Save evelinad/1d1ebfeea77c0bc0c1f3 to your computer and use it in GitHub Desktop.
Save evelinad/1d1ebfeea77c0bc0c1f3 to your computer and use it in GitHub Desktop.
$~ sudo scapy
>>> from datetime import datetime
>>> pkt = IP(dst="www.google.com", ttl=1) / ICMP()
>>> ans,unans = sr(pkt*3)
Begin emission:
.**Finished to send 3 packets.
*
Received 4 packets, got 3 answers, remaining 0 packets
>>> sent = datetime.fromtimestamp(ans[0][0].sent_time)
>>> received = datetime.fromtimestamp(ans[0][1].time)
>>> print (received-sent)
0:00:00.001820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment