Authentication Methods

1) Authentication and Password Cracking

a) Authentication, Authorisation and Accounting

Authentication: a system attempts to make a positive identification of the person or other system that wants to access secured information or services.

Authorisation: a set level of access to a resource is granted to a user or system.

Accounting: details regarding use of resources are logged in a file.

Types of authentication information could fall into three categories:

  • something you know: username or password

  • something you have: swipe card or token

  • something you are or your integral part: finger print, voice, retina (biometric)

There are three types of authentication:

  • One-factor authentication: typically identifies users based on something only they should know. It is less secure than two-factor or three-factor authenticating. Using only a fingerprint sensor, card readers are all examples of one-factor authentication.

  • Two-factor authentication: usually requires users to identify themselves to something they know and something they have. For instance while using ATM it is necessary to swipe a card through a reader and provide personal identification number (PIN). Another example is a biometric fingerprint scanner and a PIN or a swipe card.

  • Three-factor authentication: uses something you know, something you have and something you are. For example, it may require a user to enter a PIN, swipe a card and use a biometric scanner before gaining access to the system.

2) Hashing Protocols and Password Cracking

In a windows environment, there are three primary authentication protocol commonly used:

Kerberos version5 (Kerberos v5): is the primary authentication protocol used in Active Directory Domain Service (AD DS). It is supported by Windows 2000, Windows XP, Windows Server 203, Windows Vista and Windows Server 2008.

NT LAN Manager (NTLM): is a challenge-response protocol (CHAP) used in Windows NT 4.0. Windows 2000 and later support NTLMv2. For instance, NTLM authentication is used when a Windows Server 2003/2008 attempts to authenticate to a Windows NT 4.0 domain controller (DC). It may also be used when a Windows NT 4.0 workstation attempts to authenticate to a Windows 2000 Server or Windows Server 2003/2008 DC.

LANMAN (LM) hash: is an older authentication protocol used by Microsoft 9X and earlier operating systems. It is also natively supported by Windows XP for backward compatibility. A Windows Vista password is stored as an NTLMv2 hash, whereas in the earlier systems Windows passwords were stored as NTLM or LM hashes. It is possible to enable Windows Vista to store passwords as LM hashes if you need to connect to an older computer or device that doesn’t support NTLM or Kerberos authentication.

An LM hash starts by converting all characters to uppercase. It then stores the hash in two pieces each of 7 bytes long. If the password is longer, it is truncated; otherwise it is padded with null characters. Each half of the hash uses DES to created two DES keys. The keys are then used to encrypt the password as two 8-byte values, which are then concatenated into a single 16-byte LM hash value.

LM hashes are easily cracked using brute force attacks. Hence it’s not recommended to store these hashes unless absolutely necessary.

Password Cracking:

Encryption keys range from weak 40-bit keys to strong keys that can have 2048-bit keys. Weak keys are the result of using weak or simplistic algorithms, and are easier to crack. Strong encryption and strong keys provide better protection of a system against hackers.

For instance, if each byte holds a value between 0 and 255, it is going to be stronger than if each byte holds a value between 0 and 10. The values within the key need to be random as well. If there is a same sort of pattern the key is easier to break.

There are four main password cracking techniques/types of password attacks:

a) Mathematical Attacks: are used to decrypt information and discover secret keys. Mathematical attacks on cryptographic systems are known as cryptanalysis.

There are three categories of mathematical attack based on the information the hacker has managed to obtain:

  • Cipher text only: here, the hacker knows only the encrypted data and has no knowledge of its clear text content.

  • Known plain text: here, the hacker has access to several messages in unencrypted and encrypted forms.

  • Chosen plain text: here, the hacker can read or encrypt any message

b) Birthday Attacks: are based on a probability theory referred to as the birthday paradox. It states that in a random group of 23 or more people, there is almost a 50% chance that two of those people will have the same birthday. The more people in the gathering, the greater chances are that people share a birthday. For 57 or more people in a group, there is over 99% chance of this happening. The resultant pairing is called collisions.

