A suspicious executable has been uploaded to your web server. You want to find the MD5 hash of the executable so you can investigate further.
- Microsoft: Sysmon
Run the following search. You can optimize it by specifying an index and adjusting the time range.
"<name of executable>" sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventCode=1 CommandLine="<name of executable>" |stats values(MD5)
The table provides an explanation of what each part of this search achieves. You can adjust this query based on the specifics of your environment.
"<name of executable>"
Search for the executable.
Search Sysmon operational logs.
Sysmon can create many types of logs. As your organization scales, you’ll want to be wise with the kinds of events Sysmon captures. SwiftOnSecurity offers a popular XML configuration file.
Search for process creation events. The MD5 hash is captured when the process launches.
CommandLine="<name of executable>"
Search for the process that spawned the .exe.
Show values for the MD5 field.
If there are different versions of executables compiled, you might get a number of MD5 values. Use whitelisting to isolate known good hashes and then continue your investigation with what remains. You can also use open source intelligence (OSINT) to find additional metadata for the MD5 hash that can help your investigation.
Finally, you might be interested in other processes associated with these use cases.