Skip to content

Commit a27456a

Browse files
committed
Add commands
1 parent bf6c70a commit a27456a

25 files changed

Lines changed: 1494 additions & 0 deletions
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# TLDR
2+
3+
**Enumerate all domain users** with their details
4+
5+
```impacket-getadusers -all '[domain]/[user]:[password]'```
6+
7+
**Query users** specifying the domain controller IP
8+
9+
```impacket-getadusers -all -dc-ip [192.168.1.100] '[domain]/[user]:[password]'```
10+
11+
**Get users using NTLM hash** authentication
12+
13+
```impacket-getadusers -all -hashes ':[nthash]' '[domain]/[user]'```
14+
15+
**Enumerate users via Kerberos** authentication
16+
17+
```impacket-getadusers -all -k -no-pass '[domain]/[user]'```
18+
19+
**Output user information** in a specific format
20+
21+
```impacket-getadusers -all -dc-ip [192.168.1.100] '[domain]/[user]:[password]' 2>/dev/null```
22+
23+
# SYNOPSIS
24+
25+
**impacket-getadusers** [_-h_] [_-user USERNAME_] [_-all_] [_-dc-ip IP_] [_-dc-host HOSTNAME_] [_-hashes LMHASH:NTHASH_] [_-no-pass_] [_-k_] [_-aesKey KEY_] _target_
26+
27+
# PARAMETERS
28+
29+
**-all**
30+
> Return all users in the domain
31+
32+
**-user** _USERNAME_
33+
> Query information for a specific user only
34+
35+
**-dc-ip** _IP_
36+
> IP address of the domain controller
37+
38+
**-dc-host** _HOSTNAME_
39+
> Hostname of the domain controller (used for Kerberos)
40+
41+
**-hashes** _LMHASH:NTHASH_
42+
> Use NTLM hashes for authentication instead of password
43+
44+
**-no-pass**
45+
> Don't ask for password (useful with -k or -hashes)
46+
47+
**-k**
48+
> Use Kerberos authentication from ccache file
49+
50+
**-aesKey** _KEY_
51+
> AES key to use for Kerberos authentication
52+
53+
# DESCRIPTION
54+
55+
**impacket-getadusers** queries Active Directory via LDAP to enumerate user accounts and their attributes. It retrieves information such as usernames, last logon times, password last set dates, and account status flags.
56+
57+
The tool is useful for reconnaissance during penetration tests to identify potential targets, find accounts with old passwords, or discover service accounts. Output includes the SAM account name, badPwdCount, and other relevant security attributes.
58+
59+
# CAVEATS
60+
61+
Requires valid domain credentials. Output may be verbose; consider redirecting stderr to /dev/null for cleaner output. The -all flag is typically required to see results for more than just the authenticated user.
62+
63+
# HISTORY
64+
65+
Part of the **Impacket** library developed by SecureAuth. The tool leverages LDAP queries against Active Directory, implementing Microsoft's directory service protocols in Python for cross-platform compatibility.
66+
67+
# SEE ALSO
68+
69+
[impacket-addcomputer](/man/impacket-addcomputer)(1), [impacket-secretsdump](/man/impacket-secretsdump)(1), [ldapsearch](/man/ldapsearch)(1), [net](/man/net)(1)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# TLDR
2+
3+
**Detect the architecture** of a remote Windows system
4+
5+
```impacket-getarch -target [192.168.1.100]```
6+
7+
**Check architecture** of multiple targets from a file
8+
9+
```impacket-getarch -targets [targets.txt]```
10+
11+
**Detect architecture** specifying a port
12+
13+
```impacket-getarch -target [192.168.1.100] -port [445]```
14+
15+
# SYNOPSIS
16+
17+
**impacket-getarch** [_-h_] [_-target IP_] [_-targets FILE_] [_-port PORT_]
18+
19+
# PARAMETERS
20+
21+
**-target** _IP_
22+
> IP address of the target system to probe
23+
24+
**-targets** _FILE_
25+
> File containing a list of target IP addresses (one per line)
26+
27+
**-port** _PORT_
28+
> Port to connect to (default: 445)
29+
30+
# DESCRIPTION
31+
32+
**impacket-getarch** is a reconnaissance tool that determines whether a remote Windows system is running a 32-bit or 64-bit operating system. It works by connecting to the target's SMB service and analyzing the response to identify the system architecture.
33+
34+
This information is valuable during penetration testing when preparing architecture-specific payloads or exploits. The tool requires no authentication and works against systems with SMB exposed.
35+
36+
# CAVEATS
37+
38+
Requires network access to the target's SMB port (typically 445). Results depend on SMB being accessible and not blocked by firewalls. Does not work against non-Windows systems.
39+
40+
# HISTORY
41+
42+
Part of the **Impacket** library by SecureAuth. The tool exploits differences in how 32-bit and 64-bit Windows systems respond to certain SMB requests to fingerprint the architecture without authentication.
43+
44+
# SEE ALSO
45+
46+
[impacket-getadusers](/man/impacket-getadusers)(1), [nmap](/man/nmap)(1), [smbclient](/man/smbclient)(1)

