VHL005 - Own the Workstations, Local Admin Password Re-use
From the last attack that we accomplished; we were able to gain a user’s credentials. This opens more attacks for us to attempt on the network. The first that I’m going to attempt is an attack dumping the SAM and LSA Secrets files to get the accounts associated with the workstation and possibly search for local admin password re-use. The program that we will be doing this with is secretsdump.py in the impacket’s repository. This is a large repository of applications that are great for attacks against an Active Directory environment. You can access the repository from this link.
In your kali, type in “git clone https://github.com/fortra/impacket” and this will download the impacket’s repository with all the applications in it.
For this attack, turn on all the workstations and the domain
controller. Confirm that you can communicate with each of the machines before
stating.
Again, we got the credentials of the user 'rhagrid' from the last attack using Responder. We can check where these credentials are valid with a run of crackmapexec. This program will throw the credentials around the network attempting to authenticate with the different machines it finds. If these users has some level of administrator on a machine, this will tell us.
As we can see, the machine HAGRID-WS on 192.168.1.159 came back as "Pwn3d!".
We can now run the secretsdump.py program mentioned before
to grab the accounts that are inside the SAM and Secrets files on the machine.
When this is run, it will dump the local SAM hashes and the LSA Secrets files revealing hashes saved on the machine. One
of the hashes that will be uncovered by this is the local administrators hash.
We are going to take this hash and attempt to crack it and in hopes to find
local admin password reuse.
We were able to easily crack this hash revealing the
password of “Qwerty1!”.
We can now take this hash and do a crackmapexec with these new credentials. Differing from the original command, we do not put in the domain
and instead place the “--local-auth” in the command specifying that we are
targeting the local administrator.
When run, we can see that each of the workstations running use the same local administrator password effectively allowing us to own every device on the network outside of the domain controller.
Even if we were unable to crack the local admin’s password, this attack could have been done with their hash.
Mitigations
These attacks revolve around the miss use of passwords. These
local administrators should not have the same password as each other. We were
able to take one users credentials and turn it into complete control over
each of the workstations in the network. These local admin passwords should be unique to the machines and not have a pattern that is repeatable if one is cracked.