Inspektor is a cross-platform Python desktop application / cli / Windows service that helps you analyze files by checking their binary content for known signatures.

- Load multiple files for inspection
- Check files against customizable hex signatures (e.g., "50 4B 03 04")
- Check files against customizable text signatures (e.g., "encrypted", "voltage")
- Toggle between matching any or all text signatures
- Efficient parallel processing using multiprocessing
- User-friendly desktop interface with results table
- Clone this repository:
git clone https://github.com/yourusername/inspektor.git
cd inspektor
- Create a virtual environment (optional but recommended):
python -m venv .venv
-
Activate the virtual environment:
- Windows:
.venv\Scripts\activate- macOS/Linux:
source .venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
- Run the application in GUI mode:
python inspektor.py
The application can also be run in command-line mode, which is useful for automated monitoring or running as a service:
.\inspektor.exe --mode=auto --scan_dir="F:\test" --hex_signatures="504B0304,504B0506,4D5A,504" --text_signatures="instrument,apple" --match_all --file_extensions=".docx,.xlsx,.pdf" --max_load_bytes="1024" --move_files_path="F:\matches" --log_dir="F:\logs"
--mode: Operation mode (currently only 'auto' is supported)--scan_dir: Directory to scan and monitor (required)--file_extensions: Comma-separated list of file extensions to scan (e.g., ".txt,.pdf,.docx"). Leave empty, use ".", or ".*" to scan all files--hex_signatures: Comma-separated list of hex signatures--text_signatures: Comma-separated list of text signatures--match_all: Whether all text signatures must match--max_load_bytes: Maximum number of bytes to load from each file (default: 1024)--move_files_path: Custom directory path where matched files will be moved (default: "matches" subfolder in scan directory)--log_dir: Directory to store log files (default: application directory)
python inspektor.py --mode auto --scan_dir "C:\Documents\incoming" --hex_signatures "50 4B 03 04" --text_signatures "encrypted,password" --file_extensions ".docx,.xlsx,.pdf"
This command will:
- Monitor the "C:\Documents\incoming" directory
- Check for files with .docx, .xlsx, or .pdf extensions
- Look for the ZIP file signature (50 4B 03 04) and text containing "encrypted" or "password"
- Move matching files to a "matches" subdirectory within the scan directory
python inspektor.py --mode auto --scan_dir "C:\Documents\incoming" --hex_signatures "50 4B 03 04" --text_signatures "encrypted,password" --move_files_path "D:\MatchedFiles"
This command will:
- Monitor the "C:\Documents\incoming" directory
- Look for the ZIP file signature (50 4B 03 04) and text containing "encrypted" or "password"
- Move matching files to the "D:\MatchedFiles" directory instead of the default "matches" subdirectory
You can run Inspektor as a Windows service using NSSM (Non-Sucking Service Manager):
-
Download NSSM from nssm.cc
-
Extract the appropriate executable (nssm.exe) for your system architecture (32-bit or 64-bit)
-
Open Command Prompt as Administrator and navigate to the directory containing nssm.exe
-
Install the service with the following command:
nssm.exe install InspektorService
Note for Powershell: .\nssm.exe install InspektorService
-
In the NSSM service installer dialog:
- Path: Enter the full path to your Python executable or the standalone Inspektor.exe
- Startup directory: Enter the directory containing inspektor.py or the executable
- Arguments: If using Python, add
inspektor.pyfollowed by your CLI arguments
Example for Python:
Path: C:\Python39\python.exe Startup directory: C:\path\to\inspektor Arguments: inspektor.py --mode auto --scan_dir "C:\Documents\incoming" --hex_signatures "50 4B 03 04" --text_signatures "encrypted,password" --move_files_path "D:\MatchedFiles"Example for standalone executable:
Path: C:\path\to\inspektor\dist\inspektor.exe Startup directory: C:\path\to\inspektor\dist Arguments: --mode=auto --scan_dir="F:\test" --hex_signatures="504B0304,504B0506,4D5A,504" --text_signatures="instrument,apple" --match_all --file_extensions=".docx,.xlsx,.pdf" --max_load_bytes="1024" --move_files_path="F:\matches" --log_dir="F:\logs" -
Configure other service settings as needed (service name, description, startup type, etc.)
-
Click "Install service"
You can also install the service directly from the command line:
nssm.exe install InspektorService "C:\path\to\inspektor\dist\inspektor.exe" "--mode auto --scan_dir \"C:\Documents\incoming\" --hex_signatures \"50 4B 03 04\" --text_signatures \"encrypted,password\" --move_files_path \"D:\MatchedFiles\""
To set the service description:
nssm.exe set InspektorService Description "Inspektor file monitoring service"
To set the service to start automatically:
nssm.exe set InspektorService Start SERVICE_AUTO_START
To start the service:
nssm.exe start InspektorService
To remove the service:
nssm.exe remove InspektorService confirm
You can create a standalone executable file that doesn't require Python to be installed:
- Make sure you have installed the requirements:
pip install -r requirements.txt
- Run the build script:
python build_exe.py
-
Once the build process completes, you'll find the executable in the
distfolder. -
You can distribute the executable file (
inspektor.exeon Windows) to users who don't have Python installed. -
When running the executable in CLI mode, the application will automatically show console output, allowing you to see logs and status messages directly in the command prompt or terminal window:
inspektor.exe --mode auto --scan_dir "C:\path\to\monitor" --hex_signatures "50 4B 03 04" --text_signatures "encrypted"
-
Use the sidebar to:
- Enter hex signatures in the "Hex Signatures" multiline box (one per line)
- Enter text signatures in the "Text Signatures" multiline box (one per line)
- Check "Match All Text Signatures" if all text signatures must be found (otherwise, any match is sufficient)
- Click "Select Files" to choose files for inspection
- Click "Analyze Files" to process the selected files
-
View the results in the main table:
- Filename: Name of the analyzed file
- Has Hex Signature: Whether any hex signatures were found
- Text Match: Whether text signatures were found according to the match criteria
- Hex Matches: List of matched hex signatures
- Text Matches: List of matched text signatures
- Files are checked for hex signatures (binary patterns)
- Files are checked for text signatures (text patterns)
- Results show which files match the specified signatures
Default Signatures info
The application comes with default signatures for ZIP file formats and related formats:
- 50 4B 03 04 (ZIP)
- 50 4B 05 06 (Empty archive)
- 50 4B 07 08 (Spanned archive)
These signatures can help identify various file formats based on the ZIP format, such as:
- EPUB
- JAR
- ODF
- OOXML
- DOCX
- XLSX
- and many more