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’
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