assets/commands/impacket-gettgt.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# TLDR
2+
3+
**Request a TGT** for a domain user with password
4+
5+
```impacket-gettgt '[domain]/[user]:[password]'```
6+
7+
**Request TGT** and save to a specific file
8+
9+
```impacket-gettgt -dc-ip [192.168.1.100] '[domain]/[user]:[password]'```
10+
11+
**Request TGT using NTLM hash**
12+
13+
```impacket-gettgt -hashes ':[nthash]' '[domain]/[user]'```
14+
15+
**Request TGT using AES key**
16+
17+
```impacket-gettgt -aesKey '[aes256key]' '[domain]/[user]'```
18+
19+
# SYNOPSIS
20+
21+
**impacket-gettgt** [_-h_] [_-dc-ip IP_] [_-hashes LMHASH:NTHASH_] [_-aesKey KEY_] _target_
22+
23+
# PARAMETERS
24+
25+
**-dc-ip** _IP_
26+
> IP address of the domain controller (KDC)
27+
28+
**-hashes** _LMHASH:NTHASH_
29+
> Use NTLM hashes for authentication instead of password
30+
31+
**-aesKey** _KEY_
32+
> AES key to use for Kerberos authentication (128 or 256 bit)
33+
34+
# DESCRIPTION
35+
36+
**impacket-gettgt** requests a Kerberos Ticket Granting Ticket (TGT) from an Active Directory domain controller. The TGT is saved to a ccache file that can be used for subsequent Kerberos authentication with other tools.
37+
38+
This tool is useful for obtaining Kerberos tickets when you have valid credentials (password, hash, or AES key) and need to authenticate to Kerberos-enabled services. The resulting ccache file can be exported via the KRB5CCNAME environment variable.
39+
40+
# CAVEATS
41+
42+
Requires valid domain credentials in some form (password, NTLM hash, or AES key). The domain controller must be reachable and Kerberos ports (88/tcp) must be accessible. Time synchronization between client and KDC is critical for Kerberos to function.
43+
44+
# HISTORY
45+
46+
Part of the **Impacket** library by SecureAuth, implementing the Kerberos protocol for penetration testing. TGT retrieval is a fundamental operation in Kerberos-based attacks and authentication workflows.
47+
48+
# SEE ALSO
49+
50+
[impacket-getst](/man/impacket-getst)(1), [kinit](/man/kinit)(1), [klist](/man/klist)(1), [impacket-secretsdump](/man/impacket-secretsdump)(1)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# TLDR
2+
3+
**Check MQTT broker** for anonymous access
4+
5+
```impacket-mqtt_check [192.168.1.100]```
6+
7+
**Check MQTT on a specific port**
8+
9+
```impacket-mqtt_check [192.168.1.100] -port [1883]```
10+
11+
**Check MQTT with credentials**
12+
13+
```impacket-mqtt_check [192.168.1.100] -user [username] -password [password]```
14+
15+
# SYNOPSIS
16+
17+
**impacket-mqtt_check** [_-h_] [_-port PORT_] [_-user USERNAME_] [_-password PASSWORD_] _target_
18+
19+
# PARAMETERS
20+
21+
**-port** _PORT_
22+
> MQTT broker port (default: 1883)
23+
24+
**-user** _USERNAME_
25+
> Username for MQTT authentication
26+
27+
**-password** _PASSWORD_
28+
> Password for MQTT authentication
29+
30+
# DESCRIPTION
31+
32+
**impacket-mqtt_check** is a simple tool that checks if an MQTT (Message Queuing Telemetry Transport) broker allows connections, optionally testing for anonymous access. MQTT is a lightweight messaging protocol commonly used in IoT devices and applications.
33+
34+
The tool attempts to connect to the specified broker and reports whether the connection succeeds, helping identify misconfigured brokers that allow unauthenticated access.
35+
36+
# CAVEATS
37+
38+
Only tests connection capability, does not enumerate topics or messages. MQTT over TLS (port 8883) may require additional configuration. Some brokers may allow connection but restrict actions based on ACLs.
39+
40+
# HISTORY
41+
42+
Part of the **Impacket** library by SecureAuth. Added to address the growing security concerns around IoT protocols, particularly MQTT brokers exposed to the internet without proper authentication.
43+
44+
# SEE ALSO
45+
46+
[mosquitto_sub](/man/mosquitto_sub)(1), [mosquitto_pub](/man/mosquitto_pub)(1), [nmap](/man/nmap)(1)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# TLDR
2+
3+
**Read a file from a remote NTFS share**
4+
5+
```impacket-ntfs-read '[domain]/[user]:[password]@[192.168.1.100]' '[C$\Windows\System32\config\SAM]'```
6+
7+
**Read file using NTLM hash** authentication
8+
9+
```impacket-ntfs-read -hashes ':[nthash]' '[domain]/[user]@[192.168.1.100]' '[share\path\to\file]'```
10+
11+
**Read file using Kerberos** authentication
12+
13+
```impacket-ntfs-read -k -no-pass '[domain]/[user]@[target]' '[C$\path\to\file]'```
14+
15+
# SYNOPSIS
16+
17+
**impacket-ntfs-read** [_-h_] [_-hashes LMHASH:NTHASH_] [_-no-pass_] [_-k_] [_-aesKey KEY_] [_-dc-ip IP_] _target_ _path_
18+
19+
# PARAMETERS
20+
21+
**-hashes** _LMHASH:NTHASH_
22+
> Use NTLM hashes for authentication instead of password
23+
24+
**-no-pass**
25+
> Don't ask for password (useful with -k)
26+
27+
**-k**
28+
> Use Kerberos authentication from ccache file
29+
30+
**-aesKey** _KEY_
31+
> AES key to use for Kerberos authentication
32+
33+
**-dc-ip** _IP_
34+
> IP address of the domain controller (for Kerberos)
35+
36+
# DESCRIPTION
37+
38+
**impacket-ntfs-read** reads files from remote Windows systems via SMB by directly parsing the NTFS file system structures. This allows reading files that might be locked by the operating system, such as registry hives or other system files.
39+
40+
The tool connects to administrative shares (C$, ADMIN$) and reads files at the raw NTFS level, bypassing Windows file locking mechanisms. This is particularly useful for extracting sensitive files during penetration tests.
41+
42+
# CAVEATS
43+
44+
Requires administrative access to the target system (access to C$ or ADMIN$ shares). Some files may still be inaccessible due to NTFS permissions. The path should use backslashes and reference the share name.
45+
46+
# HISTORY
47+
48+
Part of the **Impacket** library by SecureAuth. The tool implements NTFS parsing over SMB to enable reading locked files, a technique commonly used in credential extraction workflows.
49+
50+
# SEE ALSO
51+
52+
[impacket-secretsdump](/man/impacket-secretsdump)(1), [smbclient](/man/smbclient)(1), [impacket-smbclient](/man/impacket-smbclient)(1)

