Virtual File System Manipulation
You'll learn how rootkits hide files and directories by filtering what the operating system's file system shows to users and security tools.
The Invisible Files Trick
After learning about IAT/EAT hooking, you now understand how malware can intercept function calls. Virtual File System (VFS) manipulation takes this concept to the file system level. Instead of modifying actual files on disk, a rootkit intercepts the operating system's directory listing and file access functions to selectively hide malicious files from view.
Think of it like a dishonest librarian: the books are physically on the shelves, but when you ask for the catalog, the librarian omits certain titles from the list they hand you. The files exist on disk—forensic tools reading raw disk sectors can still find them—but normal system calls return filtered results.
How It Works
A rootkit hooks file system functions like NtQueryDirectoryFile (Windows) or readdir (Linux). When a user or program requests a directory listing, the hook:
- Calls the original function to get the complete file list
- Scans the results for specific filenames or patterns (e.g., "evil.exe" or files starting with "rootkit_")
- Removes matching entries from the list
- Returns the filtered results to the caller
The same technique applies to file opening, attribute queries, and other file system operations. If a program tries to open a hidden file directly by name, the hook can return "file not found" even though it exists.
Detection Challenges
This manipulation occurs in kernel space or through deep system hooks, making it invisible to user-mode antivirus scanners using standard API calls. Only tools that bypass the VFS—reading raw disk sectors or using alternative kernel-level inspection—can detect the hidden files.
Key Takeaway: Virtual File System manipulation hides malicious files by filtering directory listings and file access results, creating "invisible" files that exist on disk but don't appear through normal system calls.