Path: blob/master/documentation/modules/auxiliary/admin/dcerpc/samr_account.md
24568 views
Vulnerable Application
Add, lookup and delete user / machine accounts via MS-SAMR. By default standard active directory users can add up to 10 new computers to the domain (MachineAccountQuota). Administrative privileges however are required to delete the created accounts, or to create/delete user accounts.
Verification Steps
From msfconsole
Do:
use auxiliary/admin/dcerpc/samr_accountSet the
RHOSTS,SMBUserandSMBPassoptionsSet the
ACCOUNT_NAMEoption forDELETE_ACCOUNTandLOOKUP_ACCOUNTactions
Run the module and see that a new machine account was added
Options
SMBDomain
The Windows domain to use for authentication. The domain will automatically be identified if this option is left in its default value.
ACCOUNT_NAME
The account name to add, lookup or delete. This option is optional for the ADD_COMPUTER action, and required for the ADD_USER, LOOKUP_ACCOUNT and DELETE_ACCOUNT actions. If left blank for ADD_COMPUTER, a random, realistic name will be generated.
ACCOUNT_PASSWORD
The password for the new account. This option is only used for the ADD_COMPUTER and ADD_USER actions. If left blank, a random value will be generated.
Actions
ADD_COMPUTER
Add a new computer to the domain. This action will fail with status STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED if the user has exceeded the maximum number of computer accounts that they are allowed to create.
After the computer account is created, the password will be set for it. If ACCOUNT_NAME is set, that value will be used and the module will fail if the specified name is already in use. If ACCOUNT_NAME is not set, a random value will be used.
ADD_USER
Add a new user to the domain. The account being used to create the new user must have permission to do so.
After the user account is created, the password will be set for it. The ACCOUNT_NAME option must be set to the name of the account to create. The module will fail if the specified name is already in use.
DELETE_ACCOUNT
Delete a user or computer account from the domain. This action requires that the ACCOUNT_NAME option be set.
LOOKUP_ACCOUNT
Lookup a user or computer account in the domain. This action verifies that the specified account exists, and looks up its security ID (SID), which includes the relative ID (RID) as the last component.
Scenarios
Windows Server 2019
First, a new computer account is created and its details are logged to the database.