Overview
The FileInfo command retrieves detailed information about one or more files on the system. It extracts file metadata including version information, timestamps, digital signatures, basic Portable Executable (PE) information, and file attributes. This is useful for identifying suspicious executables, verifying file authenticity, and gathering forensic information.Syntax
Arguments
- file_path (required) - Full path to the file(s) to analyze. Multiple paths can be specified separated by spaces.
Examples
Output
The command returns:- File path
- File size
- File creation time
- File last access time
- File last write time
- File attributes (Hidden, System, ReadOnly, etc.)
- File version information
- Product name
- Product version
- File version
- Company name
- Copyright
- Original filename
- File description
- Digital signature status
- Signer information (if signed)
- Basic PE information (for executables)
- PE type (32-bit/64-bit)
- Compilation timestamp
- Import Address Table (IAT) details
Use Cases
Red Team
- Verify authenticity of system binaries before exploitation
- Identify legitimate signed binaries for Living off the Land attacks
- Analyze target executable characteristics for exploitation planning
- Identify unsigned or suspicious executables
- Gather intelligence on installed software versions
- Identify vulnerable software based on version information
- Verify DLL hijacking targets
Blue Team
- Investigate suspicious executables during incident response
- Verify file integrity and digital signatures
- Identify tampered or malicious system files
- Gather forensic evidence about file origins
- Validate software inventory and versions
- Detect unsigned executables in sensitive directories
- Identify files with suspicious metadata or timestamps
- Correlate file information with malware indicators
- Verify patch levels of critical system components
Example Output
Performance Considerations
This command has minimal performance impact when analyzing a small number of files. Performance depends on:- Number of files specified
- File sizes being analyzed
- Whether files are digitally signed (signature verification takes additional time)
- Disk I/O performance
Remote Execution
This command does not support remote execution. File analysis must be performed on the local system where the files reside.Detection Considerations
Indicators
- File access operations on executables and system binaries
- Reading of file metadata and version information
- Digital signature verification attempts
- Access to PE headers of executable files
- Unusual processes reading multiple executable files
Defensive Recommendations
- Monitor for mass file metadata enumeration
- Alert on access to sensitive system binaries by unauthorized processes
- Log file access patterns for forensic analysis
- Implement least privilege to restrict file system access
- Use AppLocker or similar to control execution of enumeration tools
- Monitor for unusual reads of executable file headers
- Track processes performing signature validation on multiple files
Related Commands
- InterestingFiles - “Interesting” files matching various patterns in the user’s folder
- LOLBAS - Locates Living Off The Land Binaries and Scripts on the system
- Processes - Running processes with file info company names
- Services - Services with file info company names
- dir - Lists files/folders in specified directories