c) Password Guessing Attacks: there are various techniques an attacker might use to help guess a password:

  • Dictionary attacks: compare the hash for each word in a Standard English dictionary against a password. The comparison goes word by word through a dictionary.

  • Brute-force attacks: creates all possible combinations of characters that a password might include. There are several factors that determine how difficult it is to crack a password using brute-force attack. For example, the key length, the number of possible values each position in the key might have and whether the account is locked after entering incorrect passwords several times.

  • Rainbow tables: are tables of values that you can download or create and then use with a specific program to crack passwords. The tables work only with the hash functions for which they were created. The tables take long time to create and are quite large. But once they are set up, they can be used repeatedly. There are MD5, LM, SHA and NTLM tables.

  • Masked attacks: refers to an attack if the attacker knows the length of a password and any of the characters it contains. This makes it faster for the password cracking tool to obtain the password since not every single permutation of upper-case and lower-case letters, numbers and special characters needs to be tried.

d) SAM and SYSTEM file Attacks: The user’s account and password information are stored in the form of hashes in the computer’s SAM and SYSTEM files. Hence a hacker attempts to access the information in these files directly. In Windows systems, each user’s accounts and passwords are stored in a local SAM file. During installation of a DC, user is prompted for a password for Directory Services and Restore Mode. This password is used for repairing a server is also stored in a SAM file.

SAM file contain the password hashes. Creating a dump of these files using password cracking tool is likely to obtain the passwords.

2) Authentication Systems

Unauthorised access can be prevented by

  • using strong authentication methods

  • not allowing users to bypass authentication system

  • ensuring that authentication information is kept confidential and is not compromised

  • encrypt all authentication information sent over the network

 a) Authentication Methods

A good authentication system ensures good risk management in which all personal user data and network assets are secure and can be accessed only by authorised users.

There are three methods of verifying proof of identity via a network:

Knowledge-based authentication (KBA): involves asking a potential user to provide information known only to them. For example, asking mother’s maiden name, name of first school and so on. Despite this method is not the most secure, but it is suitable when no other methods are available.

Dynamic knowledge-based authentication: Here a query to a public database is made for the information about a user and then ask the user to verify their knowledge of this information. As the queried information is stored in an external public database, the risk of the information being compromised is not a problem for the institution doing the verification. For example, asking information regarding the user’s previous address or amount on a bank loan. The user must answer several questions and get a high percentage of the answers correct in order to be authenticated.

Out-of-band (OOB) authentication: involves using an external channel as the primary authentication method. For example, this may involve a system attempt to call back user via the number the user had called to an organisation.

A system that supports single sign-ones enables to access resources across multiple servers after the user is authenticated only once. Single sign-on can be performed using a SSL certificate, which uniquely identifies a user. LDAP model is another method of using single sign-on, where all resources are secured within one directory.

Challenge Handshake Authentication Protocol (CHAP): is an authentication method used by PPP servers. This protocol validates all remote client identities at the start of a session and periodically during the session. PPP increases the security of a network. It also enables network users to use dynamic addressing and protocols when communicating with remote hosts.

After establishing a link between the client and the server, CHAP uses 3-way handshake:

  • the authenticating server sends a challenge message to the client

  • the client replies with a hash value computed using the challenge and the user’s locally stored credentials

  • The authenticating server compares the hash value it received to a locally generated hash, derived from its own copy of the user’s credentials.

 During a CHAP authentication, the client will continue to receive messages from the authenticating server. This is to ensure that the server is still connected to the same client. Each authentication challenge will be different.

 Extensible Authentication Protocol (EAP): extends the functionality of PPP. It enables to use multiple authentication methods such as token cards, one-time passwords, certificates and biometrics. It also enables wireless connections. EAP functions by running over Data Link layers. It is not an authentication mechanism but helps to define the formats of authentication messages. The EAP authentication framework supports various authentication methods or protocols; such as:

  • Lightweight Extensible Authentication Protocol (LEAP)

  • EAP Transport Layers Security (EAP-TLS)

  • EAP Flexible Authentication via Secure Tunnelling (EAP-FAST)

 Password Authentication Protocol (PAP): is used by PPP to secure remote dial-up access to a network. PAP is not a secure authentication method as it transmits unencrypted passwords across a network. Hence it is used only if no other authentication methods are available.

Using mutual authentication or two-way authentication, both a client and server authenticate one another. It protects against man-in-the-middle attack and phishing attacks, because it ensures an attacker can’t masquerade as the user of a particular client or as a server.

