Keeping an Eye on Malicious Files Life Time

Published: 2020-05-06
Last Updated: 2020-05-06 06:13:33 UTC
by Xavier Mertens (Version: 1)
2 comment(s)

We know that today's malware campaigns are based on fresh files. Each piece of malware has a unique hash and it makes the detection based on lists of hashes not very useful these days. But can we spot some malicious files coming on stage regularly or, suddenly, just popping up from nowhere?

I'm using VirusTotal to hunt for malicious files based on a bunch of YARA rules and, via the VT API, everything is indexed into a Splunk instance. Here is a sample of detected malicious file:

You can see two interesting fields (well, all of them are interesting):

  • first_seen
  • last_seen

It could be interesting to have a look at the "age" of a file from a VT point of view. By computing the time difference between the two timestamps, we could see if a file is in the wild for a while or a brand new one...

Here is the base query that I performed:

index=virustotal sourcetype=_json
| spath first_seen | spath last_seen | spath sha256 | spath type | spath positives
| dedup sha256
| eval i = strptime(first_seen, "%Y-%m-%d %H:%M:%S") 
| eval o = strptime(last_seen, "%Y-%m-%d %H:%M:%S") 
| eval age = tostring((o - i), "duration") 
| search positives > 5
| sort - age
| table sha256,type,positives,first_seen,last_seen, age

I'm searching only for files detected as malicious (score > 5) from 2019/01/01 until today (16 months). Here are some findings:

  • 8042 files have matched my YARA rules
  • The oldest file is 1b441fde04d361a6fd7fbd83e969014622453c263107ce2bed87ad0bff7cf13f[1]. It's the famous 'Invoke-Mimikatz.ps1'. It was first uploaded to VT on 2015-11-05 15:27:45. The last submission was on 2019-04-04 10:40:30.
  • 7698 files were uploaded only one time (age = 0) (95%)

Here is the split of file types for malicious files that have been uploaded more than one time (age > 0):

The file type 'Text' means all kinds of scripting languages (mainly PowerShell).  Note that the number of malicious Word documents is interesting! (3rd position). 

Here is the overview of ages (in hours):

At the opposite, we can also spot malware campaigns just released on the wild (ex: new waves of phishing) because the age remains very low. Many samples have an age of approximatively one hour:

 

As you can see, most of the samples uploaded to VT are "fresh meat" (new hash) but many of them are coming back regularly... Reasons can be multiple: security researchers resubmitting files, red-teams testing if the score of old samples, old emails reopened with attachments? 

Stay safe!

[1] https://www.virustotal.com/gui/file/1b441fde04d361a6fd7fbd83e969014622453c263107ce2bed87ad0bff7cf13f/detection

Xavier Mertens (@xme)
Senior ISC Handler - Freelance Cyber Security Consultant
PGP Key

2 comment(s)
ISC Stormcast For Wednesday, May 6th 2020 https://isc.sans.edu/podcastdetail.html?id=6984

Comments

What's this all about ..?
password reveal .
<a hreaf="https://technolytical.com/">the social network</a> is described as follows because they respect your privacy and keep your data secure:

<a hreaf="https://technolytical.com/">the social network</a> is described as follows because they respect your privacy and keep your data secure. The social networks are not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go.

<a hreaf="https://technolytical.com/">the social network</a> is not interested in collecting data about you. They don't care about what you're doing, or what you like. They don't want to know who you talk to, or where you go. The social networks only collect the minimum amount of information required for the service that they provide. Your personal information is kept private, and is never shared with other companies without your permission
https://thehomestore.com.pk/
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> nearest public toilet to me</a>
<a hreaf="https://defineprogramming.com/the-public-bathroom-near-me-find-nearest-public-toilet/"> public bathroom near me</a>
https://defineprogramming.com/
https://defineprogramming.com/
Enter comment here... a fake TeamViewer page, and that page led to a different type of malware. This week's infection involved a downloaded JavaScript (.js) file that led to Microsoft Installer packages (.msi files) containing other script that used free or open source programs.
distribute malware. Even if the URL listed on the ad shows a legitimate website, subsequent ad traffic can easily lead to a fake page. Different types of malware are distributed in this manner. I've seen IcedID (Bokbot), Gozi/ISFB, and various information stealers distributed through fake software websites that were provided through Google ad traffic. I submitted malicious files from this example to VirusTotal and found a low rate of detection, with some files not showing as malware at all. Additionally, domains associated with this infection frequently change. That might make it hard to detect.
https://clickercounter.org/
Enter corthrthmment here...

Diary Archives