Skip to main content
Splunk Lantern

File downloaded to a machine from a website

 

​​​​​​​​A user’s system has been infected with ransomware. You suspect that the source was a file the user downloaded from a suspicious website.

Procedure  

This sample search uses Stream HTTP data. You can replace this source with any other deep packet inspection data used in your organization.

  1. Run the following search. You can optimize it by specifying an index and adjusting the time range.
sourcetype=stream:http src=<IP address of infected machine>
|stats count values(url) BY dest
  1. Review the results for values that you find suspicious. Research key attributes. Many security firms blog about popular implementations of ransomware or malware.
  2. After you have identified a suspicious file type, corroborate your findings using other sourcetypes. For example, if you found the suspicious file mhtr.jpg, you might search:
sourcetype=suricata src=<IP address of infected machine> url=<the suspicious URL identified in the previous search>
|stats count values(url) BY dest

Search explanation

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.

Splunk Search Explanation

sourcetype=stream:http 

Search only web traffic data from Splunk Stream logs.

src=<IP address of infected machine>

Search logs coming from the infected machine.

|stats count values(url) BY dest

Return all visited URLs, grouped by destination IP address, with a total count.

Next steps

The results show files that were downloaded to the user’s machine as a result of websites he visited. If you see the suspicious file associated with the same domains across multiple log source types, you can have a fair amount of confidence that it’s the file you want. Research suspicious file names to see if they have been reported elsewhere. When you know more about the file, you can determine the appropriate steps to take.  

Finally, you might be interested in other processes associated with the Investigating a ransomware attack use case.