FRONTMATTER_149_# Impacket Toolkit Foglio di formaggio¶
Panoramica¶
Impacket è una raccolta di classi Python per lavorare con i protocolli di rete. Fornisce accesso programmatico a basso livello ai pacchetti e implementa diversi protocolli tra cui SMB, MSRPC e Kerberos. Impacket include numerosi strumenti pronti all'uso per il test di penetrazione, particolarmente focalizzati sugli ambienti Windows.
Warning: Impacket è uno strumento di prova di sicurezza che dovrebbe essere utilizzato solo in ambienti in cui si ha il permesso esplicito di farlo.
Installazione¶
From PyPI¶
Traduzione:
Da GitHub¶
Traduzione:
On Kali Linux¶
Traduzione:
Utilizzo dell'ambiente virtuale¶
Traduzione:
Strumenti di esecuzione di comando¶
psexec.py¶
Esegui i comandi su sistemi Windows remoti utilizzando il protocollo SMB, simile a PsExec di SysInternals.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_32 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_33 | Use Kerberos authentication |
| INLINE_CODE_34 | Don't ask for password (useful for Kerberos) |
| INLINE_CODE_35 | Connect to SMB Server port (default: 445) |
| INLINE_CODE_36 | Turn DEBUG output ON |
Esempi¶
Traduzione:
smbexec. P¶
Simile a psexec.py ma utilizza tecniche diverse per eseguire comandi, rendendolo potenzialmente più stealthier.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_37 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_38 | Share where the output will be grabbed from (default: ADMIN$) |
| INLINE_CODE_39 | Shell type to use (default: cmd) |
| INLINE_CODE_40 | Sets encoding used (codec) from the target's output (default: UTF-8) |
| INLINE_CODE_41 | Service name to use (default: random) |
Esempi¶
Traduzione:
wmiexec. P¶
Esegui i comandi su sistemi Windows remoti utilizzando WMI.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_42 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_43 | Share where the output will be grabbed from (default: ADMIN$) |
| INLINE_CODE_44 | Execute command and return immediately without output |
| INLINE_CODE_45 | Sets encoding used (codec) from the target's output (default: UTF-8) |
| INLINE_CODE_46 | Shell type to use (default: cmd) |
Esempi¶
Traduzione:
dcomexec. P¶
Esegui i comandi su sistemi Windows remoti utilizzando oggetti DCOM.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_47 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_48 | DCOM object to use (default: MMC20.Application) |
| INLINE_CODE_49 | Execute command and return immediately without output |
| INLINE_CODE_50 | Sets encoding used (codec) from the target's output (default: UTF-8) |
| INLINE_CODE_51 | Shell type to use (default: cmd) |
Esempi¶
Traduzione:
atexec.py¶
Esegui i comandi su sistemi Windows remoti utilizzando il servizio Task Scheduler.
Uso di base¶
¶
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_52 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_53 | Execute command and return immediately without output |
| INLINE_CODE_54 | Sets encoding used (codec) from the target's output (default: UTF-8) |
Esempi¶
Traduzione:
Credential Dumping Tools¶
secretsdump. # P¶
Estrae le credenziali da un sistema Windows remoto, tra cui SAM, LSA Secrets e NTDS.dit.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_55 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_56 | Extract only NTDS.DIT data (domain controller only) |
| INLINE_CODE_57 | Extract only NTDS.DIT NTLM hashes (domain controller only) |
| INLINE_CODE_58 | Extract only NTDS.DIT data for specific user |
| INLINE_CODE_59 | Shows pwdLastSet attribute for each NTDS.DIT account |
| INLINE_CODE_60 | Shows whether the user is enabled or disabled |
| INLINE_CODE_61 | Dump password history |
| INLINE_CODE_62 | Write output to file |
Esempi¶
Traduzione:
Strumenti di attacco Kerberos¶
OttenereNPUsers.py¶
Recupera le password di hash per gli utenti con "Non richiede Kerberos preauthentication" set (attacco ASREPRoast).
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_63 | Requests TGT for users and output them in JtR/hashcat format |
| INLINE_CODE_64 | Don't ask for password (useful for Kerberos) |
| INLINE_CODE_65 | Use Kerberos authentication |
| INLINE_CODE_66 | IP Address of the domain controller |
| INLINE_CODE_67 | File with user per line to test |
| INLINE_CODE_68 | Format to save the AS_REP responses (default: hashcat) |
| INLINE_CODE_69 | Output filename to write ciphers in JtR/hashcat format |
Esempi¶
Traduzione:
GetUserSPNs.py¶
Recupera i nomi principali del servizio (SPN) per i conti nel dominio (attacco di Kerberoasting).
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_70 | Requests TGS for users and output them in JtR/hashcat format |
| INLINE_CODE_71 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_72 | IP Address of the domain controller |
| INLINE_CODE_73 | Target specific user to request TGS for |
| INLINE_CODE_74 | Output filename to write ciphers in JtR/hashcat format |
| INLINE_CODE_75 | Format to save the TGS tickets (default: hashcat) |
Esempi¶
Traduzione:
Ticketer. P¶
Crea biglietti d'oro e d'argento per l'autenticazione Kerberos.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_76 | NT hash for the user or service account |
| INLINE_CODE_77 | AES key for the user or service account |
| INLINE_CODE_78 | Domain name |
| INLINE_CODE_79 | Domain SID |
| INLINE_CODE_80 | Service Principal Name (for Silver Tickets) |
| INLINE_CODE_81 | Comma-separated list of group IDs to include in the ticket |
| INLINE_CODE_82 | Ticket duration in hours (default: 10) |
| INLINE_CODE_83 | Output filename to save the ticket |
Esempi¶
Traduzione:
Strumenti di Network Protocols¶
smbclient. P¶
Fornisce un client SMB per accedere a azioni e file su sistemi remoti.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_84 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_85 | Connect to SMB Server port (default: 445) |
| INLINE_CODE_86 | Input file with commands to execute in the mini shell |
| INLINE_CODE_87 | Turn DEBUG output ON |
| _ | |
| #### Comandi comuni (Interactive Shell)__TABLE_160_ | |
| #### Esempi | |
| Traduzione: |
mssqlclient. P¶
Fornisce un client per interagire con le istanze di Microsoft SQL Server.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_99 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_100 | Use Windows Authentication (default: False) |
| INLINE_CODE_101 | Destination port to connect to (default: 1433) |
| INLINE_CODE_102 | MSSQL database instance (default: None) |
| INLINE_CODE_103 | Input file with commands to execute in the SQL shell |
| INLINE_CODE_104 | Turn DEBUG output ON |
Comandi comuni (Interactive Shell)¶
| Command | Description |
|---|---|
| INLINE_CODE_105 | Show available commands |
| INLINE_CODE_106 | Enable the xp_cmdshell stored procedure |
| INLINE_CODE_107 | Disable the xp_cmdshell stored procedure |
| INLINE_CODE_108 | Execute command through xp_cmdshell |
| INLINE_CODE_109 | Start a SQL Server job |
| INLINE_CODE_110 | Exit the shell |
Esempi¶
Traduzione:
Altri strumenti utili¶
ntlmrelayx. P¶
Esecuzioni NTLM Attacchi di relè.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_111 | Target to relay the credentials to |
| INLINE_CODE_112 | File with targets to relay the credentials to |
| INLINE_CODE_113 | Start the HTTP server and do not relay credentials |
| INLINE_CODE_114 | Execute this file when a connection is relayed |
| INLINE_CODE_115 | Execute this command when a connection is relayed |
| INLINE_CODE_116 | Enable SMB2 support |
| INLINE_CODE_117 | Launch a SOCKS proxy for the connection |
| INLINE_CODE_118 | Relay only one connection |
| INLINE_CODE_119 | Turn DEBUG output ON |
Esempi¶
Traduzione:
lookupsid. # P¶
Esegui ricerche SID per coinvolgere utenti e gruppi.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_120 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_121 | Domain to enumerate (default: target domain) |
| INLINE_CODE_122 | Turn DEBUG output ON |
Esempi¶
Traduzione:
reg.py¶
Fornisce uno strumento di manipolazione del registro remoto.
Uso di base¶
Traduzione:
Opzioni comuni¶
| Option | Description |
|---|---|
| INLINE_CODE_123 | Use NTLM hashes instead of password (Pass-the-Hash) |
| INLINE_CODE_124 | Turn DEBUG output ON |
Azioni_Tabella_166__¶
Esempi¶
Traduzione:
Parametri comuni tra gli strumenti¶
Tabella_167_