With Scapy, we can simply craft packets and send them. So, if we spoof the source address and send it, the network accepts and returns the response to the spoofed address. Now, we can create a script to ping a system with a spoofed IP.
IP spoofing
How to do it...
Here are the steps to create a script for sending ping requests with spoofed IP:
- Create an ip-spoof-ping.py file and open it in your editor.
- Then, we have to import the required modules:
from scapy.all import *
- Now declare the variables for the script:
iface = "en0" fake_ip = '192.168.1.3' destination_ip = '192.168.1.5'
- Create a function to send ICMP packets:
def ping(source, destination, iface): pkt = IP(src=source,dst...