In a certificate-base mutual authentication, both the client and server must trust one another’s security certificates. Typically, the server first sends its certificate to the client. If the client accepts this certificate, it will return its own certificate if this is requested. Once mutual authentication is completed, the client and server can negotiate and create the keys needed to encrypt their connection. This process may me re-initiated multiple times during a single session through either user or automated intervention.

Apart from using certificates, mutual authentication can be based on a Diffie Hellman key exchange, in which a secret key is shared between the client and the server. This secret is protected during the authentication and verification process.

The following EAP methods can be used for mutual authentication:

  • TLS or SSL: here the server is required to produce a certificate and prove that it possesses the private key.

  • Internet Key Exchange (IKE): here the server is required to prove that it possesses a pre-shared or private key.

  • Generic Security Services Application Program Interface (GSSAPI): here the server needs to provide information regarding session key.

b) Kerberos

Kerberos is an authentication method that enables to secure connections on physically insecure networks. It can be used to authenticate users and services over an open multi-platform network using a single login procedure. This enables users to perform other actions and commands without needing to authenticate to a server more than once.

While using Kerberos, all the processes used for authenticating credentials are centralised through the use of a Key Distribution Centre (KDC).

A Kerberos system contains the following components:

  • Principal: is a server or client to which Kerberos can assign tickets.

  • Authentication server (AS): gives ticket-granting tickets to an authorised service or user.

  • Ticket-granting Server (TGS): provides authorised services or users with temporary session keys and tickets.

  • KDC: is a server that runs AS and TGS services to provide initial ticket and ticket-granting ticket requests.

  • Realm: is a boundary within an organisation that contains an AS and TGS.

  • Remote Ticket-granting Server (RTGS): is a TGS in a remote realm.

During Kerberos authentication, various types of data are transmitted over the network:

  • Credentials: are tickets for the resource server, along with the session key.

  • Session key: is a temporary encryption key used for communication between a client and resource server. A session key can be used only for a single login session.

  • Authenticator: is a record that usually lasts for five minutes. It contains information proving that a session key was recently created and that it is known only to the client and the server.

  • Ticket: is a record that a client uses to authenticate to a server. It contains the client’s identity, session key, a timestamp and a checksum, and is secured with the resource server’s secret key.

  • Ticket-granting ticket (TGT): are tickets that are granted during the Kerberos authentication process. They are used to acquire additional tickets from the TGS.

Kerberos encrypts a user’s credentials over insecure channels and then validates the user’s access to network resources. The following are the steps during this process:

  1. The user logs in: a user logs into a workstation with their username and password, and the workstation automatically requests a TGT from the AS. A database on the AS lists the valid users and server within its realm, along with their master keys.

  2. The user is authenticated: as the AS receives the TGT request, it authenticates the user, uses their master key to encrypt a new TGT and sends it back to the user’s workstation. The user doesn’t need to be authenticated again to gain access to additional resources until the TGT is expired. The TGT is valid during the current logon session, for a set time configured in an account security policy, or until the user disconnects or logs off.

  3. The user requests a service from the TGS: as the user requests additional services, the user’s workstation automatically requests the following from the TGS:

  • a ticket for each of the services and a copy of the TGT

  • the name of the server where the requested application resides

  • an authenticator

  • the time period for accessing each service

  1. The user is given permission for the requested service: as the TGS verifies the user’s identity, the session key is used to access the user’s authenticator. Assuming the TGT matches the user to the authenticator, the TGS sends the tickets to enable the user to access the requested service. 

  1. The user requests permission from the resource server: once the appropriate tickets are received from TGS, the user’s workstation verifies that each one is for a service that was originally requested, and sends a ticket to the resource server requesting permission to use the services.

Workstation
  1. The user logs in ==>
Authenticating Server
  1. <== The user is authenticated
  1. The user requests a service from the TGS ==>
Ticket-granting Server
  1. <== The user is given permission for the requested service
  1. The user requests permission from the resource server ==>
Resource Server

A TGT must be submitted each time a user needs additional services. When the validity period for using a previously requested service expires, a new TGT must be obtained.

Kerberos uses an AS, TGT and TGS to ease lengthy authentication process. In case of large organisation, it may require to authenticate thousands of users. Hence Kerberos can be used to authenticate these users using multiple AS, where each AS is responsible for the users and servers contained only in its realm on the network. Each realm will have its own AS and TGS. If a client requires a service running in another realm, the system can use cross-realm authentication to authenticate the user.

