Welcome to the detailed usage documentation for HashShield. This guide covers advanced scanning modes, daemon management, reporting, and configuration.
Here is the complete list of arguments you can use with hashshield.
| Argument | Description | Example |
|---|---|---|
PATH |
(Positional) The file or directory to scan. | hashshield . |
--daemon |
Starts the background engine (Server). | hashshield --daemon |
--scan-archives |
Recursively extracts and scans .zip, .tar, .tar.gz. |
hashshield . --scan-archives |
-o, --output |
Saves the scan results to a specific file. | hashshield . -o report.html |
--format |
Sets report format: txt, csv, json, html. |
hashshield . -o log.json --format json |
-t, --threads |
Sets concurrency limit. Default: 4 (Safe), 20+ (Fast). |
hashshield . -t 20 |
--upload |
Uploads unknown files to VirusTotal for sandbox analysis. | hashshield . --upload |
-f, --fresh |
Forces a fresh scan by ignoring the local cache. | hashshield . -f |
-v, --verbose |
Enables debug logging (hashes, API queries, errors). | hashshield . -v |
-E, --exclude-ext |
Skips specific file extensions. | hashshield . -E .log .tmp |
-u, --yara-url |
Loads custom YARA rules from a remote URL. | hashshield . -u http://site.com/rules.yar |
- Architecture Overview
- Starting the Engine (Daemon)
- Scanning Modes
- Reporting & Exporting
- Performance Tuning
- Configuration & Exclusions
- Testing & Validation
HashShield uses a Client-Server model to achieve high performance.
- The Daemon (Server): Loads the virus database (2.5M+ signatures) into RAM. It listens on a local port (Default: 65432).
- The Client (Scanner): Sends file paths to the daemon for instant checking. If the daemon is offline, the client attempts to auto-start it.
For the best performance, keep the daemon running in a background terminal.
# Start the daemon
hashshield --daemon- Startup Time: ~10-20 seconds (Downloads/Loads database).
- Scan Speed: Instant (O(1) Lookup) once loaded.
Note: If you forget to start the daemon, the scanner will attempt to auto-start it when you run a scan command.
Scan a specific file or recursively scan a directory.
# Scan current directory
hashshield .
# Scan a specific path
hashshield /home/user/DownloadsHashShield can recursively extract and scan nested archives (.zip, .tar, .tar.gz).
- Mechanism: Extracts files to a secure
temp_scans/directory, scans them, and auto-cleans up.
hashshield . --scan-archivesBy default, HashShield only checks hashes against VirusTotal. If a file is unknown (Zero-Day), you can force an upload for sandbox analysis.
# Upload unknown files to VirusTotal
hashshield . --uploadWarning: This is slower as it requires uploading the actual file content.
Generate professional audit logs for your scans.
- TXT: Human-readable audit log with ASCII branding and summary tables.
- CSV: Spreadsheet-compatible format (Timestamp, File, Status, Engine, Threat Name).
- JSON: Structured data for SIEM integration.
- HTML: Executive Dashboard with visual charts and badges.
# Generate a Text Report (Default)
hashshield . -o audit_log.txt
# Generate an HTML Dashboard
hashshield . -o report.html --format html
# Generate a CSV Report for Excel
hashshield . -o scan_results.csv --format csv
# Generate a JSON Report for Development
hashshield . -o data.json --format jsonYou can control the concurrency of the scanner to balance speed vs. API limits.
- Default:
4 threads(Safe for VirusTotal Free Tier). - High Speed:
20+ threads(Recommended if using Local Engine only or Premium API).
# Maximize speed for local scanning
hashshield . --threads 20VIRUSTOTAL_API_KEY="your_key"
SHIELD_DAEMON_PORT=65432Place a .shieldignore file in the target directory to exclude specific patterns.
# Example .shieldignore
*.log
secret_backup.zip
test_data/
HashShield includes a test generator to validate detection capabilities against "Safe" threats (EICAR) and simulated malware.
-
Generate the Malware Zoo: Run the helper script included in the repository.
./setup_test_zone.sh
Creates
live_malware_test/with EICAR files, MSFVenom payloads, and copied system binaries. -
Run the Test Scan:
hashshield live_malware_test --threads 4
-
Expected Results:
- EICAR Files: Detected by
Shield Engine (Local DB). - MSFVenom Payloads: Detected by
YARA(Custom Rules). - Real Threats: Detected by
Shield EngineorVirusTotal. - Safe Files: Marked as
CLEAN.
- EICAR Files: Detected by