SMB1: Return STATUS_NOT_IMPLEMENTED when receiving Remote Administration Protocol requests

This commit is contained in:
Tal Aloni 2017-02-02 23:16:53 +02:00
parent 28eeb61f27
commit fddc896cf6
2 changed files with 9 additions and 6 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved. /* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
* *
* You can redistribute this program and/or modify it under the terms of * You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation, * the GNU Lesser Public License as published by the Free Software Foundation,
@ -68,11 +68,6 @@ namespace SMBLibrary.SMB1
return new TransactionCallNamedPipeRequest(setup, data); return new TransactionCallNamedPipeRequest(setup, data);
} }
} }
else if (setup.Length == 0 && data.Length == 0)
{
// [MS-RAP] Remote Administration Protocol request
throw new NotImplementedException("Remote Administration Protocol request");
}
throw new InvalidRequestException(); throw new InvalidRequestException();
} }
} }

View file

@ -92,6 +92,14 @@ namespace SMBLibrary.Server.SMB1
internal static SMB1Command GetCompleteTransactionResponse(SMB1Header header, string name, byte[] requestSetup, byte[] requestParameters, byte[] requestData, ISMBShare share, SMB1ConnectionState state, List<SMB1Command> sendQueue) internal static SMB1Command GetCompleteTransactionResponse(SMB1Header header, string name, byte[] requestSetup, byte[] requestParameters, byte[] requestData, ISMBShare share, SMB1ConnectionState state, List<SMB1Command> sendQueue)
{ {
if (String.Equals(name, @"\pipe\lanman", StringComparison.InvariantCultureIgnoreCase))
{
// [MS-RAP] Remote Administration Protocol request
state.LogToServer(Severity.Debug, "Remote Administration Protocol requests are not implemented");
header.Status = NTStatus.STATUS_NOT_IMPLEMENTED;
return new ErrorResponse(CommandName.SMB_COM_TRANSACTION);
}
TransactionSubcommand subcommand = TransactionSubcommand.GetSubcommandRequest(requestSetup, requestParameters, requestData, header.UnicodeFlag); TransactionSubcommand subcommand = TransactionSubcommand.GetSubcommandRequest(requestSetup, requestParameters, requestData, header.UnicodeFlag);
TransactionSubcommand subcommandResponse = null; TransactionSubcommand subcommandResponse = null;