assets/commands/impacket-ping.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# TLDR
2+
3+
**Send ICMP echo requests** to a target
4+
5+
```impacket-ping [192.168.1.100]```
6+
7+
**Ping with a specific source IP**
8+
9+
```impacket-ping -src [192.168.1.50] [192.168.1.100]```
10+
11+
# SYNOPSIS
12+
13+
**impacket-ping** [_-h_] [_-src IP_] _target_
14+
15+
# PARAMETERS
16+
17+
**-src** _IP_
18+
> Source IP address to use for the ping packets
19+
20+
# DESCRIPTION
21+
22+
**impacket-ping** is a simple ICMP ping implementation using raw sockets via the Impacket library. It sends ICMP echo request packets to the specified target and reports responses.
23+
24+
Unlike the standard ping utility, this implementation uses Impacket's raw socket capabilities, which can be useful in environments where the standard ping may be restricted or when integration with other Impacket tools is desired.
25+
26+
# CAVEATS
27+
28+
Requires root/administrator privileges to create raw sockets. May be blocked by firewalls that filter ICMP traffic. For most use cases, the standard **ping** command is more feature-rich.
29+
30+
# HISTORY
31+
32+
Part of the **Impacket** library by SecureAuth. Included as a basic example of using Impacket's network protocol implementations for raw socket operations.
33+
34+
# SEE ALSO
35+
36+
[ping](/man/ping)(1), [impacket-ping6](/man/impacket-ping6)(1), [nmap](/man/nmap)(1)

0 commit comments

Comments
 (0)