pip install binarysniffergit clone https://github.com/SemClone/binarysniffer
cd binarysniffer
pip install -e .pip install binarysniffer[fast]Includes TLSH for detecting modified/recompiled components:
pip install binarysniffer[fuzzy]Includes support for 7z, RAR, DEB, RPM formats:
pip install binarysniffer[archives]Includes Androguard for advanced APK analysis:
pip install binarysniffer[android]BinarySniffer can leverage external tools when available to provide enhanced analysis capabilities. These tools are optional - the core functionality works without them, but installing them unlocks additional features.
| Format | Python Package | System Tool (Alternative) | Fallback |
|---|---|---|---|
| 7z | py7zr (included) | 7-Zip | - |
| RAR | rarfile (included) | unrar | 7-Zip |
| DEB | python-debian (included) | ar | 7-Zip |
| RPM | - | rpm2cpio | 7-Zip |
| ZIP/JAR | Built-in | - | - |
| TAR/GZ | Built-in | - | - |
Enables: Extraction and analysis of Windows installers, macOS packages, and additional compressed formats
# macOS
brew install p7zip
# Ubuntu/Debian
sudo apt-get install p7zip-full
# Windows
# Download from https://www.7-zip.org/Benefits:
- Analyze Windows installers (.exe, .msi) by extracting embedded components
- Analyze macOS installers (.pkg, .dmg) to detect bundled frameworks
- Support for NSIS, InnoSetup, and other installer formats
- Extract and analyze self-extracting archives
- Support for additional archive formats (RAR, CAB, ISO, etc.)
When using the [archives] installation option, these tools enhance format support:
# For DEB packages (Debian/Ubuntu)
# Option 1: Install python-debian (included with [archives])
pip install binarysniffer[archives]
# Option 2: Use system ar command (usually pre-installed)
# Ubuntu/Debian
which ar # Check if available
# macOS
# ar is included with Xcode Command Line Tools
xcode-select --install # If not already installed# For RPM packages (Red Hat/Fedora/CentOS)
# Option 1: Install rpm2cpio
# Ubuntu/Debian
sudo apt-get install rpm2cpio
# macOS
brew install rpm2cpio
# Fedora/RHEL/CentOS
# rpm2cpio is usually pre-installed
# Option 2: Falls back to 7-Zip if availableThe [archives] option includes Python libraries for:
- 7z files: py7zr (pure Python, no external tools needed)
- RAR files: rarfile (requires unrar tool)
# Install unrar for RAR support # Ubuntu/Debian sudo apt-get install unrar # macOS brew install unrar # Note: Falls back to 7-Zip if unrar not available
Enables: Enhanced source code analysis with semantic understanding
# macOS
brew install universal-ctags
# Ubuntu/Debian
sudo apt-get install universal-ctags
# Windows
# Download from https://github.com/universal-ctags/ctags-win32/releasesBenefits:
- Better function/class/method detection in source code
- Multi-language semantic analysis
- More accurate symbol extraction
- Improved signature matching for source code components
Without 7-Zip:
$ binarysniffer analyze installer.exe
# Analyzes as compressed binary - limited detectionWith 7-Zip installed:
# Windows installers
$ binarysniffer analyze installer.exe
$ binarysniffer analyze setup.msi
# Automatically extracts and analyzes contents
# Detects: Qt5, OpenSSL, SQLite, ICU, libpng, etc.
# macOS installers
$ binarysniffer analyze app.pkg
$ binarysniffer analyze app.dmg
# Automatically extracts and analyzes contents
# Detects: Qt5, WebKit, OpenCV, React Native, etc.If you encounter import errors, ensure all dependencies are installed:
pip install --upgrade semantic-copycat-binarysnifferIf CTags is not found, the tool will fallback to regex extraction. Install universal-ctags for enhanced source code analysis.
For archive-related errors, install the appropriate system tools or use the [archives] extra:
pip install binarysniffer[archives]For large archives, the tool limits file processing to prevent OOM. You can adjust limits in ~/.binarysniffer/config.json.
- Use Homebrew for system tools:
brew install p7zip universal-ctags unrar - Xcode Command Line Tools required for some features
- Most distributions have required tools in standard repositories
- Use package manager (apt, yum, dnf) for system tools
- Download installers from official websites
- Add tools to PATH for command-line access
- Consider using WSL for better compatibility