Summery

rpcclient is a Samba tool for interacting with Windows SMB/RPC services. It can query information from interfaces such as SAMR, LSA, and SRVSVC, making it useful for Windows/Active Directory enumeration.

Commands

Authentication
rpcclient <IP> -U "" -N - Anonymous connection
rpcclient <IP> -U '<USER>%<PASSWORD>' - Authorized connection

General enumeration
querydominfo - Show domain information
getdompwinfo - Get domain password-policy information
enumdomusers - Enumerate domain users
querydispinfo - Display user information in bulk
queryuser <username/RID> - Query information about one user

Privileges
enumprivs - Enumerate privileges available on the server
lsaenumacctrights - Enumerate rights assigned to an account.
lsaaddpriv - Attempt to assign a privilege to an account.
lsadelpriv - Remove a privilege.
lsaaddacctrights - Add account rights.
lsaremoveacctrights - Remove account rights.

Account creation
createdomuser hacker - Create a user object
setuserinfo2 hacker 24 Password@1 - Set user information; level 24 sets the password
enumdomusers - Verify the the new user appears

Password change
chgpasswd <USERNAME> Password@1 Password@2 - Change users password

Shares
netshareenum - Enumerate shares
netshareenumall - Enumerate all available shares
netsharegetinfo Confidential - Get information about the Confidential share

References

Great, general rpcclient resource - https://www.hackingarticles.in/active-directory-enumeration-rpcclient/


user:[Guest] rid:[0x1f5]
user:[krbtgt] rid:[0x1f6]
user:[michael] rid:[0x44f]
user:[ryan] rid:[0x45a]
user:[oscar] rid:[0x45c]
user:[sql_svc] rid:[0x462]
user:[rose] rid:[0x641]
user:[ca_svc] rid:[0x647]