Active Directory / ARTICLE

over pass the hash

بسم الله والصلاة والسلام على رسول الله
اللهم علمنا ما ينفعنا وانفعنا بما علمتنا وقنا عذاب النار

intro

technique where an attacker uses a captured NTLM password hash to authenticate as a user, but instead of just logging in directly, they use that hash to request and obtain valid Kerberos tickets(TGT).This allows the attacker to seamlessly move laterally across a network using Kerberos instead of older, often-restricted legacy protocols.

You can check here to see how we obtained the hash using Pass-the-Hash (PtH) :

https://anas404.gitbook.io/anas404/active-directory/ad-attack/pass-the-hash-pth#pth-using-crackmaps

There’s also something important I’d like to mention:\
In an Over Pass-the-Hash attack, you can use either Mimikatz or Rubeus, but each one has its own advantage.

The advantage of Rubeus is that the ticket it generates has a normal expiration time, making it look legitimate.\
On the other hand, the ticket generated by Mimikatz is effectively lifetime-valid, which can attract attention and appear suspicious.

lsass ⇒ Mimikatz

Ticket ⇒ Rubeus


PTH vs Over Pass the Hash

PTH abuses NTLM authentication, which means it only works against NTLM-based services. The moment you need to access a service that requires Kerberos, PTH won’t work.

That’s where Over Pass the Hash (OPTH) comes in instead of using the hash directly for NTLM, it converts the NT hash into a Kerberos TGT. Once you have a TGT, you authenticate like any normal domain user and can access any service in the domain.

Technique Authentication Access
Pass the Hash NTLM NTLM-based services only (SMB, WMI via IP)
Over Pass the Hash Kerberos All services (LDAP, HTTP, MSSQL, etc.)

OverPass The hash Using Rubeus

Step 1. Obtain the password hash of a user account.

The first step is the same as for a pass-the-hash attack: Obtain the NTLM password hash (NT hash) for a user account we want to compromise. For that we will use Mimikatz:

We’ll skip this step and assume that we already have the hash of victim1, which we’ll use in an Over Pass-the-Hash attack.

victim1 ⇒ 5858d47a41e40b40f294b3100bea611f

If you remember from this blog, when we created a shared folder and allowed all Domain Users to access it except hacker.

https://anas404.gitbook.io/anas404/active-directory/ad-enumeration/ad-enumeration-using-powerview

Look, even when we try to access this file using hacker.

That’s why, when we perform an Over Pass-the-Hash attack using the user victim1 and request a TGT to access the SMB service, then open this shared file, we won’t get the same error.

Step 2. Perform a overpass-the-hash attack.

We’ll display all the current tickets (TGTs) that are stored in memory.

klist

The two tickets I currently have are: one for the user hacker, and the other is the cifs ticket, which was generated when I tried to access the shared resource.

overpass the hash

ruebeus asktgt /user:victim1 /rc4:5858d47a41e40b40f294b3100bea611f /ptt

/ptt ⇒ inject ticket into memory

What appears here is that you contacted krbtgt to request a TGT using victim1, and the ticket is now shown in front of you.

If there are two tickets in memory with the same name, LSASS will keep only one of them.

klist

Look at what happened when I tried to access the same file again.

steps from packet prespective

access SMB (shared folder)


Resources

https://community.spiceworks.com/t/overpass-the-hash-attack-principles-and-detection/944196


سبحانك اللهم وبحمدك, أشهد أن لا إله إلا أنت, نستغفرك ونتوب إليك
← All journal articles
Scroll to Top
Home