File and Process Entity Analysis

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 8 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Module: Mitigate Threats Using Microsoft Defender for Endpoint

Lesson: File and Process Entity Analysis

Introduction: The Criticality of Entity Analysis

In the modern landscape of cybersecurity, the ability to quickly and accurately identify the source of a security incident is the difference between a minor alert and a catastrophic data breach. When an alert triggers in Microsoft Defender for Endpoint, it rarely provides the full picture immediately. Instead, it offers a starting point. File and Process Entity Analysis is the investigative process of peeling back the layers of an alert to understand what a specific file did, why a process was launched, and what the ultimate intent of that execution was.

Why does this matter? Attackers often use living-off-the-land techniques—utilizing legitimate system tools like PowerShell, WMI, or Certutil to perform malicious actions. If you only look at the file name or a basic hash, you might miss the context. A powershell.exe process is perfectly normal in an enterprise environment, but a powershell.exe process that downloads an encoded string from a suspicious IP address and injects it into explorer.exe is a massive red flag. By mastering entity analysis, you move from reactive alert-clearing to proactive threat hunting and forensic investigation.


Not read yet

The Anatomy of a File Entity

A file entity in Microsoft Defender for Endpoint is more than just a name on a disk. It is a collection of metadata, behavioral patterns, and global intelligence. When you click on a file hash within the Defender portal, you are presented with a comprehensive view of that file’s life cycle within your environment.

Key Attributes of a File Entity

To perform an effective investigation, you must understand the following attributes:

  • SHA-256 Hash: The unique fingerprint of the file. This is your primary anchor for cross-referencing with global threat intelligence databases like VirusTotal or internal sandboxes.
  • Prevalence: This indicates how many devices in your organization have seen this file. A file seen on only one device is inherently more suspicious than one seen on 5,000 devices.
  • First/Last Seen: These timestamps help you establish a timeline of when the threat entered your environment and how long it has been dormant or active.
  • Signer Information: Legitimate software is almost always digitally signed. If a file claims to be from Microsoft but lacks a valid signature, or is signed by an untrusted certificate, it is a high-priority investigation item.
  • Behavioral Detections: The platform logs what the file did. Did it modify registry keys? Did it attempt to make network connections? Did it drop other files into temporary directories?

Callout: File Hash vs. File Name Never rely on a file name for investigation. File names are easily spoofed; an attacker can name a malicious binary svchost.exe and place it in a user's Downloads folder. Always pivot your investigation based on the SHA-256 hash or the file's unique path. The hash represents the actual code content, while the name is merely a label that can be changed by the attacker or the operating system.


Not read yet

The Anatomy of a Process Entity

Processes are the dynamic execution of files. While a file entity tells you what a piece of software is, a process entity tells you what it is doing. A process has a parent-child relationship with other processes, which is the most critical aspect of identifying malicious behavior.

Understanding Process Trees

When you view a process in the Defender portal, you will see a process tree. This visualization shows you exactly how a process was spawned. For example:

  1. outlook.exe (Parent)
  2. winword.exe (Child)
  3. powershell.exe (Grandchild)

In this scenario, a user opened an email attachment (Word document) which then spawned a PowerShell script. This is a classic indicator of a macro-based malware infection. By analyzing the process tree, you can trace the execution back to the initial entry point, such as a user-initiated download or a web browser navigation event.


Conducting the Investigation: Step-by-Step

When an alert lands on your desk, you need a repeatable process to ensure you don't miss details. Follow these steps to perform a deep-dive analysis.

Step 1: Analyze the Alert Context

Start by reading the alert description. Look for the "Tactics and Techniques" section, which maps the activity to the MITRE ATT&CK framework. This tells you the attacker's potential goal, such as "Credential Access" or "Persistence."

Step 2: Examine the File Metadata

Navigate to the file entity page. Check the prevalence and the signer. If the file has low prevalence, check the "File Origin" section to see where it was downloaded from. If the file origin is a web browser, check the URL.

