2

Using python with Scapy, I have no problems changing the MAC address destination of the packets using the following sample code:

packet = Ether(dst=[MAC address])/IP()......

However, when I try to do the same with ARP like this:

packet = Ether(dst=[MAC address])/ARP(......

The packet does not get sent out. Is it because ARP is already a layer 2 protocol? If thats the case, is there any possibility of manually changing the destination MAC of an ARP packet?

Lew Wei Hao
  • 763
  • 1
  • 13
  • 25
  • So, you are curious about just changing `dst=`? I mean i have it as a hardcoded string, but if i extract them, i would see no reason why it couldnt be globally changed. I use that in my get_mac_address calls though, as i use the static string to help determining the target ip address' mac addr. When doing arp poisoning, i will pass in a target mac, which correlates to the tar ip address. I think you would want to have it be a proper pairing – Fallenreaper May 03 '17 at 20:50

1 Answers1

0

This works for me:

sendp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(op=ARP.who_has, psrc="10.250.0.145", pdst="10.250.0.129"))
KlausD
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 19 '22 at 03:40