|
| 1 | +# TLDR |
| 2 | + |
| 3 | +**Add a computer account** to the domain using default credentials |
| 4 | + |
| 5 | +```impacket-addcomputer -computer-name '[NEWPC$]' -computer-pass '[Password123]' '[domain]/[user]:[password]'``` |
| 6 | + |
| 7 | +**Add a computer account** specifying the domain controller IP |
| 8 | + |
| 9 | +```impacket-addcomputer -computer-name '[NEWPC$]' -dc-ip [192.168.1.100] '[domain]/[user]:[password]'``` |
| 10 | + |
| 11 | +**Add a computer** using LDAPS (secure connection) |
| 12 | + |
| 13 | +```impacket-addcomputer -computer-name '[NEWPC$]' -use-ldaps '[domain]/[user]:[password]'``` |
| 14 | + |
| 15 | +**Add a computer** using Kerberos authentication with a ticket |
| 16 | + |
| 17 | +```impacket-addcomputer -computer-name '[NEWPC$]' -k -no-pass '[domain]/[user]'``` |
| 18 | + |
| 19 | +**Delete a computer account** from the domain |
| 20 | + |
| 21 | +```impacket-addcomputer -computer-name '[TARGETPC$]' -delete '[domain]/[user]:[password]'``` |
| 22 | + |
| 23 | +# SYNOPSIS |
| 24 | + |
| 25 | +**impacket-addcomputer** [_-h_] [_-computer-name NAME_] [_-computer-pass PASSWORD_] [_-no-add_] [_-delete_] [_-dc-ip IP_] [_-dc-host HOSTNAME_] [_-use-ldaps_] [_-hashes LMHASH:NTHASH_] [_-no-pass_] [_-k_] [_-aesKey KEY_] _target_ |
| 26 | + |
| 27 | +# PARAMETERS |
| 28 | + |
| 29 | +**-computer-name** _NAME_ |
| 30 | +> Name of the computer account to add (should end with $) |
| 31 | +
|
| 32 | +**-computer-pass** _PASSWORD_ |
| 33 | +> Password for the new computer account |
| 34 | +
|
| 35 | +**-delete** |
| 36 | +> Delete the specified computer account instead of adding |
| 37 | +
|
| 38 | +**-no-add** |
| 39 | +> Don't add a computer, only set its password (requires existing account) |
| 40 | +
|
| 41 | +**-dc-ip** _IP_ |
| 42 | +> IP address of the domain controller |
| 43 | +
|
| 44 | +**-dc-host** _HOSTNAME_ |
| 45 | +> Hostname of the domain controller |
| 46 | +
|
| 47 | +**-use-ldaps** |
| 48 | +> Use LDAPS instead of LDAP |
| 49 | +
|
| 50 | +**-hashes** _LMHASH:NTHASH_ |
| 51 | +> Use NTLM hashes for authentication instead of password |
| 52 | +
|
| 53 | +**-no-pass** |
| 54 | +> Don't ask for password (useful with -k) |
| 55 | +
|
| 56 | +**-k** |
| 57 | +> Use Kerberos authentication from ccache file |
| 58 | +
|
| 59 | +**-aesKey** _KEY_ |
| 60 | +> AES key to use for Kerberos authentication |
| 61 | +
|
| 62 | +# DESCRIPTION |
| 63 | + |
| 64 | +**impacket-addcomputer** is a tool from the Impacket library that allows adding or removing computer accounts in an Active Directory domain. By default, domain users can add up to 10 computer accounts (controlled by the ms-DS-MachineAccountQuota attribute), making this useful for penetration testing scenarios. |
| 65 | + |
| 66 | +The tool communicates with the domain controller via LDAP or SAMR protocols to create machine accounts. Created computer accounts can then be used for various attack techniques including resource-based constrained delegation attacks. |
| 67 | + |
| 68 | +# CAVEATS |
| 69 | + |
| 70 | +Requires valid domain credentials with permissions to create computer accounts. The default ms-DS-MachineAccountQuota may be set to 0 in hardened environments. Computer names should follow NetBIOS naming conventions and typically end with a dollar sign ($). |
| 71 | + |
| 72 | +# HISTORY |
| 73 | + |
| 74 | +Impacket was created by **SecureAuth** (formerly Core Security) as a collection of Python classes for working with network protocols. The addcomputer script was added to support Active Directory penetration testing workflows, particularly after research into resource-based constrained delegation attacks became prominent around **2018-2019**. |
| 75 | + |
| 76 | +# SEE ALSO |
| 77 | + |
| 78 | +[impacket-getadusers](/man/impacket-getadusers)(1), [impacket-secretsdump](/man/impacket-secretsdump)(1), [ldapsearch](/man/ldapsearch)(1), [net](/man/net)(1) |
0 commit comments