Hunt for Malicious Script by Hash Across Devices in Microsoft Sentinel
During a threat hunt, an analyst discovers a PowerShell script that was executed on multiple workstations with encoded commands. The analyst wants to find all instances of this script across the environment. Which hunting method in Microsoft Sentinel is most effective?
Quick Answer
The answer is to search for the SHA256 hash of the script file in DeviceFileEvents. This is the most effective hunting method because DeviceFileEvents logs every file creation, modification, or deletion across all Windows devices, regardless of how the file was executed or where it was stored. By querying for the specific SHA256 hash, you capture every instance of that malicious script file on any endpoint, whether it was run from the Temp folder, downloaded via a browser, or executed directly from the command line. On the SC-200 exam, this question tests your understanding of the distinct purposes of Microsoft Sentinel’s hunting tables: DeviceFileEvents tracks file artifacts, while DeviceProcessEvents tracks execution events. A common trap is choosing a process-based table like DeviceProcessEvents, which would only find the script if it was actively run, missing dormant or quarantined copies. Remember the memory tip: “Hash the file, not the run”—always use DeviceFileEvents for file hash hunting.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Search for the SHA256 hash of the script file in DeviceFileEvents.
Searching for the SHA256 hash of the script file in DeviceFileEvents will find every file with that hash across all workstations, regardless of location or execution context. Option B is incorrect because the encoded command string in DeviceProcessEvents may vary per execution (e.g., different encoding or parameters) and won't capture all instances. Option C is incorrect because DeviceNetworkEvents only records network downloads; the script could have been copied via USB or other means. Option D is incorrect because the script may not reside in the Temp folder; it could be in any directory.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Search for the SHA256 hash of the script file in DeviceFileEvents.
Why this is correct
The file hash uniquely identifies the script regardless of filename or location.
- ✗
Search for the encoded command string in DeviceProcessEvents command line.
Why it's wrong here
The command may be encoded and not stored in plaintext.
- ✗
Search for the script in DeviceNetworkEvents as a downloaded file.
Why it's wrong here
The script might have been copied, not downloaded.
- ✗
Search for the script file name in DeviceFileEvents where the folder path contains 'Temp'.
Why it's wrong here
The script might not be in the Temp folder.
Go deeper
Related to this question
About these practice questions
One of 673 original SC-200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on SC-200
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. During a threat hunt, an analyst discovers a PowerShell script that was executed on multiple servers in the environment. The script connects to an external IP address and downloads a payload. The analyst wants to find all other servers that may have been compromised by the same script. What is the most efficient way to search for this across the environment?
medium- A.Use Sysmon Event ID 1 (process creation) to find PowerShell executions
- B.Review the network logs from the firewall for connections to the external IP
- ✓ C.Use the DeviceProcessEvents table in Microsoft Defender for Endpoint advanced hunting to search for the script's SHA256 hash or command line pattern
- D.Query the Windows Event Log for Event ID 4104 (PowerShell script block logging) on each server
Why C: It leverages Microsoft Defender for Endpoint's advanced hunting to centrally search for the script's SHA256 hash or command line pattern across all endpoints. Option A is incorrect because Sysmon may not be installed on all servers, and querying each server individually is inefficient. Option B is incorrect because network logs only show network connections and do not provide process execution details. Option D is incorrect because querying Event ID 4104 requires enabling PowerShell script block logging and accessing each server individually, which is less efficient than centralized hunting.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SC-200 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SC-200 exam.