#coding=utf-8
import sys
import socket
from impacket import ImpactDecoder, ImpactPacket
def main():
if len(sys.argv) < 3:
print "Use: %s <src ip> <dst ip>" % sys.argv[0]
print "Use: %s <src ip> <dst ip> <cnt>" % sys.argv[0]
sys.exit(1)
elif len(sys.argv) == 3:
src = sys.argv[1]
dst = sys.argv[2]
cnt = 1
elif len(sys.argv) ==4:
src = sys.argv[1]
dst = sys.argv[2]
cnt = sys.argv[3]
else:
print "Input error!"
sys.exit(1)
#print src, dst
ip = ImpactPacket.IP()
ip.set_ip_src(src)
ip.set_ip_dst(dst)
# Create a new ICMP packet of type ECHO.
i
import sys
import socket
from impacket import ImpactDecoder, ImpactPacket
def main():
if len(sys.argv) < 3:
print "Use: %s <src ip> <dst ip>" % sys.argv[0]
print "Use: %s <src ip> <dst ip> <cnt>" % sys.argv[0]
sys.exit(1)
elif len(sys.argv) == 3:
src = sys.argv[1]
dst = sys.argv[2]
cnt = 1
elif len(sys.argv) ==4:
src = sys.argv[1]
dst = sys.argv[2]
cnt = sys.argv[3]
else:
print "Input error!"
sys.exit(1)
#print src, dst
ip = ImpactPacket.IP()
ip.set_ip_src(src)
ip.set_ip_dst(dst)
# Create a new ICMP packet of type ECHO.
i