Password Spraying
People don't always choose strong passwords, neither do IT people for temporary accounts. Spraying passwords against all found user accounts is effective for getting access to the domain.
Configuring
Prerequisite
pageUsername EnumerationConfiguring
To implement the attack we need to set a weak password for some of the users we created and enumerated in the previous step. The easiest way is by using the
net user
command in the terminal. To change the password forjohn
toWelcome2022!
andchris
toSummer2022!
execute the following commands onDC02
:
Attacking
How it works
Password spraying is a type of brute force attack. An attacker will try a default password against a list of usernames. For example, an attacker uses the password Welcome2022!
against many different accounts to avoid account lockout that would normally occur when brute-forcing a single account with many passwords.
A old habit what a lot of companies enforce is the requirement to change passwords every 30, 60 or 90 days. Which results in people changing their password often, forgetting it and eventually choosing a easy guessable password. Another habbit is adding a increment to the same password or using months/seasons. Which means we can easily create a password list of common passwords and things people would choose using following formats:
season+year+! (Summer2022!)
month+year+! (March2022!)
companyname+year+! (Amsterdambank2022!)
city+! (Amsterdam!)
etc.
Tools
Executing the attack
Spraying a single password
To spray a single password from our kali machine we will use kerbrute again. But this time we will use the passwordspray functionality. We will spray the password Welcome2022!
against all the users we enumerated earlier.
It is recommended to not spray more then one password every 30 minutes to prevent locking out accounts. We don't have access to the domain yet and can't retrieve the current passwordpolicy.
Spraying a small list of passwords
To spray a list of passwords we can use Spray. First create a
passwords.txt
file and copy the following passwords:
2. Since we don't want to lock any accounts we will try one password every 31 minutes by using the following command:
For demonstration purposed we used 1 minute in the screenshot.
Defending
Recommendations
Implement a strong password policy:
Detection
References
Last updated