Velociraptor offers a number of plugins to access detailed information about NTFS:
parse_mft()
: parses each MFT entry and returns high level metadata
about the entry - including reconstruct the full path of the entry
by traversing parent MFT entries.parse_ntfs()
: Given an MFT ID this function will display
information about the various streams (e.g. $DATA
, $Filename
etc)parse_ntfs_i30()
: This scans the $i30
stream in directories to
recover potentially deleted entries.Parse the MFT using Windows.NTFS.MFT
To automatically prep your machine run this script:
### NTFS exercise setup
## 1. download some files to test various content and add ADS to simulate manual download from a browser
$downloads = (
"https://live.sysinternals.com/PsExec64.exe",
"https://live.sysinternals.com/procdump64.exe",
"https://live.sysinternals.com/sdelete64.exe"
)
foreach ( $url in $downloads){
"Downloading " + $Url
$file = Split-Path $Url -Leaf
$dest = "C:\PerfLogs\" +$file
$ads = "[ZoneTransfer]`r`nZoneId=3`r`nReferrerUrl=https://18.220.58.123/yolo/`r`nHostUrl=https://18.220.58.123/yolo/" + $file + "`r`n"
Remove-Item -Path $dest -force -ErrorAction SilentlyContinue
Invoke-WebRequest -Uri $Url -OutFile $dest -UseBasicParsing
Set-Content -Path $dest":Zone.Identifier" $ads
}
## 2.Create a PS1 file in staging folder (any text will do but this is powershell extension)
echo "Write-Host ‘this is totally a resident file’" > C:\Perflogs\test.ps1
## 3.Modify shortname on a file
fsutil file setshortname C:\PerfLogs\psexec64.exe fake.exe
## 4. Create a process dumpOpen calculator (calc.exe)
calc.exe ; start-sleep 2
C:\PerfLogs\procdump64.exe -accepteula -ma win32calc C:\PerfLogs\calc.dmp
get-process | where-object { $_.Name -like "*win32calc*" } | Stop-Process
## 5. Create a zip file in staging folder
Compress-Archive -Path C:\PerfLogs\* -DestinationPath C:\PerfLogs\exfil.zip -CompressionLevel Fastest
## 6. Delete dmp,zip and ps1 files - deleted file discovery is important for later!
Remove-Item -Path C:\PerfLogs\*.zip, C:\PerfLogs\*.dmp, C:\PerfLogs\*.ps1
Find contents of C:\Perflogs
Review metadata of objects
Explore leveraging filters
Can you find the deleted files?
Windows.Forensics.Usn
with filters looking for suspicious
extensions in our staging location!Target C:\PerfLogs
with the PathRegex
field.
Windows.Analysis. EvidenceOfDownload
to identify downloaded
files and unpacked ZIP files.