A professional malware analysis tool that computes cryptographic hashes, queries VirusTotal for threat intelligence, verifies file types, tracks historical scans, and generates structured JSON and PDF reports.
- Multi-hash computation (MD5, SHA1, SHA256)
- VirusTotal API integration
- Threat level classification
- Batch directory scanning
- JSON report export
- File type verification using file signature analysis
- Historical scan tracking
- PDF report generation
- Structured audit-style reporting
malware-hash-scanner/
│
├── main.py
├── file_hasher.py
├── threat_checker.py
├── file_type_checker.py
├── history_tracker.py
├── report_generator.py
│
├── README.md
├── requirements.txt
├── .gitignore
├── LICENSE
│
├── reports/
│ └── (generated reports)
│
├── history/
│ └── scan_history.json
│
└── sample/
└── suspicious_files/
└── test.txt
git clone https://github.com/cchokaaa/malware-hash-scanner.git
cd malware-hash-scannerpython -m venv venvvenv\Scripts\Activate.ps1source venv/Scripts/activatepip install -r requirements.txtThis project uses the VirusTotal API to retrieve malware detection statistics based on file SHA256 hashes.
Create a free account at:
Generate an API key and configure it as an environment variable.
$env:VT_API_KEY="your_api_key_here"export VT_API_KEY="your_api_key_here"python main.py sample/suspicious_files/test.txtpython main.py sample/suspicious_files/test.txt --json reports/report.jsonpython main.py sample/suspicious_files/test.txt --pdf reports/report.pdfpython main.py sample/suspicious_files/test.txt --json reports/report.json --pdf reports/report.pdfpython main.py sample/suspicious_files============================================================
file_name: test.txt
file_path: D:\malware-hash-scanner\sample\suspicious_files\test.txt
file_size: 43
md5: a123f7b957092282734d4a91fd193c05
sha1: 77b56de4e98c1a0889224fba1a506a2a870b72f7
sha256: adfa5212baafb6f3b92ad0ed5e093601bcad32d1f29694f66214447b2c8a23eb
detected_type: unknown
extension_matches: True
suspicious: False
malicious_count: 0
threat_level: Low
============================================================
| Malicious Detections | Threat Level |
|---|---|
| 0 | Low |
| 1–3 | Medium |
| 4–10 | High |
| >10 | Critical |
-
Cryptographic Hash Calculation
Computes MD5, SHA1, and SHA256 hashes for each file. -
File Type Verification
Uses magic-byte analysis to detect extension spoofing. -
VirusTotal Lookup
Sends the SHA256 hash to VirusTotal and retrieves malware detection statistics. -
Threat Scoring
Maps malicious detections to Low, Medium, High, or Critical. -
Historical Tracking
Stores each scan result inhistory/scan_history.json. -
Report Generation
Exports scan results to JSON and PDF formats.
{
"file_name": "test.txt",
"file_path": "D:/malware-hash-scanner/sample/suspicious_files/test.txt",
"file_size": 43,
"md5": "...",
"sha1": "...",
"sha256": "...",
"detected_type": "unknown",
"extension_matches": true,
"suspicious": false,
"malicious_count": 0,
"threat_level": "Low"
}- Cryptographic hashing
- Threat intelligence integration
- File signature analysis
- Malware triage
- Risk scoring
- Historical audit tracking
- Automated reporting
This project is licensed under the MIT License.
See the LICENSE file for details.
cchokaaa
This project is intended for educational, research, and defensive security purposes only.
Users are responsible for complying with all applicable laws, regulations, and third-party service terms.