Monday, May 30, 2022
HomeInformation SecurityPlay with Hashes — Over Cross The Hash Assault | by Nairuz...

Play with Hashes — Over Cross The Hash Assault | by Nairuz Abulhul | R3d Buck3T


Lateral Motion Assault in Energetic Listing Atmosphere, MITRE ATT&CK — ID: T1550.00

https://unsplash.com/pictures/U8sChKD43U0Philippa Rose-Tite

After compromising a website person on the community, the subsequent step is to collect all usernames, hashes, delicate info, and something that helps pivot to different machines throughout the community. In fact, we should remember the fact that extracting a lot of these info is noisy and can journey off some alerts in case you are on the lookout for a stealthy purple group operation and never a typical pentesting engagement.

There are 2 identified lateral motion methods for impersonating legitimate customers or service accounts utilizing hashes — Cross The Hash and Over Cross The Hash.

Cross the Hash is the preliminary assault the place an attacker makes use of the dumped hashes to carry out a sound NTLM authentication with out accessing the cleartext passwords. Whereas Over Cross the Hash is a Kerberos-based assault that requires an attacker to make use of the obtained hashes to request a full Kerberos TGT ticket from the KDC (Kerberos Area Controller)on behalf of the compromised person. This method is commonly utilized in tandem with Cross the Ticket, during which the solid tickets are handed and reinjected many occasions till they expire to bypass communications with the KDC.

OPTH could be an impactful assault if attackers have compromised hashes with a single-sign-on choice. They might be capable to leverage the TGT requests to get service tickets to many assets throughout the community.

This publish will reveal the Over Cross the Hash method with Mimikatz and Rubeus instruments. The demonstration steps can be on the Pentester Academy Energetic Listing Lab by Nikhil Mittal related to the CRTP course.

Let’s begin 🏃 🏃

1- Administrative privileges on the compromised machine/s.

2- Hashes of legitimate customers or service accounts.

◼️ Technique #1 Mimikatz

For the demo under, we are going to use the PowerShell model of Mimikatz by PowerSploit — Invoke-Mimikatz.

1- Obtain the script from GitHub — Invoke-Mimikat.ps1

2- Open a PowerShell window as an Administrator and cargo the script into the reminiscence with the import-module cmdlet.

Import-Module .Invoke-Mimikatz.ps1

Load Mimikatz to the memory
Determine 1 — Load Mimikatz to the reminiscence

3- Name the Invoke-Mimikatz operate with the PTH flag. A brand new PowerShell window will pop up just a few seconds as the brand new handed person.

Invoke-Mimikatz -Command '"sekurlsa::pth /person:UserName /area:DomainName /ntlm:HASH /run:powershell.exe"'

Determine 2 — Carry out Over Cross the Hash with Mimikatz

🚨 It is very important remember the fact that if you happen to run whoami; hostname instructions straight into the terminal, you’ll discover that you simply get a special outcome than operating the whoami; hostname with Invoke-command.

Determine 3- exhibits the completely different between operating command domestically and remotely

The primary command returns the at present logged-on person — dcorpstudent223 on the native machine. Whereas the Invoke-Command returns the newly authenticated person by way of Kerberos, which is dcorpsvcadminon on the distant machine — dcorp-mgmt.dollarcorp.moneycorp.native

To see the Kerberos tickets generated with the OPTH, we are able to run the klist command. As seen under, the Kerberos service (krbtgt) within the (KDC) issued us a TGT ticket for the svcadmin person with ticket #0.

And with that ticket, we had been capable of request the HTTP service (TGS) with ticket #1 to run PowerShell remotely with the command Invoke-Command.

📌 PS Remoting makes use of HTTP because the protocol for transmitting instructions and outputs.

Determine 4 — exhibits the KDC granting us TGT and TGS tickets

◼️ Technique #2 Rubeus

Rubeus is one other technique to make use of for requesting TGT tickets with hashes. We’d like Visible Studio and .NET 3.5 framework put in on a Home windows machine to compile the Rubeus code into an executable. The code within the GitHub repo will not be compiled, nevertheless, the method could be very easy [compilation instructions]

1- Obtain Rubeus from GitHub [here], and unzip the venture.

2- Open the Rebeus.sln file with Visible Studio.

Determine 5 — exhibits the Rubeus venture sln file

3- Construct the venture with .NET 3.5 framework.

Determine 6 — exhibits the necessities to construct the Rubeus venture
Determine 7 — Compiling the venture in visible studio

4- Run the compiled software with the asktgt flag to ask the KDC to generate a TGT ticket for us.

.Rubeus.exe asktgt /area:dollarcorp.moneycorp.native /person:svcadmin /rc4:b38ff50264b74508085d82c69794a4d8 /ptt

Determine 8 — exhibits operating the Rubeus software

As seen under, the KDC granted us a TGT ticket, which we are able to use to request service tickets.

Determine 9 — exhibits the KDC granting us a TGT ticket
  • Analyze community logs and detect anomalies initiated from customers, beginning with monitoring Occasion IDs like 4768 for TGT requests and 4769 for service tickets with Logon sort 9.
  • Implement Person Habits Analytics (UBA) options on networked endpoints to identify malicious actions like unauthorized customers accessing assets out of the scope of their position, distant logins, putting in identified instruments like Mimikatz or Rubeus, or suspicious processes touching lsass.
  • Implement multi-factor authentication for all functions, together with the SSO-enabled ones, so as to add a further layer of safety if the hashes get compromised.

That’s all for at present; we discovered about Over Cross The Hash method and carried out it with instrument identified tools- Mimiktaz and Rubeus to generate Kerberos TGT tickets.

Thanks for studying !!

🔔 The entire used instructions could be discovered at R3d-Buck3T — (Energetic Listing — Lateral Motion — Over Cross The Hash )

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments