Exemplo n.º 1
0
        internal static SMBCommand GetSessionSetupResponseExtended(SMBHeader header, SessionSetupAndXRequestExtended request, StateObject state)
        {
            SessionSetupAndXResponseExtended response = new SessionSetupAndXResponseExtended();

            //see commit dd68473e2086bad4c57d39bb33d7c1a87d037144. Bunch of authentication stuff was removed

            response.Action       = SessionSetupAction.SetupGuest;
            header.UID            = state.AddConnectedUser("Guest");
            response.NativeOS     = String.Empty; // "Windows Server 2003 3790 Service Pack 2"
            response.NativeLanMan = String.Empty; // "Windows Server 2003 5.2"

            return(response);
        }
Exemplo n.º 2
0
        internal static SMBCommand GetSessionSetupResponse(SMBHeader header, SessionSetupAndXRequest request, StateObject state)
        {
            SessionSetupAndXResponse response = new SessionSetupAndXResponse();

            // The PrimaryDomain field in the request is used to determine with domain controller should authenticate the user credentials,
            // However, the domain controller itself does not use this field.
            // See: http://msdn.microsoft.com/en-us/library/windows/desktop/aa378749%28v=vs.85%29.aspx
            response.Action        = SessionSetupAction.SetupGuest;
            response.PrimaryDomain = request.PrimaryDomain;
            header.UID             = state.AddConnectedUser("Guest");

            if ((request.Capabilities & ServerCapabilities.LargeRead) > 0)
            {
                state.LargeRead = true;
            }
            if ((request.Capabilities & ServerCapabilities.LargeWrite) > 0)
            {
                state.LargeWrite = true;
            }
            response.NativeOS     = String.Empty; // "Windows Server 2003 3790 Service Pack 2"
            response.NativeLanMan = String.Empty; // "Windows Server 2003 5.2"

            return(response);
        }