This article is an overview of possible anti-forensics.
Timestomping
On NTFS, discrepancies between $STANDARD_INFORMATION
and one or two $FILE_NAME
attributes’ MACB timestamps could indicate timestomping.
π€ How to detect timestomping techniques?
$FILE_NAME
β° vs $STANDARD_INFORMATION
β°. Can be detected with π οΈ mftecmf
, π οΈ fls
, π οΈ istat
and π οΈ FTK imager
.
NTFS timestamps are very precise and have fractional seconds as well. Typically, you’d expect them to be something other than all zeroes. π οΈ mftecmf
and π οΈ istat
.
If πΊ ShimCache timestamp > $STANDARD_INFORMATION
modified timestamp. π οΈ mftecmf
, π οΈ fls
, π οΈ istat
and π οΈ FTK imager
for the $STANDARD_INFORMATION
and π οΈ ShimCacheParser.py
or π οΈ AppCompatCacheParser.py
.
Check if compile time β° > $STANDARD_INFORMATION
. π οΈ sigcheck
and π οΈ ExifTool
.
Check $I30
as well.
Check MFT for records with similar entry numbers. NTFS tends to assign subsequent MFT records within a short period of time.
π€ Imagine you have several files, and one of them was likely been tampered with. How do you decide which one? Look at the groups of files created roughly within the same time and look at the MFT numbers. If they are too different, it’s something to look into more. For example, a file has timestamps like most of the files created at the same time, but the MFT number is very low. Also,
$STANDARD_INFORMATION
timestamps (NTFS) and$FILE_NAME
timestamps usually match and the milliseconds fraction should not be all zeroes.
File Delete/Wiping
π οΈ sdelete
(more about the forensic footprint of the tool here). Wipes files, directories and free space. This is what this tool’s activity looks like:
As you can see, files are renamed with a peculiar pattern first. Each new file is renamed to the subsequent letter so that the first file is renamed with A
s, the second with B
s etc.
π οΈ bcwipe
π° (commercial). Clears $I30
slack and MFT records. Renames files once with a random name equal in size to the original. Check $UsnJrnl
, $LogFile
, and πΊ execution artefacts. π C:\ProgramData\Microsoft\Search\Data\Applications\Windows\GatherLogs\SystemIndex
contains πΊ .gthr
gather log that’s used to index files for better search performance (used by Windows Search index). Windows Search index uses $UsrJrnl
to track changes made to the system. Even when files were deleted and wiped, .gthr
log, $UsrJrnl
, $I30
can be used to confirm, at least, that the file existed and even recover some data from it. Also, πΊ Prefetch file for sdelete
or any other wiping tool could indicate that some wiping occurred.
π οΈ Eraser (open-source). Renamed MFT records (with ADS, if present), $130 slack, $UsnJrnl, $LogFile, and βEvidence of Executionβ artefacts persist
π οΈ Cipher (built-in on Windows). Includes a feature to overwrite free space (not individual files). βοΈCreates a persistent directory named EFSTMPWP
at the volume root and adds temp files to fill free space. Also, LOL.bin
is sometimes used for cleanup.
π cipher.exe /w:<drive>
π οΈ CCleaner
For Windows Registry recovery, use π οΈ Registry Explorer
. It can process unallocated space for deleted keys. It can also spot anomalies to spot fileless malware hiding the registry. It can detect both large values and base64 encoded strings.
One can also use carving to look for specific data across various artefacts. It’s useful when the metadata is reused and no longer exists for the file.
π icat -r image inode # recover with metadata method
π tsk_recover image outputdir
# Carving methods
π photorec # win, lin, mac, 300+ file signatures. Uses metadata from the carved files.
π
You can also utilise Volume Shadow Copies to restore deleted files. π οΈ vss_carver.py
can be used for that.
π vss_carver -t RAW -i /nrnt/ewf_mount/ewf1 -o 0 -c -/vsscarve-basefile/catalog -s -/vsscarve-basefile/store
π vss_catalog_manipulator list -/vsscarve-basefile/catalog
π vshadoranount -o 0 -c -/vsscarve-basefile/catalog -s -/vsscarve-basefile/store
π cd /mnt/vsscarveJaasefile/ _
π for i in vss*; do rrountwin $i /mnt/shadowcarve basefile/$i; done
Yet another way to recover files is to use π οΈ bulk_extractor-rec
to carve for Event logs.
evtx
-EVTX
file andEVTX
chunks (with generated file header)ntfsindx
-INDX
records ofSINDEXALLOCATION
attributentfslogfile
- RSTR/RCRD records of SLogFilentfsmft
-FILE
records of$MFT
ntfsusn
-USNRECORD
structure of$UsnJml:$J
utmp
-utmp
structure records
π blkls [options] image > image.unallocated
The last carving resort - strings
, bstrings
(Windows) and grep
.
Encryption
Fileless Malware
Malware of that type is still not 100% fileless. What it means is that the main code is not written to disk, but the loader still needs to be present on the disk. most often it’s a PowerShell script or WMI on Windows machines.
Registry/Config
Keys can be deleted or wiped. Also, the registry might be utilised to hide scripts.
Logs Tampering and Deletion
With Event logs on Windows, one can even insert bogus events using the WinAPI.