Skip to main content
Splunk Lantern

Detecting Windows file extension abuse

Attackers can make users run malicious code or persist on an endpoint by targeting file extensions that users are familiar with. For example, if users see that a file ends in .doc or .docx, they will assume that it is a Microsoft Word document and expect that double-clicking will open it using winword.exe. The user will typically also assume that the .docx file is safe. Attackers take advantage of this expectation by obfuscating the true file extension. 

These searches help you detect this type of abuse of file extensions and Windows file associations by searching for the execution of files with multiple extensions in the file name, a common technique used by attackers to obscure the true file extension.

​Required data

How to use Splunk software for this use case

This search looks for processes launched from files that have double extensions in the file name. This is typically done to obscure the true file extension and make it appear as though the file being accessed is a data file, as opposed to executable content.

| tstats summariesonly=false allow_old_summaries=true count, min(_time) AS firstTime, max(_time) AS lastTime FROM datamodel=Endpoint.Processes WHERE ("Processes.process"=*.doc.exe OR "Processes.process"=*.htm.exe OR "Processes.process"=*.html.exe OR "Processes.process"=*.txt.exe OR "Processes.process"=*.pdf.exe OR "Processes.process"=*.doc.exe) BY "Processes.dest", "Processes.user", "Processes.process", "Processes.parent_process" 
| convert timeformat="%Y-%m-%dT%H:%M:%S" ctime(firstTime) 
| convert timeformat="%Y-%m-%dT%H:%M:%S" ctime(lastTime) 
| rename "Processes.*" AS "*

Next steps

The content in this article comes from Splunk Enterprise Security (ES). As a Splunk premium security solution, ES solves a wide range of security analytics and operations use cases including continuous security monitoring, advanced threat detection, compliance, incident investigation, forensics and incident response. Splunk ES delivers an end-to-end view of an organization's security posture with flexible investigations, unmatched performance, and the most flexible deployment options offered in the cloud, on-premises, or hybrid deployment models. If you have questions about this use case, see the Security Research team's support options on GitHub.

In addition, these Splunk resources might help you understand and implement this use case:

Need technical help? Explore our customer success resources to find education and training, engage experts through OnDemand services, view support options, and more.