Impacket Toolkit Foglio di formaggio¶
Traduzione: Copia tutti i comandi
Traduzione: Generare PDF
< >
## 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
### Da PyPI
Traduzione:
### Da GitHub
Traduzione:
### Su Kali Linux
Traduzione:
### Utilizzo dell'ambiente virtuale
Traduzione:
## Strumenti di esecuzione dei comandi
### 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|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-k`|Use Kerberos authentication|
|`-no-pass`|Don't ask for password (useful for Kerberos)|
|`-port [port]`|Connect to SMB Server port (default: 445)|
|`-debug`|Turn DEBUG output ON|
#### Esempi
Traduzione:
### smbexec.py
Simile a psexec.py ma utilizza tecniche diverse per eseguire comandi, rendendolo potenzialmente più stealthier.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-share SHARE`|Share where the output will be grabbed from (default: ADMIN$)|
|`-shell-type \\{cmd,powershell\\}`|Shell type to use (default: cmd)|
|`-codec CODEC`|Sets encoding used (codec) from the target's output (default: UTF-8)|
|`-service-name NAME`|Service name to use (default: random)|
#### Esempi
Traduzione:
### wmiexec.py
Esegui i comandi su sistemi Windows remoti utilizzando WMI.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-share SHARE`|Share where the output will be grabbed from (default: ADMIN$)|
|`-silentcommand`|Execute command and return immediately without output|
|`-codec CODEC`|Sets encoding used (codec) from the target's output (default: UTF-8)|
|`-shell-type \\{cmd,powershell\\}`|Shell type to use (default: cmd)|
#### Esempi
Traduzione:
### dcomexec.py
Esegui i comandi su sistemi Windows remoti utilizzando oggetti DCOM.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-object \\{ShellWindows,ShellBrowserWindow,MMC20\\}`|DCOM object to use (default: MMC20.Application)|
|`-silentcommand`|Execute command and return immediately without output|
|`-codec CODEC`|Sets encoding used (codec) from the target's output (default: UTF-8)|
|`-shell-type \\{cmd,powershell\\}`|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|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-silentcommand`|Execute command and return immediately without output|
|`-codec CODEC`|Sets encoding used (codec) from the target's output (default: UTF-8)|
#### Esempi
Traduzione:
## Strumenti di dumping Credenziali
### Segreteria.py
Estrae le credenziali da un sistema Windows remoto, tra cui SAM, LSA Secrets e NTDS.dit.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-just-dc`|Extract only NTDS.DIT data (domain controller only)|
|`-just-dc-ntlm`|Extract only NTDS.DIT NTLM hashes (domain controller only)|
|`-just-dc-user USER`|Extract only NTDS.DIT data for specific user|
|`-pwd-last-set`|Shows pwdLastSet attribute for each NTDS.DIT account|
|`-user-status`|Shows whether the user is enabled or disabled|
|`-history`|Dump password history|
|`-outputfile FILE`|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|
|--------|-------------|
|`-request`|Requests TGT for users and output them in JtR/hashcat format|
|`-no-pass`|Don't ask for password (useful for Kerberos)|
|`-k`|Use Kerberos authentication|
|`-dc-ip IP`|IP Address of the domain controller|
|`-usersfile FILE`|File with user per line to test|
|`-format \\{hashcat,john\\}`|Format to save the AS_REP responses (default: hashcat)|
|`-outputfile FILE`|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|
|--------|-------------|
|`-request`|Requests TGS for users and output them in JtR/hashcat format|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-dc-ip IP`|IP Address of the domain controller|
|`-target-user USER`|Target specific user to request TGS for|
|`-outputfile FILE`|Output filename to write ciphers in JtR/hashcat format|
|`-format \\{hashcat,john\\}`|Format to save the TGS tickets (default: hashcat)|
#### Esempi
Traduzione:
### biglietteria.py
Crea biglietti d'oro e d'argento per l'autenticazione Kerberos.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-nthash HASH`|NT hash for the user or service account|
|`-aesKey KEY`|AES key for the user or service account|
|`-domain DOMAIN`|Domain name|
|`-domain-sid SID`|Domain SID|
|`-spn SPN`|Service Principal Name (for Silver Tickets)|
|`-groups IDS`|Comma-separated list of group IDs to include in the ticket|
|`-duration HOURS`|Ticket duration in hours (default: 10)|
|`-out FILE`|Output filename to save the ticket|
#### Esempi
Traduzione:
## Strumenti di Network Protocols
### smbclient.py
Fornisce un client SMB per accedere a azioni e file su sistemi remoti.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-port [port]`|Connect to SMB Server port (default: 445)|
|`-file FILE`|Input file with commands to execute in the mini shell|
|`-debug`|Turn DEBUG output ON|
#### Comandi comuni (Interactive Shell)
|Command|Description|
|---------|-------------|
|`help`|Show available commands|
|`shares`|List available shares|
|`use `|Connect to a specific share|
|`ls`|List files in current directory|
|`cd `|Change directory|
|`get `|Download file|
|`put `|Upload file|
|`rm `|Delete file|
|`mkdir `|Create directory|
|`rmdir `|Remove directory|
|`exit`|Exit the shell|
#### Esempi
Traduzione:
### mssqlclient.py
Fornisce un client per interagire con le istanze di Microsoft SQL Server.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-windows-auth`|Use Windows Authentication (default: False)|
|`-port [port]`|Destination port to connect to (default: 1433)|
|`-db DATABASE`|MSSQL database instance (default: None)|
|`-file FILE`|Input file with commands to execute in the SQL shell|
|`-debug`|Turn DEBUG output ON|
#### Comandi comuni (Interactive Shell)
|Command|Description|
|---------|-------------|
|`help`|Show available commands|
|`enable_xp_cmdshell`|Enable the xp_cmdshell stored procedure|
|`disable_xp_cmdshell`|Disable the xp_cmdshell stored procedure|
|`xp_cmdshell `|Execute command through xp_cmdshell|
|`sp_start_job `|Start a SQL Server job|
|`exit`|Exit the shell|
#### Esempi
Traduzione:
## Altri strumenti utili
### Ntlmrelayx.py
Esecuzioni NTLM Attacchi di relè.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-t TARGET`|Target to relay the credentials to|
|`-tf FILE`|File with targets to relay the credentials to|
|`-w`|Start the HTTP server and do not relay credentials|
|`-e FILE`|Execute this file when a connection is relayed|
|`-c COMMAND`|Execute this command when a connection is relayed|
|`-smb2support`|Enable SMB2 support|
|`-socks`|Launch a SOCKS proxy for the connection|
|`-one-shot`|Relay only one connection|
|`-debug`|Turn DEBUG output ON|
#### Esempi
Traduzione:
### lookupsid.py
Esegui ricerche SID per coinvolgere utenti e gruppi.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-domain DOMAIN`|Domain to enumerate (default: target domain)|
|`-debug`|Turn DEBUG output ON|
#### Esempi
Traduzione:
### reg.py
Fornisce uno strumento di manipolazione del registro remoto.
#### Uso di base
Traduzione:
#### Opzioni comuni
|Option|Description|
|--------|-------------|
|`-hashes LMHASH:NTHASH`|Use NTLM hashes instead of password (Pass-the-Hash)|
|`-debug`|Turn DEBUG output ON|
#### Azioni
|Action|Description|
|--------|-------------|
|`query`|Query a registry key or value|
|`add`|Add a registry key or value|
|`delete`|Delete a registry key or value|
|`save`|Save a registry hive to a file|
#### Esempi
Traduzione:
## Parametri comuni Strumenti incrociati
|Parameter|Description|
|-----------|-------------|
|`-h, --help`|Show help message and exit|
|`-debug`|Turn DEBUG output ON|
|`-hashes LMHASH:NTHASH`|NTLM hashes, format is LMHASH:NTHASH|
|`-no-pass`|Don't ask for password (useful for Kerberos)|
|`-k`|Use Kerberos authentication|
|`-aesKey KEY`|AES key to use for Kerberos authentication|
|`-dc-ip IP`|IP Address of the domain controller|
|`-target-ip IP`|IP Address of the target machine|
|`-port [port]`|Destination port to connect to|
## Risorse
- [Repository ufficiale GitHub](__LINK_5__)
- [Documentazione immancabile](__LINK_5__)
- [Esemplari immediati](__LINK_5__)
- [Risate Wiki](__LINK_5___)
- [Documentazione API impropria](__LINK_5__)