home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / info / ntkb / ntkb.exe / Q103 / 3 / 90.TXT < prev    next >
Encoding:
Text File  |  1993-10-06  |  17.7 KB  |  449 lines

  1. DOCUMENT:Q103390  05-OCT-1993  [W_NTAS]
  2. TITLE   :Network Access Validation Algorithm and Example
  3. PRODUCT :Microsoft Windows NT Advanced Server
  4. PROD/VER:3.10
  5. OPER/SYS:WINDOWS
  6. KEYWORDS:
  7.  
  8. --------------------------------------------------------------------
  9. The information in this article applies to:
  10.  
  11.  - Microsoft Windows NT Advanced Server version 3.1
  12. --------------------------------------------------------------------
  13.  
  14. The following is a simplified algorithm that explains how Windows NT
  15. Advanced Server account validation is observed to function during
  16. network access. This discussion does not cover the internal workings
  17. of this process. With this information, you can predict Windows NT
  18. network logon behavior under deterministic conditions.
  19.  
  20. Background Information
  21. ----------------------
  22.  
  23. When two Microsoft network systems communicate over a network, they
  24. use a high-level protocol called server message block (SMB). These
  25. commands are embedded within the transport protocols like NetBEUI or
  26. TCP/IP. When a client carries out a NET USE command, it sends out a
  27. "SMB Session Setup and X" frame.
  28.  
  29. In Windows NT, the Session Setup SMB includes the user account, a
  30. function of the encrypted password and login domain. An Advanced
  31. Server will look at all of this information to determine if the client
  32. has permissions to complete the NET USE command.
  33.  
  34. Algorithm
  35. ---------
  36.  
  37. Windows NT workstation sends the following command to an Advanced
  38. Server:
  39.  
  40.    NET USE x: \\server\share
  41.  
  42. The Windows NT client sends a Session Setup SMB that contains its
  43.     Login Domain, User Account and Password.
  44. The Advanced Server checks the SMB specified Domain name
  45. If  the domain is the Advanced Server's own Domain then
  46.     It checks its own Domain SAM[Security Account Manager]database for
  47.         a matching account.
  48.     If  it finds a matching account then
  49.         The SMB password is compared to the Domain Database password.
  50.         If  the password matches then
  51.             The Command Completed Successfully.
  52.         If  the password does NOT match then
  53.             User is prompted for a password.
  54.                 It is retested as above.
  55.             System error 1326 has occurred.  Logon failure: unknown
  56.             user name or bad password.
  57.         End
  58.     If  it does NOT find the account in the domain SAM database then
  59.         Guest permissions are tested.
  60.         If  the Guest account is Enabled
  61.             The Command Completed Successfully.
  62.         If  the Guest account is Disabled
  63.             * See Note A.
  64.             User is prompted for a password.
  65.             System error 1326 has occurred.  Logon failure:
  66.                 unknown user name or bad password.
  67.         End
  68.  
  69. If  the Domain specified in the SMB is one that the Advanced
  70.         Server TRUSTS then
  71.     The Advanced Server will do pass through authentication.  The
  72.         network logon request will be sent to an Advanced Server in the
  73.         specified Trusted Domain.
  74.     The Trusted Domain Advanced Server checks its own Domain database
  75.         for a matching account.
  76.     If  it finds a matching account then
  77.         It looks to see if the Account is a Local or Global Account.
  78.         If  the Account is Local then
  79.             Guest permissions on the Original Server are tested.
  80.             If  the Guest account is Enabled
  81.                 The Command Completed Successfully.
  82.             If  the Guest account is Disabled
  83.                 * See Note A.
  84.                 User is prompted for a password.
  85.                 System error 1326 has occurred.  Logon failure:
  86.                 unknown user name or bad password.
  87.         End
  88.         If  the Account is Global
  89.             The SMB password is compared to the Domain Database
  90.                 password.
  91.             If  the password matches then
  92.                 The Command Completed Successfully.
  93.                 * See Note B.
  94.             If  the password does NOT match then
  95.                 User is prompted for a password.
  96.                     It is retested as above.
  97.                 System error 1326 has occurred.  Logon failure:
  98.                 unknown user name or bad password.
  99.         End
  100.     If  it does NOT find the account in the Trusted domain
  101.             database then
  102.         Guest permissions are tested on the ORIGINAL Advanced
  103.             Server -NOT the Trusted Advanced Server.  * See Note C.
  104.         If  the Guest account is Enabled
  105.             User will have original server guest access.
  106.             The Command Completed Successfully.
  107.         If  the Guest account is Disabled
  108.             * See Note A.
  109.             User is prompted for a password.
  110.             System error 1326 has occurred.  Logon failure:
  111.                 unknown user name or bad password.
  112.     End
  113.  
  114. If  the Domain specified in the SMB is UNKNOWN by the Advanced
  115.         Server. [A Domain was specified but it was not
  116.         recognized by the Server as a Trusted Domain or
  117.         its own.]
  118.     It  will check its own Domain Account Database for
  119.         a matching account.  This is done just as if the user had
  120.         specified the Advanced Servers domain instead of an unknown
  121.         domain.
  122.     If  the Advanced Server finds a matching account then
  123.         The SMB password is compared to the Domain Database password.
  124.         If  the password matches then
  125.             The Command Completed Successfully.
  126.         If  the password does NOT match then
  127.             The User is prompted for a password.
  128.                 It is retested as above.
  129.             System error 1326 has occurred.  Logon failure: unknown
  130.             user name or bad password.
  131.     End
  132.     If  it does NOT find the account in the domain database then
  133.         Guest permissions are tested.
  134.         If  the Guest account is Enabled
  135.             The Command Completed Successfully.
  136.         If  the Guest account is Disabled
  137.             System error 1326 has occurred.  Logon failure:
  138.             unknown user name or bad password.
  139.     End
  140.  
  141. If  the Domain specified in the SMB is NULL [None specified] then
  142.     The Advanced Server will treat this a local network logon.  It
  143.         will check for a matching account in its own SAM Database.
  144.     If  it finds a matching account then
  145.         The SMB password is compared to the SAM Database password.
  146.         If  the password matches then
  147.             The Command Completed Successfully.
  148.         If  the password does NOT match then
  149.             The User is prompted for a password.
  150.                 It is retested as above.
  151.             System error 1326 has occurred.  Logon failure: unknown
  152.             user name or bad password.
  153.     End
  154.     If  it does NOT find the account in the local SAM Database then
  155.         The Advanced Server will Simultaneously ask another Advanced
  156.             Server in each Domain that it Trusts if it has account that
  157.             matches the SMB account.
  158.         The first Trusted Advanced Server to reply is sent a request to
  159.             perform pass through authentication of the client
  160.             information.
  161.         The Trusted Advanced Server will look in its own SAM Database.
  162.         If  an account that matches the SMB account is found then
  163.             It looks to see if the Account is a Local or Global
  164.                 Account.
  165.             If  the Account is Local then
  166.                 Guest permissions on the original Server are tested.
  167.                 If  the Guest account is Enabled
  168.                     The Command Completed Successfully.
  169.                 If  the Guest account is Disabled
  170.                 The user will be prompted for a password.
  171.                 No matter what password is entered, user will receive
  172.                     "Error 5: Access has been denied."
  173.             End
  174.             If  the Account is Global
  175.                 The password specified in the SMB is compared
  176.                     to the SAM Database password.
  177.                 If  the password matches then
  178.                     The Command Completed Successfully.
  179.                 If  the password does NOT match then
  180.                     The User is prompted for a password.
  181.                         It is retested as above.
  182.                     System error 1326 has occurred.  Logon failure:
  183.                     unknown user name or bad password.
  184.             End
  185.     If  no Trusted Domains respond to request to identify the
  186.         account then
  187.         Guest permissions are tested on the Original Advanced Server -
  188.             not the Trusted server.
  189.         If  the Guest account is Enabled
  190.             The Command Completed Successfully.
  191.         If  the Guest account is Disabled
  192.             System error 1326 has occurred.  Logon failure:
  193.             unknown user name or bad password.
  194.     End
  195.  
  196. Notes
  197. -----
  198.  
  199. 1. At the point that the GUEST account is disabled and the user does
  200.    not have an account, the Windows NT Server will still request a
  201.    password. Although no password will meet its requirements, it will
  202.    still request it. This is a security measure. It insures that an 
  203.    unauthorized user cannot tell the difference between a case where 
  204.    an account exists and when the account does not exist. Password 
  205.    prompting always occurs regardless if the account exists.
  206.  
  207. 2. At this point, the following information is returned from the
  208.    Trusted Domain in the Response:  Domain SID, User ID, Global Groups
  209.    Memberships, Logon Time, Logoff Time, KickOffTime, Full Name, Password
  210.    LastSet, Password Can Change Flag, Password Must Change Flag, User
  211.    Script, Profile Path, Home Directory and Bad Password Count.
  212.  
  213.  - Guest account only matters in the domain of the Server you are
  214.    attempting to access. Guest accounts on trusted domains never come 
  215.    into play.
  216.  
  217.  - All steps above assume Global Account unless specified as Local
  218.    Account. See the "Concepts and Planning Guide" for more information 
  219.    on account types.
  220.  
  221.  - The actual internal process is more complicated than the steps
  222.    described above.
  223.  
  224.  - This does not cover the actual pass-through authentication
  225.    mechanics. For more information, query on the following words in
  226.    the Microsoft Knowledge Base:
  227.  
  228.       authentication and msv
  229.  
  230.  - This does not cover the password encryption process used in Windows NT.
  231.    For more information, query on the following words in the Microsoft
  232.    Knowledge Base:
  233.  
  234.       authentication and msv
  235.   
  236.    A function of the One Way Encrypted password is sent.
  237.  
  238.  - This article does not detail the internal workings of the MS
  239.    Authentication Module.
  240.  
  241.  - The above model assumes that the Guest Account, when enabled, has no
  242.    password. This is the default in Windows NT. If a guest account
  243.    password is specified, it must match the users password that sends in
  244.    the SMB.
  245.  
  246. Example
  247. -------
  248.  
  249. The following are examples of this algorithm in action:
  250.  
  251. I am logged on to my Windows NT workstation local computer. I am using
  252. the same account name and password that is in SCRATCH-DOMAIN Advanced
  253. Server Domain account database. When I carry out the NET USE \\SCRATCH
  254. (Domain Controller for SCRATCH-DOMAIN) command, the command completes
  255. successfully. When I carry out the NET USE \\NET (Controller that
  256. Trust SCRATCH-DOMAIN) command. I receive the error message "System
  257. error 1326 has occurred. Logon failure: unknown user name or bad
  258. password." My account \SCRATCH-DOMAIN\USER1 has permissions on \\NET?
  259. What is the problem?
  260.  
  261. Configurations
  262. --------------
  263.  
  264. Windows NT workstation:
  265.  
  266.  - Login account: USER1
  267.  - Password:      PSW1
  268.  - Login Domain:  LOCAL1
  269.  
  270. Windows NT Advanced Server:
  271.  
  272.  - Server Name:            NET
  273.  - Advanced Server Domain: NET-DOMAIN
  274.  - Trust:                  NET-DOMAIN Trust SCRATCH-DOMAIN (Therefore, 
  275.    accounts on SCRATCH-DOMAIN can be granted permissions in the NET-DOMAIN.
  276.  - Domain Account Database for NET-DOMAIN does NOT contain an
  277.    account for USER1.
  278.  - Guest Account is DISABLED.
  279.  
  280. Windows NT Advanced Server:
  281.  
  282.  - Server Name:                       SCRATCH
  283.  - Advanced Server Domain:            SCRATCH-DOMAIN
  284.  - Domain Database contains account:  USER1
  285.  - Domain Database contains password: PSW1
  286.  
  287. Answer
  288. ------
  289.  
  290. In this example, the Windows NT workstation is logged on to its local
  291. workstation domain--not the Advanced Server SCRATCH-DOMAIN where its
  292. domain account resides.
  293.  
  294. NET USE x: \\NET\share
  295.  
  296.  - When the Windows NT workstation carried out the NET USE x:
  297.    \\NET\share command, it sent out account = "USER1", password = "PSW1" 
  298.    and domain = "LOCAL1" in the Session Setup SMB.
  299.  
  300.  - The Advanced Server \\NET received the SMB and looked at the account
  301.    name.
  302.  
  303.  - It looks in its local domain account database and does not find a
  304.    match.
  305.  
  306.  - \\NET then looks at the SMB Domain name.
  307.  
  308.  - It does not trust "LOCAL1" so it does not check any of its trusted
  309.    domains.
  310.  
  311.  - \\NET then checks its Guest account.
  312.  
  313.  - The guest account is disabled so the "System error 1326 has
  314.    occurred. Logon failure: unknown user name or bad password." message 
  315.    is generated. 
  316.  
  317. NET USE x: \\SCRATCH\share
  318.  
  319.  - When the Windows NT workstation carried out the NET USE x:
  320.    \\SCRATCH\share command, it sent out account = "USER1", 
  321.    password = "PSW1" and domain = "LOCAL1" in the Session Setup SMB.
  322.  
  323.  - The Advanced Server \\SCRATCH receives the SMB and looks at the account
  324.    name.
  325.  
  326.  - It looks in its local domain account database and finds a match.
  327.  
  328.  - \\SCRATCH then compares the SMB password to the Domain account password.
  329.  
  330.  - The passwords match so the "Command Completes Successfully" message
  331.    is generated.
  332.  
  333. In these cases, the trust relationship does not come into play. If the
  334. Workstation had been logged on to the SCRATCH-DOMAIN, the 
  335. NET USE x: \\NET\share command would have been successful.
  336.  
  337. The real answer here is to have all workstations log on to an Advanced
  338. Server domain. In order to login, the user must specify their correct
  339. domain, account, and password. After this is done, all NET USE type
  340. commands will pass the correct domain, account, and password.
  341. Administrators should try and avoid duplicate accounts on both Windows
  342. NT workstations and multiple Advanced Server domains.
  343.  
  344. USER: Workaround
  345. ----------------
  346.  
  347. There is one workaround that can be used in these cases. From the
  348. Windows NT workstation, you could carry out the following command
  349.  
  350.    NET USE X: \\NET\SHARE /USER:SCRATCH-DOMAIN\USER1 PSW1
  351.  
  352. where
  353.  
  354.   - \\NET = The computer name of the Advanced Server being accessed.
  355.   - \SHARE = The share name.
  356.   - /USER: command line parameter that lets you specify the domain,
  357.     account and password that should be specified in the Session Setup
  358.     SMB.
  359.   - SCRATCH-DOMAIN = Domain name of the Advanced Server where the user
  360.     account resides.
  361.   - \USER1 = account to be validated against.
  362.   - PSW1 = password that matches account on the domain.
  363.  
  364. For more information, type the following at a Windows NT command
  365. prompt:
  366.  
  367.    NET USE /? 
  368.  
  369. NULL Domain Names
  370. -----------------
  371.  
  372. In addition to Windows for Workgroups 3.1, other Microsoft network
  373. clients also send NULL Domain Names in the Session Setup SMB [x73]. 
  374. They will also exhibit the behavior described above in the example
  375. problem. The following is a table of how each client handles the
  376. Domain Name.
  377.  
  378. MS Network                        Domain Name
  379.   Client                           Specified
  380. ---------------------------------------------
  381.  
  382. Word for Windows 3.1               NULL
  383.  
  384. MS OS/2 LAN Manager 2.0, 2.1,
  385. and 2.2                            NULL
  386.  
  387. MS-DOS LAN Manager 2.0             NULL
  388.  
  389. MS-DOS LAN Manager 2.1 & 2.2       Logon domain name. * See Note below.
  390. (Including Windows on MS-DOS)
  391.  
  392. Windows NT 3.1                     Logon domain name.
  393.  
  394. Notes
  395. -----
  396.  
  397. The default domain name is specified in the LANMAN.INI file on the
  398. "DOMAIN =" line. This can be overridden by the /DOMAIN: switch with
  399. the NET LOGON command.
  400.  
  401. There are typically two representations for "NULL" in the SMB: A
  402. zero-length domain name and a one-byte domain name consisting of the
  403. character '?'. The Windows NT SMB server catches the '?' and
  404. translates it to NULL before passing it to the local security
  405. authority (LSA).
  406.  
  407. Troubleshooting
  408. ---------------
  409.  
  410. A good tip for troubleshooting network access problems is to enable
  411. auditing by doing the following:
  412.  
  413. 1. In the User Manager for Domains window, choose Audit from the Policies
  414.    menu.
  415.  
  416. 2. Select the Audit These Events button.
  417.  
  418. 3. Select the Logon and Logoff Success and Failure options.
  419.  
  420. Now, anytime a network user access this server remotely, an audit
  421. trail will be logged in the Event Viewer. In the Event Viewer, choose
  422. Security from the Log menu to see the events.
  423.  
  424. For information on trust relationships, pass-through authentication,
  425. user permissions, and domain logins, please see your Windows NT
  426. Advanced Server "Concepts and Planning" guide or query on the
  427. following words in the Microsoft Knowledge Base:
  428.  
  429.    authentication and pass-through
  430.  
  431. Additional reference words: 3.10 
  432. KBCategory:
  433. KBSubCategory: netsrv
  434.  
  435. =============================================================================
  436.  
  437. THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
  438. PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
  439. ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
  440. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  441. EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
  442. ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
  443. CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
  444. MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
  445. POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
  446. OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
  447. SO THE FOREGOING LIMITATION MAY NOT APPLY.
  448.  
  449. Copyright Microsoft Corporation 1993.