Step 3: Investigate the Process Tree

Open the process tree view. Look for anomalies:

  • Unexpected Parenting: Why is cmd.exe being spawned by sqlservr.exe?
  • Suspicious Command Lines: Look for encoded PowerShell commands (e.g., -EncodedCommand or -e), or attempts to bypass execution policies (e.g., -ExecutionPolicy Bypass).
  • Network Connections: Check if the process attempted to connect to an external IP address, especially one associated with known command-and-control (C2) infrastructure.

Step 4: Use Advanced Hunting

If the standard alert page does not provide enough information, use Kusto Query Language (KQL) to hunt for similar activity across your fleet.

// Example: Find all processes spawned by Word or Excel in the last 24 hours
DeviceProcessEvents
| where InitiatingProcessFileName in ("winword.exe", "excel.exe")
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
| order by Timestamp desc

Note: Advanced Hunting is your most powerful tool for "blast radius" analysis. If you find one malicious process, use KQL to see if any other machines in your environment executed the same file or command line.


Not read yet

Practical Examples of Entity Analysis

Example 1: The PowerShell Obfuscation Case

An alert triggers for "Suspicious PowerShell command line." You see the command: powershell.exe -w hidden -enc JABzAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAEkATwAuAE0AZQBtAG8AcgB5AFMAdAByAGUAYQBtACgAWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAEgA...

This is base64 encoded. An analyst should not attempt to execute this. Instead, copy the string and decode it in a secure, offline environment or use a safe web-based tool. Once decoded, you might find it attempts to reach out to a specific domain. You then pivot to the DeviceNetworkEvents table to see if any other devices in your network attempted to contact that same domain.

Example 2: The Dropped Executable

An alert triggers for a file named update.exe being dropped in C:\Users\Public\. The file has no valid signature and a low prevalence.

  • Investigation: You check the process that dropped the file. It turns out to be browser.exe.
  • Action: You examine the browser history for that user. You find they visited a compromised site.
  • Mitigation: You block the file hash globally, isolate the affected machine, and initiate a password reset for the user, as the malware likely attempted to harvest credentials.

Not read yet

Best Practices for Entity Analysis

Effective analysis requires a balance of speed and thoroughness. Follow these industry standards to improve your workflow.

  1. Establish a Baseline: You cannot identify anomalies if you don't know what normal looks like. Spend time reviewing logs during "peace time" to understand the common administrative scripts and processes used in your environment.
  2. Use Threat Intelligence: Always cross-reference your findings with public threat intel. However, remember that public intel can be outdated. Your internal observations—such as the specific URL the process connected to—are often more valuable.
  3. Document Everything: Use the "Comments" section in the Microsoft Defender portal to document your findings. This is crucial for handovers between shifts or for post-incident reporting.
  4. Isolate, Don't Delete: A common mistake is to immediately delete a malicious file. While this stops the execution, it destroys the evidence. Use the "Isolate Device" feature to maintain network connectivity for investigation while preventing the threat from spreading or communicating with C2 servers.
  5. Think About Persistence: A process might be running, but it might have also created a scheduled task or a registry run key. Always check for persistence mechanisms after identifying a malicious process.

Warning: Never interact with a suspicious file or URL on a production machine. If you need to detonate a file to see what it does, use a dedicated, isolated sandbox environment that is not connected to your corporate network or identity provider.


Not read yet

Common Pitfalls and How to Avoid Them

Mistake 1: Relying Solely on Automated Alerts

Automated alerts are helpful, but they are not infallible. They can be triggered by false positives (e.g., a legitimate security scanner running a script). Always verify the alert's claims by looking at the raw telemetry.

Mistake 2: Ignoring the Parent Process

Analysts often fixate on the "bad" process (e.g., malware.exe) and forget to look at the process that started it. If you kill malware.exe but leave the parent process, the attacker might simply spawn it again.

Mistake 3: Failing to Check Network Telemetry

