Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save randomaccess3/225a27eb24e6a812e760b582e9977015 to your computer and use it in GitHub Desktop.

Select an option

Save randomaccess3/225a27eb24e6a812e760b582e9977015 to your computer and use it in GitHub Desktop.
Velociraptor - fast file collector
name: Custom.Windows.NTFS.MFT.FilesMatchingKeywords
description: |
This artifact scans the $MFT file on the host showing all files
within the MFT and collects those that match the given list.
parameters:
- name: MFTFilename
default: "C:/$MFT"
- name: Accessor
default: ntfs
- name: filenameRegex
type: hidden
default: |
Keyword
a.exe
b.exe
c.exe
sources:
- query: |
LET keywords = SELECT Keyword from parse_csv(filename=filenameRegex, accessor="data")
LET regex <= SELECT "(" + join(array=keywords.Keyword, sep="|") + ")" AS regex FROM scope()
SELECT *, upload(file="C:/" + FullPath) AS Upload
FROM parse_mft(filename=MFTFilename, accessor=Accessor)
WHERE FileName =~ (regex[0]).regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment