
Cobalt Strike and Tradecraft
A blog post breaking down Cobalt Strike's built-in "op-sec unsafe" commands (shell, pass-the-hash/pth, run, powershell, powerpick, spawnas) and mapping each to the exact Sysmon/Windows event log artifacts they generate: process creation chains (cmd.exe to conhost.exe with 0xffffffff -ForceV1), logon session events (4672, 4624, 4648), base64-encoded PowerShell command lines, and abnormal parent-child relationships like dllhost.exe spawning whoami.exe via fork-and-run techniques (powerpick, mimikatz, dcsync, execute-assembly, hashdump). It also flags quieter alternatives (BOFs, shinject, API-only calls) for a follow-up post, using a simple ELK plus Sysmon lab as the detection baseline.
What it is
A defender's-eye breakdown of five built-in Cobalt Strike Beacon commands — shell, pth, run, powershell, and powerpick — documenting the exact process-creation and logon artifacts each leaves in a Sysmon + Winlogbeat + ELK pipeline. It is explicitly a walkthrough of Cobalt Strike's own op-sec guidance from a detection standpoint, biased toward "somewhat mature" environments, and is billed as part one of a two-part series.
How it works
Each command produces a distinct, signature-able artifact chain:
shell→cmd.exe /cspawned under Beacon, which spawns the target (e.g.whoami.exe);conhost.exeis launched alongsidecmd.exe.pth→ the profile-definedspawntoprocess (author's isdllhost.exe) is created as a sacrificial child, mimikatz builds a new logon session (Event ID 4672), the account logs on (Event ID 4624), thencmd.exeis spawned underdllhost.exewith a string passed via named pipe. The parent's logon session then shows the impersonated user.run/execute→ calls the target executable directly (nocmd.exe), still spawningconhost.exe;executereturns no output.powershell→ spawnspowershell.exe(parent PID adjustable via theppidcommand) with base64-encoded command and-exec bypass.powerpick→ fork-and-run under thespawntoprocess;powerpick whoamiyields three processes:dllhost.exe,conhost.exe,whoami.exe, with nopowershell.exe.
The recurring tell across shell/pth/run/powerpick is the conhost.exe invocation with arguments 0xffffffff -ForceV1 (a console session identifier), which the author notes isn't malicious itself but is a common identifier for these commands.
flowchart TD
B[Beacon] -->|shell| C1[cmd.exe /c → target]
B -->|pth| D[dllhost.exe spawnto]
D --> L1[4672 logon session]
L1 --> L2[4624 logon]
L2 --> C2[cmd.exe via named pipe]
B -->|run| R[target.exe direct]
B -->|powershell| P[powershell.exe -exec bypass + base64]
B -->|powerpick| PP[dllhost.exe → whoami.exe]
C1 & C2 & R & PP --> CH[conhost.exe 0xffffffff -ForceV1]What to do
There are no patches or vendor commands here — this is detection-engineering source material. Concrete hunt signals it hands you:
- Alert on
conhost.exewith args0xffffffff -ForceV1correlated withcmd.exe /c. - Flag base64-encoded PowerShell with
-exec bypass(rare in legitimate use). - For pass-the-hash, look for the ordered sequence:
spawntoprocess → 4672 → 4624 → childcmd.exe, where the parent process's logon-session user changes. - For fork-and-run, the
spawnto(default heredllhost.exe) parenting an unexpected child likewhoami.exe.
Caveats
The author states "bad op-sec" is subjective and environment-dependent — none of this triggers in an env with no detection. The lab is deliberately simple (basic ELK/Sysmon, no "advanced" detections), the spawnto and ppid are attacker-configurable (so dllhost.exe is just this profile's default), and the article is incomplete — it cuts off mid-sentence in the powerpick section and does not cover all commands.
Organisations named here
- fork-and-run
Technologies named here
- Windows
- Cobalt Strike
- Mimikatz
- ELK stack
- Winlogbeat
- Sysmon
- PowerShell
Techniques named here
- Shell command
- Pass-the-hash
- Run command
- Execute command
- PowerShell command execution
- Powerpick
- Fork-and-run technique
- Spawnas
- Beacon Object Files
- Shinject
- API-only calls
Related in Offensive Security