From 52c5449d085ff1336442cbb235c6fadf9561bbdd Mon Sep 17 00:00:00 2001 From: Davide Ornaghi Date: Sun, 26 Jun 2022 21:01:57 +0200 Subject: [PATCH] Added flag to drop SSP from Net-NTLMv1 auth --- examples/smbserver.py | 2 ++ impacket/ntlm.py | 7 +++++-- impacket/smbserver.py | 24 ++++++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/examples/smbserver.py b/examples/smbserver.py index df658a0f73..b65e3fc2f7 100755 --- a/examples/smbserver.py +++ b/examples/smbserver.py @@ -42,6 +42,7 @@ parser.add_argument('-debug', action='store_true', help='Turn DEBUG output ON') parser.add_argument('-ip', '--interface-address', action='store', default='0.0.0.0', help='ip address of listening interface') parser.add_argument('-port', action='store', default='445', help='TCP port for listening incoming connections (default 445)') + parser.add_argument('-dropssp', action='store_true', default=False, help='Disable NTLM ESS/SSP during negotiation') parser.add_argument('-smb2support', action='store_true', default=False, help='SMB2 Support (experimental!)') if len(sys.argv)==1: @@ -72,6 +73,7 @@ server.addShare(options.shareName.upper(), options.sharePath, comment) server.setSMB2Support(options.smb2support) + server.setDropSSP(options.dropssp) # If a user was specified, let's add it to the credentials for the SMBServer. If no user is specified, anonymous # connections will be allowed diff --git a/impacket/ntlm.py b/impacket/ntlm.py index bf26f1d6c3..b9c5c4a9a0 100644 --- a/impacket/ntlm.py +++ b/impacket/ntlm.py @@ -145,6 +145,9 @@ def computeResponse(flags, serverChallenge, clientChallenge, serverName, domain, # If set, the connection SHOULD be anonymous NTLMSSP_NEGOTIATE_ANONYMOUS = 0x00000800 +# Flags used by Responder to drop SSP (little endian) +NTLMSSP_DROP_SSP_STATIC = 0xe2818215 + # If set, LM authentication is not allowed and only NT authentication is used. NTLMSSP_NEGOTIATE_NT_ONLY = 0x00000400 @@ -269,7 +272,7 @@ class VERSION(Structure): ) class NTLMAuthNegotiate(Structure): - + structure = ( ('','"NTLMSSP\x00'), ('message_type','