Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #51052
    encryptedn00b
    Participant

    When I run the network scanner I get this error.
    IP MAC Address
    ———————————————————-
    Traceback (most recent call last):
    File “main.py”, line 15, in <module>
    scan(“10.0.2.15/24”)
    File “main.py”, line 12, in scan
    for element in answered_list():
    TypeError: ‘SndRcvList’ object is not callable

    Here is my code.

    #!/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
    answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0]

    print(“IP\t\t\tMAC Address\n———————————————————-“)
    for element in answered_list():
    print(element[1].psrc + “\t\t” + element[1].hwsrc)

    scan(“10.0.2.15/24”)

    #51076
    Diego PérezDiego Pérez
    Participant

    Hi!
    There’s no need to use () in for element in answered_list():, answered_list is a variable not a function. Please watch the lecture again and pay attention to the proper syntax.

    Greetings!
    Diego

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Privacy Overview
ZSecurity logo featuring a stylized red letter Z

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping these cookies enabled helps us to improve our website.