ViperScan is a Python-based command-line malware analysis tool designed for quick static analysis of suspicious files.
It combines local file analysis with optional YARA scanning and VirusTotal integration, providing useful information such as hashes, entropy, embedded indicators, binary metadata, and detection results directly from the terminal.
Current version: 0.1.1
ViperScan can analyse individual files or entire directories and collect:
- File size and extension
- MIME type
- File format detection
- File entropy
- MD5 hash
- SHA-1 hash
- SHA-256 hash
Supported format detection currently includes:
- PE / Windows executables
- ELF / Linux executables
- Mach-O / macOS binaries
- ZIP archives
- PDF files
- Unknown/raw files
ViperScan performs additional analysis when a supported executable format is detected.
- Architecture detection
- Windows subsystem information
- Compilation timestamp
- PE section analysis
- Section entropy
- Executable section detection
- Imported DLLs and functions
- Detection of interesting API imports
- Basic packed-binary indicators
Interesting APIs include functions commonly seen during malware analysis such as:
VirtualAlloc, VirtualProtect, WriteProcessMemory, CreateRemoteThread, LoadLibrary, GetProcAddress, and others.
- Architecture
- ELF file type
- Entry point
- Interpreter
- Linked libraries
- Section information
- CPU architecture
- Mach-O file type
- Loaded dynamic libraries
- Runtime paths
- Multi-architecture/FAT binary detection
ViperScan extracts ASCII and UTF-16 strings and searches them for potentially useful indicators.
Currently detected indicators include:
- π URLs
- π§ Email addresses
- π IPv4 addresses
- πͺ Windows Registry paths
β οΈ Suspicious commands and API names
Examples of suspicious strings include:
powershell
cmd.exe
rundll32
regsvr32
CreateRemoteThread
VirtualAlloc
WriteProcessMemory
/bin/sh
/bin/bash
ViperScan supports scanning files with custom YARA rules.
You can provide either:
- A single
.yar/.yarafile - A directory containing multiple YARA rules
Example:
viperscan scan suspicious.exe --yara rules/Or:
python -m viperscan scan suspicious.exe --yara rules/YARA results include:
- Rule name
- Namespace
- Tags
- Rule metadata
YARA functionality requires
yara-python.
ViperScan can query the VirusTotal API for a scanned file.
viperscan scan suspicious.exe --vtBy default, if the file's SHA-256 hash is not already known to VirusTotal, ViperScan uploads the entire file for analysis. To only ever send the file's hash and never upload the file, use --vt-hash-only:
viperscan scan suspicious.exe --vt-hash-onlyThis is useful for files larger than VirusTotal's public upload limit, which would otherwise fail to upload.
VirusTotal results can include:
- Malicious detections
- Suspicious detections
- Undetected results
- Harmless results
- File type information
β οΈ Privacy Warning: Do not upload confidential, private, or sensitive files to VirusTotal. Files submitted to VirusTotal may be shared with security researchers and security vendors.
The current VirusTotal upload limit used by ViperScan is 32 MB.
ViperScan can scan an entire directory:
viperscan scan ./samplesDirectory scanning is recursive by default.
Disable recursive scanning with:
viperscan scan ./samples --no-recursiveFor detailed information about every file:
viperscan scan ./samples --verboseViperScan also provides a standalone hashing command.
viperscan hash suspicious.exeExample output:
MD5: ...
SHA1: ...
SHA256: ...
Directories can also be hashed:
viperscan hash ./samplesViperScan currently supports three output formats:
viperscan scan suspicious.exeviperscan scan suspicious.exe --format jsonviperscan scan suspicious.exe --format csvResults can also be written directly to a file:
viperscan scan suspicious.exe --format json --output report.jsonBy default, ViperScan skips files larger than 32 MB.
A custom limit can be supplied using:
viperscan scan ./samples --max-size 50000000The value can be a raw byte count, or use a size suffix:
k/m/gβ kilobit / megabit / gigabit (SI, base 1000, Γ·8 for bytes)K/M/Gβ kilobyte / megabyte / gigabyte (base 1024)
viperscan scan ./samples --max-size 50M- Python
- Poetry
- VirusTotal API key (optional)
yara-python(optional, required for YARA scanning)
Clone the repository:
git clone https://github.com/YOUR_USERNAME/ViperScan.git
cd ViperScanInstall dependencies:
poetry installEnter the Poetry environment or run commands through Poetry:
poetry run viperscan --helpViperScan can also be executed as a Python module:
poetry run python -m viperscan --helpCreate a .env file in the project directory:
VT_API_KEY=your_virustotal_api_key_hereViperScan automatically loads the API key using python-dotenv.
Never commit your
.envfile or API key to GitHub.
Make sure .env is included in .gitignore.
General syntax:
viperscan COMMAND [OPTIONS]Available commands:
scan Scan and analyse a file or directory
hash Calculate hashes for a file or directory
View help:
viperscan --helpScan help:
viperscan scan --helpPerform local static analysis with YARA and VirusTotal:
viperscan scan suspicious.exe --yara rules/ --vtPerform the same scan but only send the file's hash (no upload):
viperscan scan suspicious.exe --yara rules/ --vt-hash-onlyGenerate a JSON report:
viperscan scan suspicious.exe --yara rules/ --vt --format json --output report.jsonScan an entire directory:
viperscan scan ./samples --yara rules/ --verboseviperscan/
βββ __init__.py
βββ __main__.py
βββ binary.py
βββ cli.py
βββ files.py
βββ hashing.py
βββ report.py
βββ scanner.py
βββ sizeparse.py
βββ strings.py
βββ vt.py
βββ yara_scan.py
The project is separated into modules so additional malware-analysis capabilities can be added without making the CLI itself overly complex.
ViperScan is still under active development.
Potential future additions include:
- Expanded static malware indicators
- Improved packer detection
- File reputation scoring
- More detailed PE analysis
- Improved YARA rule management
- Configurable scanning profiles
- Improved terminal output
- Additional report formats
- Batch VirusTotal handling
- Detection scoring / risk classification
More updates will be added as the project develops.
ViperScan is intended for educational, research, and defensive cybersecurity purposes.
Always analyse suspicious files inside an appropriately isolated environment such as a virtual machine or malware-analysis sandbox.
The author is not responsible for misuse of this software.
See the repository's LICENSE file for licensing information.
ViperScan v0.1.1 π Simple static malware analysis from the command line.