ShawnDEvans / smbmap

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

RuntimeError: received 0 items of ancdata #85

Closed relector-tuxnix closed 1 year ago

relector-tuxnix commented 1 year ago

When listing out files and shares with the -r option its possible to hit the maximum number of file descriptors (ulimit):

error

https://stackoverflow.com/questions/71642653/how-to-resolve-the-error-runtimeerror-received-0-items-of-ancdata

It would be nice to either have a warning when that limit is hit or to have the limit raised for the process using:

import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1]))

The above addition into smbmap.py worked for me.

ShawnDEvans commented 1 year ago

TIL - I'll drop that code in. Thanks!

ShawnDEvans commented 1 year ago

Added! I have personally never experienced the same issue, so I just rolled with your propose solution. Thanks a bunch!