Here are the following steps that occur in cross-realm Kerberos authentication:

  1. The client contacts the local TGS for their realm and requests permission to access a service in a remote realm.

  2. The TGS grants a remote TGT, but the token doesn’t provide access to a specific remote TGS or service. It just notifies other TGSs that the user has been authenticated.

  3. The client sends the remote TGT to the remote TGS and requests access to a service in its realm.

  4. The remote TGS verifies the user’s identity and creates a session key, which is then sent to the user’s client.

  5. The client sends the session key to the cross-realm server to use its services.

  6. The client accesses the service after the remote RS verifies the user’s credentials.

 

Workstation

  1. The client contacts the local TGS ==>
Key Distribution Centre/

Authentication Server/

Ticket-granting Server

  1. <== The TGS grants a remote TGT
  1. The client sends the remote TGT to the remote TGS ==>
Remote Key Distribution Centre/

Authentication Server/

Ticket-granting Server

  1. <== The remote TGS verifies the user’s identity
  1. The client sends the session key to the cross-realm server ==>
Cross-realm Server
  1. <== The client accesses the service

Vulnerabilities of Kerberos:

Vulnerability due to insecure or weak passwords: If a system has a weak password, Kerberos will not be able to protect system against strong attack. Kerberos assumes that all network devices are secure and attackers cannot gain access to passwords that are between the user and the service which the user needs to access.

  • Vulnerability to denial-of-service attacks: Kerberos is vulnerable to denial-of-service attacks. Buffer overflows and unstable memory operations can occur, and null-terminations can be missed.

  • Use of timestamps: Since Kerberos makes use of timestamps, the clocks in network authenticating devices need to be loosely synchronised so that authentication can occur as it should.

  • AS vulnerability: When using Kerberos, it is necessary to make sure that an attacker cannot gain access to the AS, in which case the attacker can impersonate any authorised user on the network.

  • Recycled security identifiers (SIDs): You should not recycle authenticating device identifiers. For instance if a user leaves the organisation, you need to make sure that their identification data is removed from the access control list. If the user’s principal identifier is given to another user, the new user will have the access to the same network services as the original user.

Windows enables anonymous users to comment to systems through the use of null sessions. If a client is authenticated using Kerberos, the server will receive a token for that client containing the group SIDs. This token can then be used to check the access that an access control list (ACL) grants to resources. The application that is being accessed adopts the user’s identity after it has authenticated the user. This is known as impersonation.

Impersonation works on individual threads to take advantage of multi-threaded servers. This means that a process running with multiple threads might use some of those threads to impersonate another client that has been authenticated to the application.

Null sessions were originally created to enable unauthenticated hosts to use MS networking and to obtain browse lists from NT servers. A null session enables anonymous as well as guest access to remote systems without authentication, even if the Guest account is disabled.

If a Windows-based computer is configured to enable remote users to connect anonymously through null sessions, it makes the system vulnerable to attacks by hackers, who can user the null sessions to access the system. COM servers also enable null sessions, irrespective of the servers; required authentication levels. To block null sessions on a COM server, you need to configure its access control policy to prevent their use.

The privileges an attacker can gain depend on the number of null session that can be exploited on the server. If the server runs as SYSTEM and impersonates incoming clients, an attacker who hijacks the server process can access the local resources. The Win 32 function “RevertToSelf” can be used by the attacker to remove the impersonation token and revert the thread to process’s identity.

If a hacker accesses a remote system via a null session, they can access information such as username, password policies, etc. The null session also enables the hacker to access account names and determine the administrator account name. If this happens, the hacker can view all shared resources on the system using this command: “Net view \computername”

Hackers can be prevented from exploiting null sessions by enabling firewalls on the system. It is also recommended to disabled NetBIOS over TCP/IP. Doing this enables the null session feature of NetBIOS. The registry entry HKLMSYSTEMCurrentControSetControlLSA can then be edited to set RestrictAnonymous=1. However, there are tools hackers can use to get around this setting.

Null sessions can be secured by using applications to monitor all connections. “Desktop Sentry” is an example that works on older Windows systems (Windows NT) which lists usernames and IP address of a all users connected to a system, and identifies whether each connection is a null session.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.