I’m building an arp spoofer in Python with scapy and I have this function to send spoofed arp packets:
def arp_spoof (dest_ip, dest_mac, source_ip):
scapy.sendp(scapy.Ether(dst=dest_mac)/ scapy.ARP(op="is-at", psrc=source_ip, hwdst=dest_mac, pdst=dest_ip)/scapy.Padding(load="X"*18), verbose=False)
And it works perfectly.
I’m using the sendp() method, that sends packet at layer two, so in the Ether section I added the destination mac address and then in the ARP section I added all the details to perform an ARP attack.
Then I found on the Internet that adding the Padding is a good practice while working with Network packets.
But I don’t understand well what does it mean.
I searched on the Internet and I found that a packet must be 64 bits, and if it’s less you add zeros with the padding.
But in this case I’m not sure what I’m doing (Am I adding X to the packet?):
scapy.Padding(load="X"*18)
Can someone explain me what is Network Padding and what does the line of code above mean?
Thank you