Apply Network Behavior Correlation
Capture and correlate a sample's actual network traffic — destinations, protocols, payload patterns — with the code-level behavior identified through static and dynamic analysis, when analyzing a sample that communicates over a network, because the most actionable indicators for detection and triage are frequently only fully observable in live network behavior, not in code-level analysis alone.
Why This Is Best Practice
Sikorski & Honig, "Practical Malware Analysis" (2012): Dedicates specific methodology to network-behavior analysis as a distinct phase from code-level static and dynamic analysis — observing what a sample actually sends, to what destinations, and in what protocol or format, as information that complements but isn't fully substitutable by code-level analysis alone, since runtime-constructed network requests (dynamically-generated domains, runtime-assembled payloads) may not be fully predictable from code reading without observing an actual run.
Cuckoo Sandbox documentation: Automated dynamic-analysis sandboxes build network capture into their default pipeline specifically because a sample's network indicators of compromise (destination domains/IPs, protocol fingerprints, specific payload formats) are typically the most directly actionable output of an analysis — the artifacts that feed directly into firewall rules, threat-intelligence feeds, and detection signatures.
Why best: Code-level analysis can establish that a sample contains networking capability and roughly what it's for, but the specific destinations, timing, and payload structure actually used are often runtime-dependent (algorithmically-generated domains, environment-dependent payloads, server-side response-dependent behavior) in ways that are faster and more reliably captured by observing actual traffic than by fully tracing the generating code. Conversely, network traffic alone, without the code-level context of why it's happening, is harder to act on — the combination of both is what produces an actionable, well-understood picture.
Adopted by: Standard component of automated and manual malware-analysis pipelines (Cuckoo Sandbox, commercial sandboxes, SANS FOR610 lab exercises) and a primary data source for threat-intelligence indicator-of-compromise extraction.
Impact: Captured network indicators (C2 domains, protocol signatures, beacon timing patterns) are the most common form of actionable output shared across security teams and threat-intelligence feeds, specifically because they can be operationalized into detection rules directly, in a way that a purely code-level description of "this sample contacts a C2 server" cannot.
Steps
- Capture full network traffic during dynamic analysis (in the isolated environment — see
apply-isolated-analysis-environment) using a packet capture tool or the analysis sandbox's built-in capture.
- Identify destinations, protocols, and timing patterns in the captured traffic — specific domains/IPs contacted, the protocol used (HTTP, DNS, raw TCP, a custom protocol), and the interval/pattern of repeated communication (beaconing).
- Correlate each observed network event with the specific code location responsible for it, using the static/dynamic code analysis already performed — which function constructs this request, what triggers it, what data it includes.
- Decode or de-obfuscate payload content where the protocol itself is non-standard or obfuscated, using the code-level understanding of how the sample constructs its traffic to inform the decoding.
- Use a controlled, fake network (sinkhole DNS, fake HTTP service) rather than real internet access so the sample's attempted communications can be captured without actually reaching real infrastructure.
- Extract the specific, actionable indicators (destination domains/IPs, protocol signatures, beacon intervals) as a direct output of the analysis, suitable for detection-rule creation or threat-intelligence sharing.
Rules
- Capture network traffic as a standard part of dynamic analysis for any sample with networking capability, not as an optional extra step.
- Always correlate network events back to the specific responsible code, rather than treating network capture and code analysis as separate, unlinked outputs.
- Use a controlled fake network rather than real internet access during analysis, so observed traffic doesn't actually reach real C2 infrastructure or leak analysis activity to the sample's operators.
- Prioritize extracting actionable indicators (destinations, protocol signatures, timing) as a direct analysis output, since these are typically the most immediately useful product of the analysis for detection and response purposes.
Examples
Effective correlation: An analyst observes a sample making periodic HTTPS requests to a specific domain, and traces that back to a function identified in static/dynamic analysis as the sample's beaconing routine. Combining the code-level understanding (how the beacon interval and payload are constructed) with the captured traffic (the actual domain, payload format, and interval observed) produces a specific, immediately actionable detection signature.
Network-only analysis failure mode (contrast case): A team captures network traffic showing a sample beaconing to a specific IP, but without code-level analysis to confirm what triggers the beacon or what data it carries, can't determine whether the observed traffic represents the sample's primary C2 channel or a secondary, less significant communication — producing a detection rule based on an incomplete understanding of the traffic's actual role.
Common Mistakes
- Performing network capture without correlating it back to the specific responsible code, losing the context needed to understand why the traffic occurs and how reliable an indicator it is.
- Allowing analysis traffic to reach real infrastructure instead of using a sinkhole/fake network, which can alert the sample's operators to the analysis and burn the value of any indicators gathered.
- Relying on code-level analysis alone for network behavior that's actually runtime-dependent (algorithmically-generated domains, server-response-dependent logic), missing indicators that only appear in an actual captured run.
- Not decoding obfuscated or non-standard protocol payloads, leaving captured traffic as an unreadable blob rather than an actionable indicator.
When NOT to Use
- For a sample with no networking capability at all (confirmed through static analysis showing no relevant imports or API usage) — network capture adds no value in that case.
- When the analysis goal is purely to understand local-system behavior (file system changes, process injection) with no network component — network correlation is a complementary technique for samples that specifically communicate over a network, not a universal step.
- In a context where real network access is required to trigger the behavior of interest (a sample using server-side validation that a sinkhole can't replicate) — in that case, a carefully controlled, monitored connection to the real destination may be needed instead, under appropriate authorization and risk controls.
1---2name: apply-network-behavior-correlation3description: Use when analyzing a sample that communicates over a network — capture and correlate its actual network traffic (destinations, protocols, payload patterns) with the code-level behavior identified through static and dynamic analysis, because the most actionable indicators for detection and triage (C2 infrastructure, exfiltration patterns, protocol signatures) are frequently only fully observable in live network behavior, not in code-level analysis alone.4source: 'Michael Sikorski & Andrew Honig, "Practical Malware Analysis", No Starch Press (2012) — network-behavior analysis chapters; Cuckoo Sandbox documentation — automated dynamic analysis with integrated network capture'5tags: [reverse-engineering, network-analysis, malware-analysis, dynamic-analysis, security]6related: [apply-isolated-analysis-environment, apply-dynamic-instrumentation-over-manual-stepping]7metadata:8 source: https://skillmd.com/skills/jeffreytse/apply-network-behavior-correlation9---1011# Apply Network Behavior Correlation1213Capture and correlate a sample's actual network traffic — destinations, protocols, payload patterns — with the code-level behavior identified through static and dynamic analysis, when analyzing a sample that communicates over a network, because the most actionable indicators for detection and triage are frequently only fully observable in live network behavior, not in code-level analysis alone.1415## Why This Is Best Practice1617**Sikorski & Honig, "Practical Malware Analysis" (2012):** Dedicates specific methodology to network-behavior analysis as a distinct phase from code-level static and dynamic analysis — observing what a sample actually sends, to what destinations, and in what protocol or format, as information that complements but isn't fully substitutable by code-level analysis alone, since runtime-constructed network requests (dynamically-generated domains, runtime-assembled payloads) may not be fully predictable from code reading without observing an actual run.1819**Cuckoo Sandbox documentation:** Automated dynamic-analysis sandboxes build network capture into their default pipeline specifically because a sample's network indicators of compromise (destination domains/IPs, protocol fingerprints, specific payload formats) are typically the most directly actionable output of an analysis — the artifacts that feed directly into firewall rules, threat-intelligence feeds, and detection signatures.2021**Why best:** Code-level analysis can establish that a sample contains networking capability and roughly what it's for, but the specific destinations, timing, and payload structure actually used are often runtime-dependent (algorithmically-generated domains, environment-dependent payloads, server-side response-dependent behavior) in ways that are faster and more reliably captured by observing actual traffic than by fully tracing the generating code. Conversely, network traffic alone, without the code-level context of why it's happening, is harder to act on — the combination of both is what produces an actionable, well-understood picture.2223**Adopted by:** Standard component of automated and manual malware-analysis pipelines (Cuckoo Sandbox, commercial sandboxes, SANS FOR610 lab exercises) and a primary data source for threat-intelligence indicator-of-compromise extraction.24**Impact:** Captured network indicators (C2 domains, protocol signatures, beacon timing patterns) are the most common form of actionable output shared across security teams and threat-intelligence feeds, specifically because they can be operationalized into detection rules directly, in a way that a purely code-level description of "this sample contacts a C2 server" cannot.2526## Steps27281. **Capture full network traffic during dynamic analysis** (in the isolated environment — see `apply-isolated-analysis-environment`) using a packet capture tool or the analysis sandbox's built-in capture.292. **Identify destinations, protocols, and timing patterns** in the captured traffic — specific domains/IPs contacted, the protocol used (HTTP, DNS, raw TCP, a custom protocol), and the interval/pattern of repeated communication (beaconing).303. **Correlate each observed network event with the specific code location responsible for it**, using the static/dynamic code analysis already performed — which function constructs this request, what triggers it, what data it includes.314. **Decode or de-obfuscate payload content where the protocol itself is non-standard or obfuscated**, using the code-level understanding of how the sample constructs its traffic to inform the decoding.325. **Use a controlled, fake network (sinkhole DNS, fake HTTP service) rather than real internet access** so the sample's attempted communications can be captured without actually reaching real infrastructure.336. **Extract the specific, actionable indicators** (destination domains/IPs, protocol signatures, beacon intervals) as a direct output of the analysis, suitable for detection-rule creation or threat-intelligence sharing.3435## Rules3637- Capture network traffic as a standard part of dynamic analysis for any sample with networking capability, not as an optional extra step.38- Always correlate network events back to the specific responsible code, rather than treating network capture and code analysis as separate, unlinked outputs.39- Use a controlled fake network rather than real internet access during analysis, so observed traffic doesn't actually reach real C2 infrastructure or leak analysis activity to the sample's operators.40- Prioritize extracting actionable indicators (destinations, protocol signatures, timing) as a direct analysis output, since these are typically the most immediately useful product of the analysis for detection and response purposes.4142## Examples4344**Effective correlation:** An analyst observes a sample making periodic HTTPS requests to a specific domain, and traces that back to a function identified in static/dynamic analysis as the sample's beaconing routine. Combining the code-level understanding (how the beacon interval and payload are constructed) with the captured traffic (the actual domain, payload format, and interval observed) produces a specific, immediately actionable detection signature.4546**Network-only analysis failure mode (contrast case):** A team captures network traffic showing a sample beaconing to a specific IP, but without code-level analysis to confirm what triggers the beacon or what data it carries, can't determine whether the observed traffic represents the sample's primary C2 channel or a secondary, less significant communication — producing a detection rule based on an incomplete understanding of the traffic's actual role.4748## Common Mistakes4950- **Performing network capture without correlating it back to the specific responsible code**, losing the context needed to understand why the traffic occurs and how reliable an indicator it is.51- **Allowing analysis traffic to reach real infrastructure** instead of using a sinkhole/fake network, which can alert the sample's operators to the analysis and burn the value of any indicators gathered.52- **Relying on code-level analysis alone for network behavior that's actually runtime-dependent** (algorithmically-generated domains, server-response-dependent logic), missing indicators that only appear in an actual captured run.53- **Not decoding obfuscated or non-standard protocol payloads**, leaving captured traffic as an unreadable blob rather than an actionable indicator.5455## When NOT to Use5657- For a sample with no networking capability at all (confirmed through static analysis showing no relevant imports or API usage) — network capture adds no value in that case.58- When the analysis goal is purely to understand local-system behavior (file system changes, process injection) with no network component — network correlation is a complementary technique for samples that specifically communicate over a network, not a universal step.59- In a context where real network access is required to trigger the behavior of interest (a sample using server-side validation that a sinkhole can't replicate) — in that case, a carefully controlled, monitored connection to the real destination may be needed instead, under appropriate authorization and risk controls.