Windows Authentication - Paiet/SEC-335 GitHub Wiki
Objectives:
- Explain the process used for authentication by the Security Account Manager, NTLM, and Kerberos
-
Windows Security Accounts Manager(SAM) Database
- Located in the Registry
- %SystemRoot%/system32/config/SAM
- Stores hashed user passwords
- LM/NTLM hashes
- Special lock on the SAM to keep safe
- SAM can't be copied or moved while the system is running
- It can be accessed directly from memory
- Located in the Registry
-
NT LAN Manager(NTLM) Authentication
- Used to be THE auth mechanism for Windows
- Now just there as a back-up to Kerberos
- A user accesses a client computer and provides a
- domain name
- user name
- password.
- The client computes a cryptographic hash of the password
- discards the actual password
- The client sends the user name to the server (in plaintext).
- discards the actual password
- The client computes a cryptographic hash of the password
- The server generates a 16-byte random number
- Called a 'challenge.'
- Sends it back to the client
- Client encrypts this challenge with the hash of the user's password
- Returns the result to the server
- This is called the 'response'.
- The server sends the following three items to the domain controller:
- User Name
- Challenge sent to the client
- Response received from the client
- The domain controller uses the user name to retrieve the hash of the user's password
- It compares the encrypted challenge with the response by the client
- If they match, authentication is successful
- Domain Controller notifies the server.
- If they match, authentication is successful
- The server then sends the appropriate response back to the client.
- Used to be THE auth mechanism for Windows
-
Kerberos
- User's client generates an authenticator and is encrypted with the User's password
- Authenticator = info about the user + timestamp
- Client sends the encrypted authenticator to the KDC
- KDC looks up the username and password (also checks the timestamp)
- KDC tries to decrypt the authenticator with the password
- KDC sends back a TGT to the client
- TGT is also timestamped and encrypted with the same key as the authenticator
- Client decrypts the TGT with the user's password key
- Client uses TGT to access other resources
- Client requests access to Sever_A
- TGT + Server_A Access Request
- KDC accepts the request because of TGT
- KDC generates an updated ticket for Server_A access
- Client receives the new ticket and sends a copy to Server_A
- Server_A decrypts ticket with its own password