Collecting netstat output first on a compromised server

CS0-004 By islever Editorial Last updated

Given a scenario, implement incident response techniques. Given a scenario, analyze indicators of potential malicious activity.

Short answer

D Netstat output must be captured first because the live TCP/UDP connection state it records is destroyed the moment the compromised server is disconnected from the network.

Question

A server was recently compromised. A security analyst needs to collect artifacts for further analysis before disconnecting the server from the network. Which of the following artifacts should the analyst collect first?
  1. ShellBags
  2. Hard disk
  3. Address Resolution Protocol table
  4. Netstat output Correct Answer

Key Takeaways

Order of volatility under RFC 3227 governs evidence collection on a compromised server: the analyst must capture the most ephemeral artifacts before disconnecting it. Netstat output is the correct first grab because the live TCP/UDP sessions and C2 connections it shows vanish as soon as the network is cut, while ShellBags, the disk image and the ARP table survive longer. The ARP table is volatile but ranks second, since it records only resolved neighbours rather than the active sessions themselves.

Expert Analysis

Order of volatility (RFC 3227) says to capture the most ephemeral evidence first, and active TCP/UDP connections and C2 sessions vanish the moment the network is disconnected — netstat output records them. The ARP table (C) is also volatile and should be captured early, but active connection state is the most directly lost on disconnect. A (ShellBags) and B (disk image) are persistent registry/disk artifacts that can be acquired later from a powered-down or imaged system.

The deciding constraint in this scenario is the pending disconnection: the analyst is about to cut the server off from the network, so anything held in volatile RAM that describes live network state disappears at that instant. netstat output is exactly that — the current TCP and UDP sockets, their states (ESTABLISHED, TIME_WAIT, LISTEN), the remote endpoints and the owning process IDs. For a recently compromised host, those rows are the direct fingerprint of command-and-control beacons, reverse shells or lateral-movement sessions in progress. Once the cable is pulled or the interface is disabled, the socket table is rebuilt or emptied, so option D must be captured while the machine is still up and connected.

Option C, the ARP table, is a legitimate early-order artifact and the closest distractor: it too lives in kernel memory and lists IP-to-MAC pairings that reveal which neighbors the compromised server has actually talked to, including any host impersonating a gateway. It is therefore not wrong in principle, but it ranks one step below the socket table here, because the ARP cache only records resolved link-layer neighbours, whereas netstat records the live sessions themselves — the very thing the question's "before disconnecting" clause destroys. A correct answer must be the single most immediately lost item, and that is D.

Options A and B fail on persistence. ShellBags are registry keys under HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\BagMRU that record folder-view history; a disk image is a full copy of the storage medium. Both survive power-down and can be pulled from a forensic image taken later in the acquisition order, so neither can be the first collection. The practical technique is to work down RFC 3227's ladder: capture running memory and network state first (memory dump, netstat, ARP cache, routing table, open handles), then acquire the disk, then analyse registry hives and ShellBags offline.

One mechanism this scenario depends on but never spells out: volatile capture must be done through a trusted path that does not perturb the evidence. Running netstat from the compromised host's own shell can be blocked or falsified by rootkit-level hooks, which is why exam and forensic guidance pairs these commands with a pre-built, signed responder kit or an external live-response collection rather than ad-hoc typing on the infected box. The ordering logic still holds — network connection state is destroyed by the disconnection itself — but the collection channel determines whether the numbers you record are trustworthy.

In short, the question tests ordering, not inventory: all four options are valid evidence, but only one is destroyed by the action the analyst is about to take.

Official Reference

https://www.rfc-editor.org/rfc/rfc3227

This link opens the official vendor documentation in a new tab.

Exam Strategy

When a question names a pending action such as disconnecting, powering off or imaging, treat that action as the destruction trigger and ask which option's data it erases first. Rank every candidate on the RFC 3227 ladder — registers and caches, RAM, network state, disk — and pick the highest-ranked item, ignoring the fact that several options may all be legitimate evidence. Persistent artifacts like ShellBags or a disk image are almost always traps when the stem specifies a 'first' collection, because they can be acquired later.

Practice All CS0-004 Questions

Access 101 questions with complete answers and detailed explanations.

View Full CS0-004 Practice Test →

← Back to CS0-004 Study Guide