2\ The file "filesystem.db" (enabled by default) tracks:
> fileCreated time
> fileLastAccessed time
Look for discrepancies in the fileCreated time in this DB file vs the times that "stat" show on a file.
There's also a correlating WAL that contains uncommitted data :3
3\ As you can see, this has caught an instance of timestomping where you can observe the creation time is after the access time.
You can query the db using this command:
sqlite3 *filesystem.db .dump | grep <filename>
4\ To make things juicier. Every time a file is created, two entries are pushed into TWO tables inside FileSystem.db:
> Nfo:FileDataObject
> Nie:DataObject
Across both of these tables, they track:
> fileCreated
> fileLastAccessed
> fileLastModified
5\ The blog covers how to timestomp without using "touch" and some other detection considerations :)
feet pics coming soon too... JOKEEEESSSSSSS
MUAHAHAHAHAA WILL NEVER SHOW U MY FEET NOW THAT I KNOW WHAT URE THINKING
xD xD xD
unless... 👉👈
• • •
Missing some Tweet in this thread? You can try to
force a refresh
This leaves OBVIOUS AF traces. Look for entries with zeros, and datetime defaulting to 1970. You can also review timestamps (covered in thread 4).
I highlighted in purple where you zero out the data in hex.
3\ Method 2: Overwriting the file
Overwrite the entire entry with a "cleaned" version. In this example I removed all lines pertaining to "sansforensics" logging in. Timestamp detection is the best method to discover this technique.
Look for processes in /proc/<PID>/exe where the path shows "(deleted)"
Here are two examples👇 1. BPFDoor deleted binary 2. An attacker abusing memfd_create() to exec their malware in RAM w/o dropping files to disk.
2\ To recover/extract these binaries running in memory - you can copying them out from this location:
/proc/<PID>/exe
Also as an FYI for memfd_create() abuse detection you can hunt for the "memfd: (deleted)" string directly.
3\ You can also review what command line spawned the pid by reviewing:
/proc/<PID>/cmdline
This screenshot shows the cmdline used for the memdf_create() reverse shell. There are a lot of other interesting things you can also review in /proc/PID
2\ Most IR analysts are taught to detect timestomping using two methods:
> Compare $FI vs $SI times in the MFT
> Look for 0s in timestamp nanoseconds
These two detections are NOT foolproof - they will catch simple cases. Attackers can set nanoseconds and modify $FN time!
3\ Why should you care?
Most forensic courses teach these 2 detections without introducing more variables. A lot of analysts treat what they are taught as the "bible" without questioning it and when it comes to detecting these anomalies... critical evidence may be missed.
2\ Each process in Windows is represented by an "EPROCESS" structure.
These EPROCESS blocks are joined in a doubly linked list structure. The flink (forward link) tells you the next process running and blink (backwards link) tells you the previous process.
3\ When you see a list of processes on a live system, often times this is gathered by walking this doubly-linked structure of EPROCESS blocks.
Of course malware can unlink a process in this doubly linked list to hide from detection :P