Difference between revisions of "Pass-the-Hash (PtH)"

From Embedded Lab Vienna for IoT & Security
Jump to navigation Jump to search
m
 
(33 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[Disclamer: this Wiki page is just an explanation of how Pass-The-Hash attack works and how it can be carried out and is done only for educational purposes. The author does not hold any responsibility for any misuse of the information included in this Wiki page and advises not to use it for any illegal actions nor in any way that could be harmful to any person or entity.]
[Disclamer: this Wiki page is just an explanation of how Pass-The-Hash attack works and how it can be carried out and is done only for educational purposes.  
The author does not hold any responsibility for any misuse of the information included in this Wiki page and advises not to use it for any illegal actions nor in any way that could be harmful to any person or entity.]


== Introduction ==  
== Introduction ==  


Pass-the-hash is a method used by hackers to authenticate themselves to servers even if they do not have the password! The technique makes use of a flaw in the user-authentication protocols, such as NTLM and LM. The authentication protocols authenticate the user by checking the hash of the password instead of the password itself. Hence the hashing algorithm always resolves to the same hash as long as the password is not changed. This allows the attackers to focus on obtaining the hash, which is a lot easier than trying to get the password using brute-force, for example.
Since 1991, when Microsoft introduced the Lan Manager, local Windows networks had a weak point which made it possible for an attacker to authenticate themself as a user in the network if they gained access to a machine in the network. A Windows network consists of several systems, machines and protocols which work together to authenticate a user or a machine in said system. But early Windows iterations came with an authentication mechanism which was insecure and easy to attack once an attacker had an entry point into a Windows network.


Even though an attacker still needs to acquire the hash in some way to carry out the attack, it is still far easier to get hold of a hash instead of the actual password.
With Pass-The-Hash attackers can authenticate themself to a domain server, even if they do not have the real password in plaintext! On a machine under an attackers control, they can read the hash values of all user who logged onto that machine and gain access to files and services the corresponding users would have access to. Once in possession of the password hash, they can exploit a design weakness in the authentication protocols Windows implements to impersonate themself as registered users in the system.


While the attack is more common on windows servers environments, it is still possible to attack if, for example, a Linux server was using the same vulnerable protocols that we are going to discuss. Moreover, even though Microsoft tried to improve the situation by introducing new restrictions to improve how credentials are managed.
While still all Windows operating systems implement this protocols, they are not configured by default and a system administrator must switch them on intentionally. So, if no mistakes were made during configuration of the Windows local network, the Pass-The-Hash attack should not be feasible anymore.


== Pass-the-Hash Attack ==
== Windows network authentication ==


It is almost a day-to-day activity these days that administrators and even regular users authenticate to remote servers. Since remote servers nowadays are most likely to have valuable information stored, it is only natural to allow access only to authorized users. To do this, engineers have to come up with protocols that authenticate and challenge users to prove that they are whom they say they are, usually by providing a password.
When a user loges onto a Windows network, several systems and protocols need to work together to allow the user access to machines, files and services in the system.


Most of these protocols would hash the password on the client-side and then send the hashed password over the network to authenticate. The flaw here is that a mere hashing of a password would yield the same hash every time, as long as both the password and the hashing algorithm remain the same.
[[File:DomainAuthentication.png|650px]]


This would turn the hash itself into an equivalent of that password, and it would lose its meaning. First and foremost, and before we start having a look at how this attack works and how can we mitigate it, let us have a look at the protocols themselves and how they work, to have a better understanding of how the attackers came to found the flaws in their logic and were able to harness these flaws into an attack that would gain them access to servers which they should not have access to in the first place. NTLM and LM are authentication protocols that are used to authenticate users to remote servers.
=== Local Security Authority Subsystem Service (LSASS) ===


=== NTLM and LM ===
The LSASS is the local authentication service which handles all users and logins on a single machine. When a user enters its credentials, the LSASS authenticates them by either looking up the stored passwords locally, or, when the user wants to log onto a network, communicates with the domain controller to authenticate the user. For authentication in a network it uses the Lan Manager (LM) or later the New Technology Lan Manager (NTLM) to encrypt a challenge send by the domain controller to verify the user.


LM stands for LAN Manager, and it is an old network operating system (NOS) that turned out to have many issues that we are going to mention below. This NOS was developed by IBM and Microsoft in the late 80s and have had many revisions to improve it until it was finally dropped in the mid-90s.


LM used to authenticate using a hashing method called the "LM hashing algorithm," but it had so many vulnerabilities that rendered it obsolete.
=== Lan Manager (LM) ===


The Lan Manager was introduced to Windows in 1991 to authenticate users in a local network. Its tasks are to hash the user password and to encrypt the challenge send by the domain controller to authenticate a user. To generate the hash it follows this steps:


Some of these vulnerabilities in its algorithms and protocols were:
# The password gets converted to uppercase.
# The string gets padded to 14 bytes
# and split into two halves which each build a DES key.
# Each key then encrypts a constant.
# The results get concatenated which build the LM hash.


# No distinguishing between capital and small letters, i.e., case-insensitive.
Then to answer the challenge from the domain controller the LM
# It did not allow long passwords, but only up to 14 chars.
# The hash was calculated for half of the characters only, meaning the password would be broken to two seven chars password, and then the hash would be calculated for each.
# If the number of characters that are used in a password was less than seven chars, it would always produce the same constant hash value no matter what password was used.


As we can see, by knowing today's security standards, there is no need to say why the entire protocol was weak and prone to attacks.
# pads the Hash to 21 bytes
All this and more have to lead to the development of a successor called NTLM. However, this successor also had its problems as we are going to see later on.
# which get split into three parts to 7 bytes each.
# Each part is used as a DES key
# to encrypt the challenge.
# The three results get concatenated to the answer.


NTLM consist of three steps:
If the domain controller calculates the same answer, the user now is authenticated in the network.


# The client would send a NEGOTIATE MESSAGE to the server to establish a connection with it.
Even by the time it was introduced, the LM was not considered safe.
# The server would respond with a CHALLENGE MESSAGE to identify the client.
Some of the vulnerabilities in its algorithms and protocols were:
# The client sends back an AUTHENTICATE MESSAGE to the server.


This all sounds nice until we know that NTLM stored hashed passwords unsalted on the server, which renders the hashes to be a replacement of the passwords in the sense that you can use the hash as if it was a password and login with it, and since getting hold of a hash is much easier (at least relatively) than getting hold of a password, it
*No distinguishing between capital and small letters, i.e., case-insensitive.
compromised all systems that used this kind of protocol.
*It did not allow long passwords, but only up to 14 chars.
*Only 56 Bit out of 128 Bits were used for the key


=== Functionality ===


To carry out PtH attack, we must first get a username and the hash assigned to it, and there are a couple of ways to do this in what is called "Hashes Harvesting," an example of methods used to harvest hashes include but are not limited to:
=== New Technology LAN Manager (NTLM) ===


# Attacking the caches to find any cached hashes.
1993 Microsoft introduced the NTLM (version 1) to new Windows iterations. It came with a few security improvements like an improved challenge and it didn't transfer the has in plaintext anymore. The most important change though was the use of the MD4 hash function to calculate the password hash.
# Sniffing the network for any hashes that are being transferred using weak protocols.
# Having a dump of the memory somehow, e.g., through social engineering.


After getting hold of some caches, the attacker then starts by using some tools that we are going to discuss in the next chapter.
Three years later, 1996, Microsoft introduced the second version of the NTLM which improved the security further by implementing longer passwords and a once again improved challenge. This new challenge was now calculated as followed:


== Tools ==
# The password hash was calculated using the MD4 hash algorithm.
# Username and domain name get concatenated
# and this value gets encrypted using the HMAC-MD5 algorithm with the password hash as a key which results in the NTLM v2 password hash.
# A BLOB gets generated and concatenated with the challenge.
# The result gets encrypted with the HMAC-MD5 algorithm using the NTLM v2 password hash as a key.
# The resulting value is then concatenated with the BLOB and send to the domain controller as the answer.


PtH attack can be carried out using a set of tools, but all of this, of course, can only be
Although these changes did improve the security of the protocol by helping to mitigate offline relay attacks, but leave NTLMv2 exposed to other NTLMv1 vulnerabilities and therefore still does not meet the standards required today. It still uses the MD4 hash, which by today's standards is not satisfactory, and saves the hashes unsalted on the local machine, before sending it salted over the wire. New authentication suites such as Kerberos help mitigate many of these vulnerabilities. Kerberos adds more security measures such as relying on a third server to authenticate both parties, so the client and the server are certain they are communicating with the correct opposites.
done after having harvested some hashes.
Some of the most popular tools to carry out the PtH attack are:


# samdump2
# mimikatz


=== samdump2 ===
== Pass-The-Hash ==
 
For the attack to be viable, a few preconditions need to be met:
 
* The attacker already needs to have access to a vulnerable machine in the network.
* On this machine the attacker needs to have local administrator rights.
* LM or NTLM need to be configured to be used by the LSASS.
 
=== Accessing the password hash ===
 
There are a couple of ways to do access a user password hash on a local machine:
 
* Windows stores hashes of users in the network that logged onto on that machine in a process called Local Security Authority Subsystem Service (lsass.exe). An attacker can read from this running programm to access the password hashes. As soon as the machine shuts down, the hashes are no longer stored.
* The hashes local users are stored in a registry file or also called the Security Account Manager (SAM). This file is always accessible, even after a restart of the machine.
* Sniffing the network for any hashes that are being transferred.
 
The SAM database does not guarantee access to a network account, so the safest attack route would be to access the password hashes stored in the lsass.exe.
To read out the LSASS process or the SAM, the program needs local admin rights. Thus, the user has to be tricked into executing it with the according rights.
 
=== Tools ===
 
There are several tools which can be used to perform the Pass-The-Hash attack. Consequently, two of the most popular tools are introduced :
 
* Samdump2
* Mimikatz
 
=== Samdump2 ===


samdump2 tool was designed to get dumps of Windows password hashes, namely Windows XP, NT, and 2k, and as the name suggests it does this by taking a dump of the SAM file using something called syskey, which is a feature in Windows that is supposed to strengthen the SAM database by adding and an additional layer of encryption.
samdump2 tool was designed to get dumps of Windows password hashes, namely Windows XP, NT, and 2k, and as the name suggests it does this by taking a dump of the SAM file using something called syskey, which is a feature in Windows that is supposed to strengthen the SAM database by adding and an additional layer of encryption.


=== mimikatz ===
=== Mimikatz ===


Mimikatz tool, on the other hand, tries to extract hashes, PIN codes, as well as passwords in plain text from memory.
[[File:Mimikatz.jpeg|650px]]
 
Mimikatz, on the other hand, tries to extract hashes, PIN codes, as well as passwords in plain text from memory.
It is a much stronger tool since it allows a wider variety of other attacks that are mainly focused on playing with the weak security of Windows systems that use the protocols mentioned above.
It is a much stronger tool since it allows a wider variety of other attacks that are mainly focused on playing with the weak security of Windows systems that use the protocols mentioned above.
Mimikatz is also one of few tools that got updated after Windows Defender Credential Guard (WDCG) was enabled by default with Windows 10. WDCG made access to the LSASS process extremely difficult.
This concludes the set of tools that are going to be used in the accompanying demonstration of this essay to demonstrate how PtH attack works when using these tools.
This concludes the set of tools that are going to be used in the accompanying demonstration of this essay to demonstrate how PtH attack works when using these tools.


== Mitigation ==
=== Passing the hash ===
 
[[File:PTH_Attack.png|400px]]
 
After stealing the password hash, the attacker can access every file and service authorised for the user whos password hash they now possess. They now simply answer the domain controllers challenge with the password hash they stole and perfectly impersonate the target user. If the user happens to be an administrator in the domain, the attacker now has full control over the network.
 
== Mitigation and preventive measures  ==


Over the years, many improvements to the vulnerable protocols in question have been released, and more and more studies are being done by Microsoft [5] and other institutions to mitigate this attack.
Over the years, many improvements to the vulnerable protocols in question have been released, and more and more studies are being done by Microsoft [5] and other institutions to mitigate this attack.
Some of the mitigation techniques that are mentioned in these studies are:
Some of the mitigation techniques that are mentioned in these studies are:


# Protecting the accounts that have high-privileges by adding more restrictions to them.
# Protecting the accounts that have high privileges by adding more restrictions to them like not having email accounts.
# Removing administrative privileges to local accounts and then restricting these accounts to help to prevent the attackers from taking advantage of such accounts.
# Removing administrative privileges to local accounts and then restricting these accounts to help to prevent the attackers from taking advantage of such accounts.
# Adding firewall rules that would restrict the incoming traffic to the server.
# Adding firewall rules that would restrict the incoming traffic to the server.
# Correlating Authentication Services.
# Correlating Authentication Services.
This is by no means an exhaustive list, simply a guide in the proper direction. Other principles like security by obscurity, by hiding the LSASS memory location, are not viable options in this case. This is due to the fact that the IT security field is so vast and the knowledge of Windows infrastructure so known, that it would be found again very quickly. Additionally, some more recommendations are listed below:
Other recommendations:
#Do not let highly privileged accounts browse the Internet
#Standard users should be removed from the local Administrators group
#Ensure that administrative accounts do not have email addresses
#Update operating system and applications
#Limit the amount of privileged domain accounts and their use
#Domain controllers must be secured and managed


== Demonstration using mimikatz ==
== Demonstration using mimikatz ==
Line 86: Line 135:
In our scenario, we have two computers that belong to different domains but are inside the same intranet network, let us say one belongs to the administrators' domain, and the second one belongs to the employees' domain.
In our scenario, we have two computers that belong to different domains but are inside the same intranet network, let us say one belongs to the administrators' domain, and the second one belongs to the employees' domain.


All that is left now is for someone from the employee domain to ask someone from the administrators' domain to install something on their PC using their admin account, and then the attack is ready to be carried out.
All that is left now is for someone from the employee domain, to ask someone from the administrators' domain to install something on their PC using their admin account.  


The employee adds a local account on his PC, and downloads mimikatz and types the following:
When the administrator logs in to the employee's pc, the hash value is saved locally in the LSASS process. Now the attack is ready to be carried out.
 
Because the employee knows a way to become a local admin he downloads mimikatz, executes it, and types the following:


  privilege::debug;
  privilege::debug;


This would escalate the mimikatz privilege and use the local admin account.
This command grant mimikatz debug rights which are also needed.


  sekurlsa::logonpasswords;
  sekurlsa::logonpasswords;


This would then show a dump of all the NTLM hashes that are stored on the system, and of course, it should include the NTLM hash of the person who used his admin account from the administrators' domain on that PC
This would then show a dump of all the NTLM hashes that are stored on the system, and of course, it also includes the NTLM hash of the domain administrator.
 
Now the employee can use the information of that admin (username, domain, and NTLM hash) to authenticate to other clients and servers in that domain using mimikatz:
 
sekurlsa::pth /user:USER /domain:DOMAIN /ntlm:NTLM_HASH /run:cmd
 
After this, a cli should open with administrative privileges and the employee is able to extract any information he or she wants.
 
 
Furthermore, the hash value of the password can even be cracked. If the password is not secure enough such as ”123456789”, you can find out the actual password by using a random free password hash cracker on the internet. This is the reason being,
why passwords should be taken much more into consideration.


Now all that is left is for the employee to copy the information of that admin (username, domain, and NTLM hash) and replace the values in the following command line.


sekurlsa::pth /user:USER /domain:DOMAIN /ntlm:NTLM /run:cmd.exe;
[[File:Online CrackStationjpeg.jpeg|650px]]


== Conclusion ==
== Conclusion ==


The pass-the-hash attack can be a horrifying attack given what kind of privileges it gives the attacker in the case of a successful attack, but this is not the end of the mitigation methods that were implemented with a regular update to the system it should mitigate the attack and protect servers against it. Also, there is a server lining, in that it pushes forward the security of Windows servers and let the developers focus on improving them to let system administrators have much more secure servers to deal with.
The pass-the-hash attack can be a horrifying attack given what kind of privileges it gives the attacker in the case of a successful attack, but this is not the end of the mitigation methods that were implemented with a regular update to the system it should mitigate the attack and protect servers against it. Also, there is a server lining, in that it pushes forward the security of Windows servers and lets the developers focus on improving them to let system administrators have much more secure servers to deal with. Although , it cannot be ruled out completely that attackers would find new approaches to exploit vulnerabilities in authentication protocols.


== Sources ==
== Sources ==
Line 111: Line 171:
* https://linux.die.net/man/1/samdump2
* https://linux.die.net/man/1/samdump2
* https://www.sans.org/reading-room/whitepapers/testing/pass-the-hash-attacks-tools-mitigation-33283
* https://www.sans.org/reading-room/whitepapers/testing/pass-the-hash-attacks-tools-mitigation-33283
* https://docs.microsoft.com/en-us/previous-versions/technet-magazine/cc160954(v=msdn.10)?redirectedfrom=MSDN
* https://www.microsoft.com/en-us/download/details.aspx?id=36036
* https://www.microsoft.com/en-us/download/details.aspx?id=36036
* https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nlmp/a4f28e01-3df1-4fd1-80b2-df1fbc183f21
* https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2016/2871997?redirectedfrom=MSDN
* https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2016/2871997?redirectedfrom=MSDN
* https://ieeexplore.ieee.org/document/7474171
* https://ieeexplore.ieee.org/document/7474171
* https://www.aspheute.com/english/20040105.asp
* https://www.sans.org/reading-room/whitepapers/testing/pass-the-hash-windows-10-39170
* https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/ntlm-user-authentication
*https://www.sans.org/white-papers/33283/


[[Category:Documentation]]
[[Category:Documentation]]
[[Category:Pentesting]]

Latest revision as of 18:37, 12 March 2024

[Disclamer: this Wiki page is just an explanation of how Pass-The-Hash attack works and how it can be carried out and is done only for educational purposes. The author does not hold any responsibility for any misuse of the information included in this Wiki page and advises not to use it for any illegal actions nor in any way that could be harmful to any person or entity.]

Introduction

Since 1991, when Microsoft introduced the Lan Manager, local Windows networks had a weak point which made it possible for an attacker to authenticate themself as a user in the network if they gained access to a machine in the network. A Windows network consists of several systems, machines and protocols which work together to authenticate a user or a machine in said system. But early Windows iterations came with an authentication mechanism which was insecure and easy to attack once an attacker had an entry point into a Windows network.

With Pass-The-Hash attackers can authenticate themself to a domain server, even if they do not have the real password in plaintext! On a machine under an attackers control, they can read the hash values of all user who logged onto that machine and gain access to files and services the corresponding users would have access to. Once in possession of the password hash, they can exploit a design weakness in the authentication protocols Windows implements to impersonate themself as registered users in the system.

While still all Windows operating systems implement this protocols, they are not configured by default and a system administrator must switch them on intentionally. So, if no mistakes were made during configuration of the Windows local network, the Pass-The-Hash attack should not be feasible anymore.

Windows network authentication

When a user loges onto a Windows network, several systems and protocols need to work together to allow the user access to machines, files and services in the system.

DomainAuthentication.png

Local Security Authority Subsystem Service (LSASS)

The LSASS is the local authentication service which handles all users and logins on a single machine. When a user enters its credentials, the LSASS authenticates them by either looking up the stored passwords locally, or, when the user wants to log onto a network, communicates with the domain controller to authenticate the user. For authentication in a network it uses the Lan Manager (LM) or later the New Technology Lan Manager (NTLM) to encrypt a challenge send by the domain controller to verify the user.


Lan Manager (LM)

The Lan Manager was introduced to Windows in 1991 to authenticate users in a local network. Its tasks are to hash the user password and to encrypt the challenge send by the domain controller to authenticate a user. To generate the hash it follows this steps:

  1. The password gets converted to uppercase.
  2. The string gets padded to 14 bytes
  3. and split into two halves which each build a DES key.
  4. Each key then encrypts a constant.
  5. The results get concatenated which build the LM hash.

Then to answer the challenge from the domain controller the LM

  1. pads the Hash to 21 bytes
  2. which get split into three parts to 7 bytes each.
  3. Each part is used as a DES key
  4. to encrypt the challenge.
  5. The three results get concatenated to the answer.

If the domain controller calculates the same answer, the user now is authenticated in the network.

Even by the time it was introduced, the LM was not considered safe. Some of the vulnerabilities in its algorithms and protocols were:

  • No distinguishing between capital and small letters, i.e., case-insensitive.
  • It did not allow long passwords, but only up to 14 chars.
  • Only 56 Bit out of 128 Bits were used for the key


New Technology LAN Manager (NTLM)

1993 Microsoft introduced the NTLM (version 1) to new Windows iterations. It came with a few security improvements like an improved challenge and it didn't transfer the has in plaintext anymore. The most important change though was the use of the MD4 hash function to calculate the password hash.

Three years later, 1996, Microsoft introduced the second version of the NTLM which improved the security further by implementing longer passwords and a once again improved challenge. This new challenge was now calculated as followed:

  1. The password hash was calculated using the MD4 hash algorithm.
  2. Username and domain name get concatenated
  3. and this value gets encrypted using the HMAC-MD5 algorithm with the password hash as a key which results in the NTLM v2 password hash.
  4. A BLOB gets generated and concatenated with the challenge.
  5. The result gets encrypted with the HMAC-MD5 algorithm using the NTLM v2 password hash as a key.
  6. The resulting value is then concatenated with the BLOB and send to the domain controller as the answer.

Although these changes did improve the security of the protocol by helping to mitigate offline relay attacks, but leave NTLMv2 exposed to other NTLMv1 vulnerabilities and therefore still does not meet the standards required today. It still uses the MD4 hash, which by today's standards is not satisfactory, and saves the hashes unsalted on the local machine, before sending it salted over the wire. New authentication suites such as Kerberos help mitigate many of these vulnerabilities. Kerberos adds more security measures such as relying on a third server to authenticate both parties, so the client and the server are certain they are communicating with the correct opposites.


Pass-The-Hash

For the attack to be viable, a few preconditions need to be met:

  • The attacker already needs to have access to a vulnerable machine in the network.
  • On this machine the attacker needs to have local administrator rights.
  • LM or NTLM need to be configured to be used by the LSASS.

Accessing the password hash

There are a couple of ways to do access a user password hash on a local machine:

  • Windows stores hashes of users in the network that logged onto on that machine in a process called Local Security Authority Subsystem Service (lsass.exe). An attacker can read from this running programm to access the password hashes. As soon as the machine shuts down, the hashes are no longer stored.
  • The hashes local users are stored in a registry file or also called the Security Account Manager (SAM). This file is always accessible, even after a restart of the machine.
  • Sniffing the network for any hashes that are being transferred.

The SAM database does not guarantee access to a network account, so the safest attack route would be to access the password hashes stored in the lsass.exe. To read out the LSASS process or the SAM, the program needs local admin rights. Thus, the user has to be tricked into executing it with the according rights.

Tools

There are several tools which can be used to perform the Pass-The-Hash attack. Consequently, two of the most popular tools are introduced :

  • Samdump2
  • Mimikatz

Samdump2

samdump2 tool was designed to get dumps of Windows password hashes, namely Windows XP, NT, and 2k, and as the name suggests it does this by taking a dump of the SAM file using something called syskey, which is a feature in Windows that is supposed to strengthen the SAM database by adding and an additional layer of encryption.

Mimikatz

Mimikatz.jpeg

Mimikatz, on the other hand, tries to extract hashes, PIN codes, as well as passwords in plain text from memory. It is a much stronger tool since it allows a wider variety of other attacks that are mainly focused on playing with the weak security of Windows systems that use the protocols mentioned above. Mimikatz is also one of few tools that got updated after Windows Defender Credential Guard (WDCG) was enabled by default with Windows 10. WDCG made access to the LSASS process extremely difficult. This concludes the set of tools that are going to be used in the accompanying demonstration of this essay to demonstrate how PtH attack works when using these tools.

Passing the hash

PTH Attack.png

After stealing the password hash, the attacker can access every file and service authorised for the user whos password hash they now possess. They now simply answer the domain controllers challenge with the password hash they stole and perfectly impersonate the target user. If the user happens to be an administrator in the domain, the attacker now has full control over the network.

Mitigation and preventive measures

Over the years, many improvements to the vulnerable protocols in question have been released, and more and more studies are being done by Microsoft [5] and other institutions to mitigate this attack. Some of the mitigation techniques that are mentioned in these studies are:

  1. Protecting the accounts that have high privileges by adding more restrictions to them like not having email accounts.
  2. Removing administrative privileges to local accounts and then restricting these accounts to help to prevent the attackers from taking advantage of such accounts.
  3. Adding firewall rules that would restrict the incoming traffic to the server.
  4. Correlating Authentication Services.

This is by no means an exhaustive list, simply a guide in the proper direction. Other principles like security by obscurity, by hiding the LSASS memory location, are not viable options in this case. This is due to the fact that the IT security field is so vast and the knowledge of Windows infrastructure so known, that it would be found again very quickly. Additionally, some more recommendations are listed below:

Other recommendations:

  1. Do not let highly privileged accounts browse the Internet
  2. Standard users should be removed from the local Administrators group
  3. Ensure that administrative accounts do not have email addresses
  4. Update operating system and applications
  5. Limit the amount of privileged domain accounts and their use
  6. Domain controllers must be secured and managed

Demonstration using mimikatz

In our scenario, we have two computers that belong to different domains but are inside the same intranet network, let us say one belongs to the administrators' domain, and the second one belongs to the employees' domain.

All that is left now is for someone from the employee domain, to ask someone from the administrators' domain to install something on their PC using their admin account.

When the administrator logs in to the employee's pc, the hash value is saved locally in the LSASS process. Now the attack is ready to be carried out.

Because the employee knows a way to become a local admin he downloads mimikatz, executes it, and types the following:

privilege::debug;

This command grant mimikatz debug rights which are also needed.

sekurlsa::logonpasswords;

This would then show a dump of all the NTLM hashes that are stored on the system, and of course, it also includes the NTLM hash of the domain administrator.

Now the employee can use the information of that admin (username, domain, and NTLM hash) to authenticate to other clients and servers in that domain using mimikatz:

sekurlsa::pth /user:USER /domain:DOMAIN /ntlm:NTLM_HASH /run:cmd

After this, a cli should open with administrative privileges and the employee is able to extract any information he or she wants.


Furthermore, the hash value of the password can even be cracked. If the password is not secure enough such as ”123456789”, you can find out the actual password by using a random free password hash cracker on the internet. This is the reason being, why passwords should be taken much more into consideration.


Online CrackStationjpeg.jpeg

Conclusion

The pass-the-hash attack can be a horrifying attack given what kind of privileges it gives the attacker in the case of a successful attack, but this is not the end of the mitigation methods that were implemented with a regular update to the system it should mitigate the attack and protect servers against it. Also, there is a server lining, in that it pushes forward the security of Windows servers and lets the developers focus on improving them to let system administrators have much more secure servers to deal with. Although , it cannot be ruled out completely that attackers would find new approaches to exploit vulnerabilities in authentication protocols.

Sources