You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
449 B

from scapy.all import *
etherDest= sys.argv[1]
iface= sys.argv[2]
ipDest= sys.argv[3]
ipSrc= sys.argv[4]
# send 10 IPv4 ICMP echo requests
sendp(Ether(dst=etherDest)/IP(dst=ipDest, src=ipSrc, ttl=(1,10))/ICMP(), iface=iface)
ipDest= sys.argv[5]
ipSrc= sys.argv[6]
# send 10 IPv6 ICMP echo requests
sendp(Ether(dst=etherDest)/IPv6(dst=ipDest, src=ipSrc, hlim=(1,10))/ICMPv6EchoRequest(), iface=iface)