ShawnDEvans / smbmap

SMBMap is a handy SMB enumeration tool
GNU General Public License v3.0
1.76k stars 343 forks source link

Provide a list of IP addresses does not work #92

Closed xkill closed 9 months ago

xkill commented 10 months ago

When provide a list of IP addresses, it returns the following error:

Traceback (most recent call last):
  File "/usr/local/bin/smbmap", line 33, in <module>
    sys.exit(load_entry_point('smbmap==1.9.3.1', 'console_scripts', 'smbmap')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/smbmap-1.9.3.1-py3.11.egg/smbmap/smbmap.py", line 1323, in main
    elif socket.gethostbyname(host):
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known
ShawnDEvans commented 9 months ago

I added more graceful host verification and error handling. It should address the issue you had with an invalid host in the list. I need to add a bit more for file handling, so I'll leave this one open.

ShawnDEvans commented 9 months ago

I mirrored the error checking for --host-file inputs. It should be good to go go. Thanks very much for the bug report!