T1104 Splunk · SPL

Detect Multi-Stage Channels in Splunk

Adversaries may create multiple stages for command and control that are employed under different conditions or for certain functions. Use of multiple stages may obfuscate the command and control channel to make detection more difficult. Remote access tools will call back to the first-stage command and control server for instructions. The first stage may have automated capabilities to collect basic host information, update tools, and upload additional files. A second remote access tool (RAT) could be uploaded at that point to redirect the host to the second-stage command and control server. The second stage will likely be more fully featured and allow the adversary to interact with the system through a reverse shell and additional RAT features. The different stages will likely be hosted separately with no overlapping infrastructure. The loader may also have backup first-stage callbacks or Fallback Channels in case the original first-stage communication path is discovered and blocked. Known real-world examples include APT3 using SOCKS5 to proxy through 192.157.198[.]103 before connecting to a second IP on TCP/81, Lazarus Group injecting later stages into separate processes, Bazar loader downloading the Bazar backdoor as a second-stage implant, and LunarWeb using one URL for initial host profiling and two additional URLs for command retrieval.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1104 Multi-Stage Channels
Canonical reference
https://attack.mitre.org/techniques/T1104/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
NOT (Image="*\\chrome.exe" OR Image="*\\msedge.exe" OR Image="*\\firefox.exe" OR Image="*\\iexplore.exe" OR Image="*\\opera.exe" OR Image="*\\brave.exe" OR Image="*\\OneDrive.exe" OR Image="*\\Teams.exe" OR Image="*\\Outlook.exe" OR Image="*\\thunderbird.exe" OR Image="*\\svchost.exe" OR Image="*\\MsMpEng.exe" OR Image="*\\WaaSMedicAgent.exe")
NOT (DestinationIp="10.*" OR DestinationIp="172.16.*" OR DestinationIp="172.17.*" OR DestinationIp="172.18.*" OR DestinationIp="172.19.*" OR DestinationIp="172.2*" OR DestinationIp="172.30.*" OR DestinationIp="172.31.*" OR DestinationIp="192.168.*" OR DestinationIp="127.*" OR DestinationIp="::1" OR DestinationIp="0:0:0:0:0:0:0:1")
| stats
    dc(DestinationIp) as UniqueExternalIPs,
    values(DestinationIp) as IPList,
    values(DestinationPort) as Ports,
    count as ConnectionCount,
    earliest(_time) as FirstContact,
    latest(_time) as LastContact
    by host, ProcessId, Image, CommandLine, User, ProcessGuid
| where UniqueExternalIPs >= 2
| eval DurationMins=round((LastContact - FirstContact) / 60, 1)
| eval StrongIndicator=if(UniqueExternalIPs >= 3, "true", "false")
| eval DetectionType="SingleProcessMultiStageC2"
| append
    [ search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
      NOT (Image="*\\chrome.exe" OR Image="*\\msedge.exe" OR Image="*\\firefox.exe" OR Image="*\\iexplore.exe" OR Image="*\\OneDrive.exe" OR Image="*\\Teams.exe" OR Image="*\\svchost.exe")
      NOT (DestinationIp="10.*" OR DestinationIp="172.16.*" OR DestinationIp="172.2*" OR DestinationIp="172.30.*" OR DestinationIp="172.31.*" OR DestinationIp="192.168.*" OR DestinationIp="127.*")
      | stats values(DestinationIp) as ChildIPs count by host, ParentProcessId, ParentImage, Image as ChildImage, CommandLine as ChildCmdLine, User
      | join type=inner host ParentProcessId
          [ search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
            NOT (DestinationIp="10.*" OR DestinationIp="192.168.*" OR DestinationIp="127.*")
            | stats values(DestinationIp) as ParentIPs by host, ProcessId as ParentProcessId ]
      | eval SharedIPs=mvfilter(match(ChildIPs, mvjoin(ParentIPs, "|")))
      | where isnull(SharedIPs) OR len(SharedIPs)=0
      | eval DetectionType="ParentChildC2Handoff", StrongIndicator="true", UniqueExternalIPs=2
      | table host, User, ChildImage, ChildCmdLine, ChildIPs, ParentImage, ParentIPs, DetectionType, StrongIndicator, UniqueExternalIPs ]
