Understanding the Host Through Command-Line Evidence
A designer's workstation begins contacting an unfamiliar internet service every few minutes. The network sensor can see the destination and timing, but it cannot identify the program responsible. A responder inspects the workstation and finds an unfamiliar process running under the designer's account. The process name looks ordinary. Its location on disk is less reassuring, and it appeared shortly after the designer opened a downloaded file. Those details change the investigation, but none of them alone proves what the program has done.
Command-line tools give an analyst a way to ask the operating system specific questions. What is running right now? Which account is responsible for a process? Where is its executable stored? Is the machine listening for connections or establishing them? Which programs will run again after a restart? What historical records remain? The useful skill is understanding the answer and its limits. You can learn that reasoning while listening without needing to remember a command's exact spelling.
A command line is a text interface to an operating system. A shell receives a request, interprets it, and invokes built-in features or programs. Windows provides Command Prompt and PowerShell, while Linux commonly uses shells that work with tools such as ps, ip, and journalctl. Their syntax and output differ, but the investigative questions overlap. Some tools report current system state. Others read saved records. Some can change the system, deliberately or accidentally. Choosing a tool requires knowing which kind of observation is needed and whether the action is authorized.
First establish where the evidence comes from. The same command may be run locally on the affected workstation or remotely through an approved management service. A remote session may use a different account, privilege context, or view of the system. A shell can also have a current working directory, which affects how relative file names are interpreted. If an analyst assumes the wrong machine or location, an accurate output can still support a completely wrong conclusion. Host identity, time, user context, and tool provenance belong alongside the result.
For an optional review after listening, the independent Bare Metal Cyber CCOA study guide can help connect the ideas of processes, files, users, and operating-system services. Focus on what each observation can establish about the designer's workstation. Familiarity with a command name is helpful, but the evidence becomes valuable only when you understand its source and time.
Return to the unfamiliar process. A process is a running instance of a program. Several processes may use the same executable, and a single application may create many child processes to handle different work. The operating system assigns process identifiers to distinguish running instances. An identifier is useful when connecting a network socket to a process or following an event record. It is not a permanent identity for that program. The number can be reused after a process ends, so historical correlation also needs timestamps and other context.
On Windows, a PowerShell command such as Get-Process can report running processes. Linux offers similar observations through process utilities and the operating system's process information. A process listing may include a name, identifier, account, resource use, or start time, depending on the tool, privileges, and platform. It reveals a snapshot of execution. It cannot tell you every program that ran yesterday, and a short-lived malicious process might be gone before anyone collects that snapshot.
Names are especially weak evidence. A legitimate program can have an unfamiliar name, and an attacker can give a malicious program a familiar one. The executable path, parent process, digital signature when available, creator or owner, execution time, and observed behavior provide better context. Imagine two processes both called updater. One runs from an approved software directory and was launched by the organization's update service. The other launches from a user-writable folder immediately after a suspicious download. Those observations do not automatically convict the second process, but they justify investigating why it was created.
A parent process helps explain how execution began. If a document viewer unexpectedly starts a command shell, the relationship may be relevant to a phishing or malicious-document hypothesis. There are also legitimate reasons for applications to launch scripts or helper utilities. Look at the surrounding time, the command arguments if they were recorded, the user who launched the activity, and whether similar behavior is normal for that application. A parent-child relationship is a clue about sequence and origin, not a complete account of intent.
The designer's workstation produces one such clue. Its unusual process was launched by a script interpreter shortly after a file arrived in the downloads folder. A shell is powerful because it can automate normal tasks. It is also attractive to attackers because those same capabilities can discover files, change settings, and contact remote systems. You need the actions and context before calling it malicious. An administrative automation script may be legitimate; a script collecting private documents and sending them to an unapproved destination presents a different case.
File evidence begins with location and metadata. A directory listing can reveal names, sizes, types, permissions, and timestamps. File paths distinguish the approved installation area from a temporary working location or a user's downloads directory. A file extension may suggest the format but does not prove its actual content. A timestamp may indicate when a file was created or changed according to the filesystem, but copying, synchronization, extraction, and attacker activity can alter that record. Treat timestamps as evidence requiring context rather than a guaranteed origin story.
A cryptographic hash can identify measured file content. If two files produce the same strong content hash, that supports a precise comparison of their bytes. Hashing is useful when checking a collected copy against its source or looking for a known sample. It does not establish that the contents are safe, who created the file, or whether it was executed. An attacker can modify a file and change its hash. The more specialized forensic and integrity lessons later in this course will examine collection and hashing in greater depth. For now, understand why a hash is one useful attribute in a larger file investigation.
Permissions tell another part of the story. A program may run as the logged-in employee, a service identity, or an elevated administrative account. That context limits what it can normally access or modify. On Windows, security groups and access controls influence rights; on Linux, user and group ownership and permission settings do similar work. Privilege is not merely a label attached to the file. It includes the effective authority of the process, the credentials it holds, and any rights gained through services or delegated operations.
Suppose the suspicious process runs under the designer's ordinary account. It may still reach files the designer can read, use the designer's active application sessions, and make outbound network connections allowed for that workstation. If it runs with elevated authority, the possible consequences broaden. An investigator should not assume that a process with an ordinary-looking account name lacks sensitive access, nor that every administrative process is hostile. The question is which capability was available to that process at that time and whether the observed behavior fits an authorized task.
Current connections reveal a different kind of host fact. On Windows, PowerShell networking tools can display active transport connections and their owning process identifiers. Linux provides comparable socket information through system utilities. If the unfamiliar destination appears in the current list, the analyst may be able to associate it with the active process. That association is valuable because the network sensor sees the conversation while the operating system knows which local program opened the connection. However, a snapshot after the connection closes may show nothing. Historical endpoint and network records may be needed to reconstruct earlier communication.
A listening service deserves careful interpretation too. A workstation might have a local service waiting for connections, perhaps for legitimate development, remote support, or software functions. A listening socket does not establish that other machines can reach the service. Local address binding, host firewall rules, network paths, and application authentication can all restrict access. A strange port number is a clue to investigate, not a declaration of compromise. The most useful next fact is often the owning process and the legitimate business reason, if any, for that listener.
The Bare Metal Cyber Cyber Challenge provides an optional way to apply this thinking after the lesson. If a scenario gives you a process name, user, path, and destination, practice explaining which fact supports your hypothesis and which source would test it. You should be able to say why a current process list alone is insufficient for activity that occurred hours earlier.
Processes also reveal what the operating system is doing now, but attackers frequently want activity to return later. Services and scheduled execution mechanisms are normal administrative tools that can also provide persistence. A Windows service may start automatically at boot. A scheduled task may run at a defined time or trigger. Linux service managers and scheduling tools provide related capabilities. A recurring outbound connection could be produced by a long-running service, a repeated scheduled job, or an application that starts only when the user signs in. Understanding that difference helps select the right evidence.
Imagine the suspicious process has disappeared when the analyst begins collecting information, but the connection reappears every hour. Searching only the current process list at a quiet moment may miss the responsible program. Service configuration, scheduled-execution records, and historical endpoint telemetry can identify the program that runs periodically. A schedule entry is not proof the task executed; execution logs or resulting artifacts are needed for that. Similarly, a disabled task may remain as a historical clue even when it is no longer capable of restarting the process.
Command-line evidence can be transformed as it moves between tools. A shell may pass the result of one operation into another for filtering, sorting, or summarizing. It may redirect output into a file. PowerShell often passes structured objects, while many traditional command-line tools pass text. Analysts use these abilities to reduce large outputs to relevant details. Attackers use them to automate collection and stage results. The significant observation is the behavior represented by a chain of operations. A command that enumerates files, filters by a pattern, and writes a list to disk may be harmless inventory work or preparation for data theft, depending on who ran it and what followed.
An important limitation is that filtering can hide context. A text search for one suspicious phrase may overlook related events that use different wording. Sorting a log without preserving timestamps or event identifiers can make a sequence appear more certain than it is. A pipe that selects only one column may discard the user or source needed for attribution. When an investigation depends on a transformed result, preserve the original record, note what was filtered, and check enough surrounding events to determine whether the conclusion survives a broader view.
Logs provide the historical perspective missing from live snapshots. Operating systems may record authentication, process execution, service installation, administrative changes, or security-relevant events when the appropriate collection is enabled. Application and service logs add their own view. A host may also forward events to a central platform. The absence of an event can reflect disabled auditing, a collection delay, retention limits, or an incorrect time range. The analyst should know which source normally records the behavior before interpreting a missing event as proof it never happened.
Time alignment becomes particularly important when comparing an endpoint record with a network sensor. The workstation may use one time zone, the security platform another, and an analyst's note a third. Clock drift or delayed event delivery can make related records appear out of order. A useful timeline retains the original timestamps, converts them consistently when comparing systems, and records uncertainty where clocks differ. That discipline prevents a plausible sequence from being presented as a guaranteed chain of cause and effect.
Now the case turns. The designer reports that the unfamiliar process might belong to a newly installed graphics extension. IT confirms that the extension was installed through an approved software channel, but its update component should contact a different service. The process path matches the installed extension, while its remote destination does not. This new evidence argues against a simple conclusion based on the executable's unfamiliar name. It also means a compromised update path or misconfigured service remains possible. The next investigation should compare the installed file with the approved version, review launch records and permissions, and ask the software owner about expected network behavior.
Notice how uncertainty narrows. The endpoint confirms an active process with a particular executable path and user context. Host connection evidence links that process to the remote service during one observation window. Installation records explain why the executable is present. They do not yet establish the integrity of the file or the legitimacy of the destination. A file hash comparison, application configuration record, and vendor or internal software inventory might help distinguish an authorized update from a changed component. The analyst should preserve evidence before an automatic update or cleanup removes the original state.
Collecting that evidence has a footprint. Logging in creates events. Some tools touch metadata or generate temporary files. Installing an unfamiliar utility may change the host substantially. A command run with administrative privileges can do more harm than the question requires. Investigators should follow approved collection procedures, prefer the least intrusive source that can answer the question, and record what they did. When immediate containment is necessary, incident-response authority and risk take precedence over an idealized plan to inspect every artifact first. This episode is about understanding host evidence, not a license for uncontrolled live forensics.
The safest use of a command line also separates observation from action. Reading a process list differs from terminating the process. Viewing a service's configuration differs from disabling it. Checking file permissions differs from changing ownership or rights. A command family may include both inspection and modification capabilities, and a script can combine them. An analyst should understand the effect of an operation before executing it and should not run a copied command merely because it appears in an incident playbook without checking the current system and authorization.
A clear case record for the designer's workstation would identify the host, account, time window, observed process, executable location, connection endpoint, and the sources supporting each fact. It would separate what the organization expects from what was observed. It would also record missing evidence, the software owner's response, and any changes made during collection. That record allows a later responder to determine whether a fresh alert represents the same process or a different event with a reused identifier or a similar file name.
Suppose the final review shows that the extension used an unapproved analytics endpoint because of a configuration error, and no evidence supports attacker control. The security team can correct the destination policy, coordinate the software fix, and document the limits of what was checked. If the file instead differs from the approved build and the logs show it collecting design documents before connecting outward, the investigation becomes a possible compromise requiring containment and scoping. The command-line facts do not change simply because the conclusion changes. They become persuasive when tied to corroborating evidence and the business activity they describe.
The unfamiliar process was the start of an investigation, not its verdict. Command-line tools help expose files, execution, user authority, network state, recurring jobs, and historical records. Each observation has a particular time horizon and a particular limit. When you understand those limits, you can choose a small, useful question, interpret the result correctly, and combine host evidence with network and identity records without overstating what happened. That is the foundation for deeper host triage, forensic collection, and incident decisions later in the course.