Skip to main content

pass the hash attack, detection and mitigation

Pass the hash (lateral movement)

pass the hash is a technique that enables an attacker using mimikatz tool to capture ntlm or lanman password hash of user from memory. successful attack allow the attacker to access directory or resources that the compromised user has authorize to access. 

how this attack works:

1. attacker first compromise a system or without taking consent of the user, attacker access that system and if that account has admin rights then leveraging that right attacker can use mimikatz to dump out all other ntlm password hashes from memory. or they can also compromise AD and take the ntds.dit file to capture hash from that file. 

2. using mimikatz tool they can embed the hash on the local token and starts moving through out the network laterally. it will not give attacker high level access on the target system. but if the compromised user account hash is authorized to high level access then attacker also will get the same. it depends based on the permission.


 you can see that steveholt is the user in this system and he is only has local admin rights as he belongs to local administrators group. he does not have domain admin rights. so he cannot access domain controller at any aspects. as he has local admin access so what we can do is launch mimikatz to dump out all the password hashes that is stored in memory in a search of if any domain admin ever access this system or not. if yes then we can find his hash and merged that with our token using mimikatz to elevate our privilege on our desired target system. 

after executing this command we found that there is an administrator in my domain who logged in my system for do some work someday. so copy his ntlm hash. 

after launching this command an elevated command prompt will appear. if you type whoami then it still tells you, you are steveholt but actually the command prompt has been appear by taking the token privilege of user Tony.Wonder.

now access the DC, you shall get access. 


 


Avi

 

 

Comments

Popular posts from this blog

Install Nessus from docker

The below two commands you need to run first one by one:  docker run -itd --name=ramisec_nessus -p 8834:8834 ramisec/nessus docker exec -it ramisec_nessus /bin/bash /nessus/update.sh Username: admin And you need to change the password: #Enter the command line of the docker container docker exec -it ramisec_nessus bash #Execute the following commands in sequence # Enter this directory cd /opt/nessus/sbin # List logged in users ./nessuscli lsuser # Modify the password of the specified user (take admin as an example) ./nessuscli chpasswd admin After access to the nessus, make sure you turn off the automatic updates otherwise crack will not work after some time. Before any scan you need to run the update.sh command (shown above) to have the latest plugins. Now everytime your system reboots, your docker instance will be shutdown. You need to up it again manually. Here are the commands.  1. docker ps -a    Now note down the container id. 2. docker start <container id> C

net command cheat sheet

  To see what users present in the system: net user To see local groups in the system: net localgroup To see domain groups. This should be run on a domain controller: net group To see the details of a user along with his/her group membership: net user mahim To see who are the members of a particular group (local machine): net localgroup "administrators"    (These are not case sensitive. You can use administrators or Administrators. Both will give you same result. To see who are the members of a particular group (domain machine): net group "domain admins" Create a local user: net user localuser1 MyP@ssw0rd /add Create a domain user: net user domainuser1 MyP@ssw0rd /add /domain Add the local user to local admin group: net localgroup Administrators localuser1 /add Add the user to domain admin group: net group "Domain Admins" domainuser1 /add /domain Avi