| table _time, host, User, Image, CommandLine, UniqueExternalIPs, IPList, Ports, ConnectionCount, DurationMins, StrongIndicator, DetectionType
| sort - UniqueExternalIPs
high severity medium confidence

Detects multi-stage C2 using Sysmon Event ID 3 (Network Connection) logs in Splunk. First detection path aggregates outbound connections per ProcessId/host pair and flags any non-browser process reaching 2 or more distinct external IPs — the core behavioral signature of staged loaders rotating C2 infrastructure. Private RFC1918 ranges and localhost are excluded. A StrongIndicator field is set when UniqueExternalIPs reaches 3+. The appended search implements a parent-child C2 handoff detection by correlating parent process external connections against child process external connections, flagging pairs where child IPs do not overlap with parent IPs. DurationMins captures the window between first and last contact to distinguish rapid sequential staging (short window) from long-lived implants with multiple C2 addresses.

Data Sources

Network Traffic: Network Connection CreationSysmon Event ID 3

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Update managers and package tools (npm, pip, chocolatey) contacting multiple CDN endpoints and registries during installation
  • Security and EDR agents maintaining connections to telemetry, licensing, and health check endpoints across different IP addresses
  • Development toolchains pulling dependencies from multiple external hosts during build or compile operations
  • RMM agents (ConnectWise, NinjaRMM, Datto) maintaining connections to load-balanced infrastructure across distinct IPs
  • Backup clients (Veeam, Acronis, Commvault) contacting licensing, cloud repository, and update endpoints sequentially
Download portable Sigma rule (.yml)

Other platforms for T1104


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Two-Stage PowerShell C2 Simulation (Windows)

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with the multi-stage command line. Sysmon Event ID 3: two distinct Network Connection events from the same ProcessId — one to 127.0.0.1:8080 and one to 127.0.0.1:8081. Note: loopback IPs will be filtered from the public-IP detection rules, so to fully validate the detection in a lab, replace 127.0.0.1 with two distinct external test IPs (e.g., dedicated canary hosts).

  2. Test 2First-Stage Downloader Dropping Second-Stage Binary (Windows)

    Expected signal: Sysmon Event ID 11: FileCreate for stage2_test.exe in %TEMP% initiated by powershell.exe. Sysmon Event ID 1: Process Create for stage2_test.exe with parent powershell.exe. The loader-to-dropped-binary pattern is visible in the process chain. In a full lab scenario with a second-stage that makes outbound connections to a different IP than the downloader, Sysmon Event ID 3 records from both the parent PowerShell and the child stage2_test.exe would show different destination IPs.

  3. Test 3SOCKS5 Proxy Connection via PowerShell (Windows — First-Stage Pattern)

    Expected signal: Sysmon Event ID 3: Network Connection events from powershell.exe to 127.0.0.1:1080 and 127.0.0.1:1913. In a real scenario with external IPs, these would appear in DeviceNetworkEvents. The connection to TCP/1913 specifically matches the APT3 Operation Double Tap SOCKS5 first-stage pattern.

  4. Test 4Multi-Stage C2 via curl Chain (Linux)

    Expected signal: Linux auditd SYSCALL records: execve for curl with distinct destination arguments, socketcall/connect system calls to two distinct destination ports. If using Sysmon for Linux: Event ID 3 (Network Connection) for each curl process with different DestinationIp/DestinationPort values. Process tree shows sequential curl invocations from a parent shell process. /tmp file creation events for downloaded artifacts.

  5. Test 5Process Injection Multi-Stage Simulation (Windows — Lazarus Pattern)

    Expected signal: Sysmon Event ID 1: Process Create for notepad.exe and child powershell.exe. Sysmon Event ID 10 (ProcessAccess): source PowerShell process accessing notepad.exe handle — this is the process access event that precedes injection in real attacks. Sysmon Event ID 3: Network Connection from child powershell.exe to 127.0.0.1:9002, distinct from any connections the parent makes. Security Event ID 4688 for all process creation events if command-line auditing is enabled.

Unlock Pro Content

Get the full detection package for T1104 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections