Having SMB enum issues? Read this.

Since Samba deprecated support for SMBv1, I’ve seen an uptick in SMB support questions. I’ve experienced some of these headaches so I hope this helps.

SMBv1 enumeration using nmap scripts not working properly

The reason this is happening is because the script that ships with nmap on Kali needs to be updated. The way I fixed it is I grabbed that contents of the file smb.lua from the nmap repo (nmap/smb.lua at master · nmap/nmap · GitHub) and used it to replace the script that ships with Kali (/usr/share/nmap/nselib/smb.lua). nmap smb enumeration began work properly once I updated it.

Be sure to make a backup copy of your installed nmap smb.lua file if you do this just in case.

I’ve since filed a bug in the Kali bugtracker and they’re supposed to release a fix in the next version of Kali. 0006176: Nmap 7.80 smb-os-discovery script is not current & throwing an error because of it. - Kali Linux Bug Tracker

SMBClient generating an error: protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED

Samba has turned off default SMBv1 support as of September of last year. That means that if you’re trying to hit a box that is running SMBv1 (like HTB ‘Lame’) and want to use SMBClient, it’ll fail to connect most likely with a error: protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED.

The solution is to add the following to the end of your command

–option=‘client min protocol=NT1’

like this

smbclient //10.10.10.x/ --option=‘client min protocol=NT1’.

You can also add the following to /etc/samba/smb.conf under the [global] section:

client min protocol = NT1

That allows smbclient to work against SMBv1 shares.

If you want to read further here’s the advisory from the Samba site: Samba 4.11.0 - Release Notes

Good advice.
Back when I was a noob I thought I broke Samba after upgrading it, and went on to re-provision a new image of Kali.

Tysm, I was ready to dropkick my computer. :slight_smile:

So annoying ■■■■

this one is killing me i’ve tried all different min/max protocol settings and I just get NT_STATUS_RESOURCE_NAME_NOT_FOUND

edit: to anyone else stuck rn, i got it to work eventually somehow fiddling around with these protocol settings. sorry i can’t be more helpful keep at it!

Thanks you for this post!

You need to edit the “smb” config file:
sudo vi /etc/samba/smb.conf

Add the following settings under “GLOBAL”
client min protocol = CORE
client max protocol = SMB3

Save and exit the file:

1 Like