Ether / ARP who has ? says?

Hello,
I have a problem with building a network scanner.
I installed scapy package using pip command, but I am not able to run an ARP request.

!/usr/bin/env python3

import scapy.all as scapy


def scan(ip):
    arp_request = scapy.ARP(pdst=ip)
    broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
    arp_result = broadcast/arp_request
    arp_result.show()


scan("10.0.2.1/24")

And with code i returns me “Ether / ARP who has ?? says ??”
and this error message:

Traceback (most recent call last):
  File "network_scanner.py", line 14, in <module>
    scan("10.0.2.1/24")
  File "network_scanner.py", line 11, in scan
    arp_result.show()
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/packet.py", line 1261, in show
    return self._show_or_dump(dump, indent, lvl, label_lvl)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/packet.py", line 1235, in _show_or_dump
    reprval = f.i2repr(self, fvalue)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/fields.py", line 502, in i2repr
    x = self.i2h(pkt, x)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/layers/l2.py", line 136, in i2h
    iff = self.getif(pkt)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/layers/l2.py", line 132, in <lambda>
    self.getif = (lambda pkt: pkt.route()[0]) if getif is None else getif
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/packet.py", line 1185, in route
    return self.payload.route()
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/layers/l2.py", line 400, in route
    fld, dst = fld._find_fld_pkt_val(self, dst)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/fields.py", line 313, in _find_fld_pkt_val
    if val == dflts_pkt[self.name] and self.name not in pkt.fields:
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/base_classes.py", line 133, in __eq__
    p2, nm2 = self._parse_net(other)
  File "/home/kali/.local/lib/python2.7/site-packages/scapy/base_classes.py", line 99, in _parse_net
    tmp = net.split('/') + ["32"]
AttributeError: 'NoneType' object has no attribute 'split'

Does anyone has the same issue?
Thanks for any reply :slight_smile:

Hi myName,

Please make sure that you’re using Python 2 interpreter to follow along, cause all the code that you will write later on in the course are based on Python 2, and if you want to test other attacks related to ‘Man In The Middle’ attacks, then you should be able to run them all in Python 2 to prevent interference between Python 2 and Python 3 while the code is running since you need several programs running at once in different terminal windows as you will see later on. If you still have issues, then try to uninstall scapy and install another version:

pip uninstall scapy
pip uninstall scapy-http
pip install scapy==2.4.2
pip install scapy-http==1.8.2

Make sure that you fix the shebang in the above code to specify Python 2 instead of 3:
#!/usr/bin/env python

2 Likes

Thank you very much for your reply.
A reinstalled scapy, as you suggest and it works now.
Also Thank you for notice about using python 2 in the course.

You’re welcome, no problem :- )

1 Like

Thank you! this solved my issue as well :slight_smile:

Thanks man, appreciate this. It was driving me mad! :frowning:

I am not sure what I had done (probably through poking around with it lol) but I had to remove scapy from pycharm first, through the project settings. And then run the installers and it worked :slight_smile:

Please can anyone help !
Ether / ARP who has ?? says ??
I am gettiing only this without a error

This is the code I wrote :

#!/usr/bin/env python

import scapy.all as scapy

def scan(ip):
arp_request = scapy.ARP(pdst=ip)
broadcast = scapy.Ether(dst=“ff:ff:ff:ff:ff:ff”)
arp_request_broadcast = broadcast/arp_request
print(arp_request_broadcast.summary())

scan(“192.168.1.1/24”)

Hi Youssef,

Sorry for the delayed response. I ended up hitting some more issues further down the line. I believe it’s to do with the version of scapy and certain classes failing to reference. One of the guys on here told me you can download the version of Kali that Zaid uses and I would highly recommend it. It comes complete with all the applications and modules he is using in the course. I am a tiny, tiny bit frustrated I didn’t know about this in the first place.

Anyways, here is the link: Zaid’s custom Kali

I would try to avoid running any updates on it unless stated in the course. Hope this helps :slight_smile:

Thank you Steven for the reply. It helped me a lot. I think this link should be added provided at the start of the course. That would have saved me so much of the time I spent searching how to fix the bugs I encountered, which took days.