This script executes the Kerbrute command to enumerate valid usernames in an Active Directory environment. While the command is running, an ASCII art is displayed. After the command completes, the valid usernames are saved to a specified file.
- Unix-based operating system (Linux, macOS, etc.)
- Kerbrute tool installed and configured
- Bash shell
-
Save the script to a file, e.g.,
KerbruteUserenumWordlist.sh
. -
Grant execute permissions to the script:
chmod +x KerbruteUserenumWordlist.sh
The script requires two arguments:
- The Kerbrute command to execute.
- The path to the output file where valid usernames will be saved.
- An optional
--emails
flag to indicate if full email addresses should be saved instead of just usernames.
./KerbruteUserenumWordlist.sh "kerbrute userenum -d inlanefreight.local --dc 172.16.5.5 /usr/share/seclists/Usernames/top-usernames-shortlist.txt" valid_usernames.txt
./KerbruteUserenumWordlist.sh "kerbrute userenum -d inlanefreight.local --dc 172.16.5.5 /usr/share/seclists/Usernames/top-usernames-shortlist.txt" valid_usernames.txt --emails