Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33430
    AvatarBartosz
    Participant

    Hi,

    Following the lecture “Using Scapy To Create an ARP Request”, when I run the program I get this return:

    ARP who has ?? says ??

    code:

    “””
    #!/usr/bin/env python

    import scapy.all as scapy

    def scan(ip):
    arp_request = scapy.ARP(pdst=ip)
    print(arp_request.summary())

    scan(“10.0.2.1/24”)
    “””

    I tried:
    1. the alternative function code:
    def scan(ip):
    arp_request = scapy.ARP()
    arp_request.pdst=ip
    print(arp_request.summary())

    2. reinstalling scapy

    3. Installing the COMPLETE version of scapy
    $ pip install –pre scapy[complete] -> didn’t work, but the pip3 method did:
    pip3 install –pre scapy[complete]

    4. running the program with python3
    (python3 network_scanner.py
    instead of
    python network_scanner.py)

    5. I thought maybe python can’t print it out because the return is not a string, so, out of despair, I tried “””print(str(arp_request.summary()))””” – but that didn’t help either.

    Nothing helped, still getting the same result. (“ARP who has ?? says ??”)
    Any further suggestions would be highly appreciated πŸ™‚

    #33431
    AvatarBartosz
    Participant

    IMPORTANT NOTE:

    i just realized that feeding the function just a single IP works.

    So instead of using the range:
    scan(β€œ10.0.2.1/24”)

    using just:
    scan(β€œ10.0.2.1.X”)

    works as expected.
    How can I translate this functionality to use IP ranges?

    #33512
    AvatarZaid Sabih
    Moderator

    Please try the following fix and it should allow you to search for ranges as shown in the lecture
    pip uninstall scapy

    pip install scapy==2.4.0

    pip3 install scapy==2.4.0

    #33525
    AvatarBartosz
    Participant

    RESOLVED, thank you very much!

    version 2.4.2 works as well

    #33527
    AvatarBartosz
    Participant

    …but so may other features still don’t, that I’ve decided to roll back to 2.4.0, as you suggested πŸ™‚

    Just wanted to share in case others experience similar issues.
    Thanks again!

    #33858
    AvatarZaid Sabih
    Moderator

    You’re welcome, I’m glad I could help πŸ™‚

    #35044
    AvatarLaurent
    Participant

    Hi, I had the same issue. The above fix worked. Thank you for that.
    However, I wanted to ask what version of scapy was installed earlier and whether we upgraded it to a newer version or rolled back to an older one. If it is an older version, does it mean we will run into problems when python will update?

    #35107

    Actualy when we tested the new version, it didn’t work as expected that’s why we suggest to use the older version of scaoy.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.