HashGuard is a lightweight, drag-and-drop CLI virus scanner that uses VirusTotal to check files for malware. It hashes any file using SHA-256, queries VirusTotal, and gives a color-coded risk rating.
- Python 3.x
- Requests – for API requests
- Hashlib – for SHA-256 hashing
- Colorama – for colored CLI output
- VirusTotal API – for malware detection
-
CLI-based drag-and-drop scanning
-
SHA-256 hash computation of any file
-
VirusTotal hash lookup
-
Color-coded risk levels:
- High → Red
- Medium → Yellow
- None / Unknown → Green
-
Friendly message for unknown files: “Very low chances of being a virus”
-
Handles no internet connection gracefully
-
Pause at end to review results
Note: This only runs on Windows
- User drags a file onto the executable.
- Program hashes the file using SHA-256.
- Sends the hash to VirusTotal API.
- Retrieves JSON scan results.
- Prints a summary with color-coded risk level.
- If file is unknown in VirusTotal, prints a “very low chances” message.
- How to interact with external APIs (VirusTotal) via Python.
- Handling JSON responses and extracting meaningful data.
- Using CLI color coding for better UX.
- Handling file operations and hashing securely.
- Error handling for network issues and invalid API keys.
- Clone the repository:
git clone https://github.com/<your-username>/HashGuard.git
cd HashGuard- Run the script:
Just Drop a File over it-
When prompted, enter your VirusTotal API Key (must have your own key).
-
Drag and drop the file you want to scan onto the program.
-
Wait for the output. Press Enter to exit after the results are displayed.
