linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux Mint 4.15 Kernel and NTLMv2 account lockout with empty string password.
@ 2020-03-20 10:19 Stefan Metzmacher
  2020-04-08 15:43 ` Stefan Metzmacher
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Metzmacher @ 2020-03-20 10:19 UTC (permalink / raw)
  To: linux-cifs; +Cc: Samba Technical


[-- Attachment #1.1: Type: text/plain, Size: 1964 bytes --]

Hi,

I recently noticed the following problem with a 4.15 Kernel
on Linux Mint:

/etc/fstab has something like this:

> //172.31.9.132/share1           /media/cifs/share1      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
> //172.31.9.132/share2           /media/cifs/share2      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
> //172.31.9.132/share3           /media/cifs/share3      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
> //172.31.9.132/share4           /media/cifs/share4      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1

172.31.9.132 is a Windows Server in a Domain with Samba AD-DCs.

The initial mounting works fine, but after some time Samba
logs WRONG_PASSWORD and finally ACCOUNT_LOCKED_OUT.

From various clients this happens about once per hour!

In order to debug this I extended wireshark.
wireshark was already able to decrypt NTLMSSP encryption
when an NTLMSSP password and/or a keytab is provided.
I extended that in order add some useful expert info
that shows which NTHASH was used for a given authentication.
That is also available with an Schannel encrypted Netr_LogonSamLogon*
call. This landed in wiresharks master branch a few days ago.

The customers capture didn't show that information,
which meant that the client used a wrong password
when it got LOGON_FAILURE from the Windows fileserver
(because that got WRONG_PASSWORD or ACCOUNT_LOCKED_OUT
from the AD-DC).

I cross checked that with smbclient and there wireshark
showed the correct password was used.

This is very strange and I had the idea to just check
if maybe an empty string password was used by the client.
So I created a keytab with the NTHASH of an empty string.
And wireshark showed that this NTHASH was actually used...

Has anybody seen this before? We'll retry this with a newer
kernel next week...

Otherwise any idea how to debug that?

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linux Mint 4.15 Kernel and NTLMv2 account lockout with empty string password.
  2020-03-20 10:19 Linux Mint 4.15 Kernel and NTLMv2 account lockout with empty string password Stefan Metzmacher
@ 2020-04-08 15:43 ` Stefan Metzmacher
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Metzmacher @ 2020-04-08 15:43 UTC (permalink / raw)
  To: linux-cifs; +Cc: Samba Technical


[-- Attachment #1.1: Type: text/plain, Size: 2468 bytes --]

Am 20.03.20 um 11:19 schrieb Stefan Metzmacher:
> Hi,
> 
> I recently noticed the following problem with a 4.15 Kernel
> on Linux Mint:
> 
> /etc/fstab has something like this:
> 
>> //172.31.9.132/share1           /media/cifs/share1      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
>> //172.31.9.132/share2           /media/cifs/share2      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
>> //172.31.9.132/share3           /media/cifs/share3      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
>> //172.31.9.132/share4           /media/cifs/share4      cifs vers=1.0,credentials=/media/cifs/cifsmount.creds.txt 0 1
> 
> 172.31.9.132 is a Windows Server in a Domain with Samba AD-DCs.
> 
> The initial mounting works fine, but after some time Samba
> logs WRONG_PASSWORD and finally ACCOUNT_LOCKED_OUT.
> 
> From various clients this happens about once per hour!
> 
> In order to debug this I extended wireshark.
> wireshark was already able to decrypt NTLMSSP encryption
> when an NTLMSSP password and/or a keytab is provided.
> I extended that in order add some useful expert info
> that shows which NTHASH was used for a given authentication.
> That is also available with an Schannel encrypted Netr_LogonSamLogon*
> call. This landed in wiresharks master branch a few days ago.
> 
> The customers capture didn't show that information,
> which meant that the client used a wrong password
> when it got LOGON_FAILURE from the Windows fileserver
> (because that got WRONG_PASSWORD or ACCOUNT_LOCKED_OUT
> from the AD-DC).
> 
> I cross checked that with smbclient and there wireshark
> showed the correct password was used.
> 
> This is very strange and I had the idea to just check
> if maybe an empty string password was used by the client.
> So I created a keytab with the NTHASH of an empty string.
> And wireshark showed that this NTHASH was actually used...
> 
> Has anybody seen this before? We'll retry this with a newer
> kernel next week...

I was able to capture that in more detail
and it's actually not a problem with cifs.ko.

The dialects in the SMB Negprot request contain "Samba", so
the problem is triggered by some [lib]smbclient user, maybe it's gvfs
related. I hope to find more in the next days.

The bahavior was seen with Samba 4.3.* and 4.7.* where 4.7 sends an
empty NTLM response instead of using the nthash of an empty string.

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-08 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 10:19 Linux Mint 4.15 Kernel and NTLMv2 account lockout with empty string password Stefan Metzmacher
2020-04-08 15:43 ` Stefan Metzmacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).