Skip to main content

Pass the hash pth attack

 Attack synopsis: Credit: Netwrix video. Attack Tutorial: How a Pass the Hash Attack Works

1. Attacker somehow got the password hashes of one or more users on a computer network. If that compromised account has admin rights on that system then that gives the attacker to access other credentials that are stored on the system. Under the sam account database the users password hashes are stored but the file is locked when the system is running so that time it is not possible to access. But operating system still needs that data so they are stored in the memory space of lsass.exe . It can be captured using samdump, pwdump and mimikatz tool and even in offline imaging version of windows. 

C:\windows\system32\config\SAM

2. Now using mimikatz tool the attacker leverage compromised users username and password hashes to authenticate other system resources where that user has access to. 

Example:

Lets say Jsmith is a normal user account in the domain. He clicked on a phishing mail and his account got compromised. Now attacker have access on his account. But jsmith may not have any rights to access other resources on the domain. However jsmith has local admin rights on his system. Leveraging this, attacker can extract all the password ntlm hashes from the system memory. Say IT admin or domain admin some day, access jsmith computer. So their password hashes are stored already in jsmith's computer system memory. Leveraging jsmith admin rights, attacker can grab those hashes and play pass the hash attack using psexec tool and mimikatz tool. 


The user is a part of local administrator group. Not part of any other domain security group. 

In this case if you want to access your domain controller from this users pc, then you will get access denied message because steveholt does not have that access. 


Now lets see how we can elevate our privileges to access the domain controller. The above command will dump out all the password hashes stored in this system. 


Now we need to find out a domain administrator account who's account has all rights. We know Tony.WOnder is administrator in our domain environment. So copy his ntlm hash. He may log on to this system to do some work. And his password is stored on the system memory. 


 Now you just need to pass the hash of tony wonder. 

Once you give enter, a new command prompt will be spawned. 


In the spawned command prompt when you type whoami, it will still show normal user account which is steveholt. But the elevated token is running behind as part of tony wonder account. So if you use psexec.exe, this time from this shell, you will now have access domain controller with the account of tony wonder. 

Image credit: From SANS FOR508 Course.

Using this metasploit psexec, we can also achieve the same. 



Avi


 

Comments

Popular posts from this blog

Installtion of SQLMutant tool

This tool is perfectly works on ubuntu 24 system. And I found it is not working properly in kali linux 24 version.   https://github.com/blackhatethicalhacking/SQLMutant/tree/main This tool need to use along with sqlmap tool. Showing this cheat sheet for kali or debian based system.  This tool actually analyze everything and give you the vulnerable url where sql injection is possible. You just need to use then sqlmap to exploit that.   Prerequisite: apt install pipx -y (for ubuntu) pip3 install uro or pipx install uro pipx ensurepath pipx completions  (not needed)  source ~/.bashrc   or restart system If go tool is not installed then run the below two commands first ( golang-go ) or follow this link to install go (https://mahimfiroj.blogspot.com/2024/12/installing-nuclei-in-kali.html) otherwise skip this step.   dpkg -l | grep packagename (Using this command you can check package is installed or not) apt install gccgo-go -y or apt install gol...

Install Nessus from docker

Docker installation. Give the below commands one by one. apt install docker-cli or apt install docker.io After the installation is complete, if you are inside wsl then give this command to start docker, because inside wsl systemd (systemctl) does not work: service docker start WSL troubleshooting : If the above command " service docker start " does not work then use below command: dockerd (It may not work if any previous docker process is running. It will show you pid of that process. Use this command to kill that process " kill -9 pid " and run dockerd command again) If " docker ps -a " giving error like " Cannot connect to the Docker daemon at unix:///run/podman/podman.sock. Is the docker daemon running? " This is because you may installed podman-docker package. If you remove the package still you will get this error but you should remove the package. Then issue this command: env | grep -i docker DOCKER_HOST=unix:///run/podman/podman.sock   --...

WSL - windows subsystem for linux

  1. From the start menu, type "Turn Windows features on or off". Check the box, Virtual Machine Platform and Windows Subsystem for Linux or in the command prompt simply give this command: wsl.exe --install --no-distribution Now Restart the system.  If wsl is already installed, then give this command: wsl.exe --update 2. Now from Microsoft store download kali linux and install it. Or you can give this command to see list of distributions. Then install based on your choice.  To see list of distributions: wsl.exe --list --online To install: wsl.exe --install --distribution <Distro Name> i.e.  wsl --install --distribution kali-linux 3. Now it will ask for username and password, say at the time of installing kali-linux here. Provide that.  4. Once it is installed, it has come with very minimum package installation.  Run the following commands to install all packages: sudo apt update sudo apt full-upgrade -y sudo apt install -y kali-linux-default (This re...