A file might look benign, but the fact that it is trying to communicate with a known malicious IP address in a different country is a huge indicator of compromise. Always pair file/process analysis with network event analysis.

Mistake 4: Over-reliance on File Hashes

Attackers can change a single bit in a file to generate a new hash. If you block a hash, you have only blocked that specific version of the file. Focus on behavioral indicators—such as the command line arguments or the network behavior—which are much harder for an attacker to change.


Not read yet

Quick Reference: Investigation Checklist

Investigation Phase Key Task Data Source
Initial Triage Verify if the alert is a false positive Alert Description, MITRE Mapping
Identity Identify the user account and device Device/User Entity pages
Execution Trace the parent-child process tree DeviceProcessEvents
Persistence Check for registry/scheduled task changes DeviceRegistryEvents, DeviceFileEvents
Communication Identify external connections DeviceNetworkEvents
Blast Radius Search for the file across the fleet Advanced Hunting (KQL)

Advanced Hunting: Deep Dive into KQL

When performing entity analysis, your ability to write efficient KQL queries is paramount. Let’s look at a few common scenarios.

Scenario: Detecting Lateral Movement

If you suspect an attacker is moving laterally, you should look for processes spawned by wmiprvse.exe or psexec.exe. These are common tools for remote execution.

DeviceProcessEvents
| where InitiatingProcessFileName in ("wmiprvse.exe", "psexec.exe")
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
| sort by Timestamp desc

Scenario: Detecting Fileless Malware

Fileless malware often resides in the registry or memory. You can look for suspicious registry modifications that point to scripts.

DeviceRegistryEvents
| where RegistryValueName in ("Run", "RunOnce")
| where RegistryValueData contains "powershell" or RegistryValueData contains "cmd"
| project Timestamp, DeviceName, RegistryKey, RegistryValueData

These queries allow you to pivot from a single suspicious file to a broader campaign across your organization. Always ensure you are filtering by time and device to keep your query results manageable.


Not read yet

The Human Element: When to Escalate

Entity analysis is not just a technical task; it is a judgment call. There will be times when the data is ambiguous. In these cases, follow your organization's escalation policy. If you have identified a process that is clearly attempting to exfiltrate data, do not wait for a "100% confirmation." Err on the side of caution. Isolate the device, reset credentials, and involve your incident response team.

Furthermore, maintain a healthy relationship with your IT operations team. They can provide context that the logs cannot. For example, they might be able to confirm if a specific "suspicious" script was actually part of a scheduled maintenance update that was poorly documented.

Conclusion: Key Takeaways

Mastering File and Process Entity Analysis is a foundational skill for any security analyst. By moving beyond the surface-level alerts and diving into the telemetry provided by Microsoft Defender for Endpoint, you become a defender who can stop threats before they reach their objective.

Here are the key takeaways for your toolkit:

  1. Context is King: Never judge a file by its name. Use hashes, paths, and parent-child relationships to build a complete picture of the activity.
  2. Follow the Tree: The process tree is your map to the origin of the threat. Always look at what spawned the process and what that process spawned in return.
  3. Leverage KQL: Advanced Hunting is not optional; it is essential for checking the blast radius of an incident across your entire environment.
  4. Prioritize Behavioral Indicators: File hashes are temporary; behavior is consistent. Focus on command-line arguments and network patterns, which are harder for attackers to obfuscate.
  5. Document and Communicate: Detailed notes in the security portal ensure that the entire team understands the investigation status and the logic behind your conclusions.
  6. Safety First: Always use isolated environments for detonating suspicious files and never interact with external links on production systems.
  7. Continuous Learning: The threat landscape changes daily. Keep your skills sharp by regularly reviewing new MITRE ATT&CK techniques and updating your hunting queries to match the latest attacker trends.

By consistently applying these methods, you transform from a passive observer of alerts into a proactive hunter of threats, significantly increasing the security posture of your organization. Keep practicing, keep questioning the telemetry, and remember that every investigation is an opportunity to learn the attacker's playbook.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.