Advertisement
infodox

tcp_tracert_graphical.py

Nov 15th, 2011
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #TCP Traceroute with graphical output
  3. import sys
  4. from scapy import *
  5. conf.verb=0
  6.  
  7. if len(sys.argv) != 2:
  8.     print "Usage: ./tcp_tracert_graphical.py <target>"
  9.     print "Where <target> is a website"
  10.     sys.exit(1)
  11.  
  12. target=sys.argv[1]
  13.  
  14. res,unans = traceroute(["target"],dport=[80,443],maxttl=20,retry=-2)
  15. res.graph()                          # piped to ImageMagick's display program. Image below.
  16. res.graph(type="ps",target="| lp")   # piped to postscript printer
  17. res.graph(target="> /tmp/target_graph.svg") # saved to file
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement