carmaa / nacker

Nacker is a tool to circumvent 802.1x Network Access Control (NAC) on a wired LAN. Nacker will help you locate any non-802.1x configurable hosts on your subnet, and spoof their MAC address so that you appear authenticated to the switch.
GNU General Public License v2.0
104 stars 19 forks source link

Sorting lambda functions crash #3

Open altf4 opened 10 years ago

altf4 commented 10 years ago

The sorting functions at lines 112 and 113 fail for me, with a stack trace as follows:

Sorting hosts to targeting printers first, and laptops last
Traceback (most recent call last):
  File "./nacker", line 156, in <module>
    main(sys.argv)
  File "./nacker", line 111, in main
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
  File "./nacker", line 111, in <lambda>
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
  File "/usr/lib/python2.7/dist-packages/netaddr/eui/__init__.py", line 464, in oui
    return OUI(self.value >> 24)
  File "/usr/lib/python2.7/dist-packages/netaddr/eui/__init__.py", line 121, in __init__
    raise NotRegisteredError('OUI %r not registered!' % oui)
netaddr.core.NotRegisteredError: OUI 13164779 not registered!

Relevant code:

    # Sort the MAC addresses based on organization, laptops and workstations
    print('Sorting hosts to targeting printers first, and laptops last')
    hosts.sort(key = lambda host: host[1].oui.registration().org in PC_MANUFACTURERS)
    hosts.sort(key = lambda host: host[1].oui.registration().org in PRINTER_MANUFACTURERS, reverse=True)

(Running from an Ubuntu 14.04 machine.)

carmaa commented 10 years ago

Oh, my... Wasn't prepared for people testing this tool yet - it's currently not working but thanks for reporting the bugs. Have updated the readme.