Advertisement
rfmonk

example_scapy_scan_ip.py

May 10th, 2014
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. Welcome to Scapy (2.2.0)
  2. >>> import logging
  3. >>> logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
  4. >>> from scapy.all import *
  5. >>>
  6. >>> dst_ip = "5.0.173.19"  # an IP attacking my router
  7. >>> src_port = RandShort()
  8. >>> dst_port = 80
  9. >>>
  10. >>> tcp_connect_scan_resp = sr1(IP(dst=dst_ip)/TCP(sport=src_port,dport=dst_port,flags="S"),timeout=10)
  11. Begin emission:
  12. ..Finished to send 1 packets.
  13. ..
  14. Received 4 packets, got 0 answers, remaining 1 packets
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement