MalwareAnalysis is a file-analysis web app with a Flask backend and a Vite + React frontend. Users upload a file, the backend runs static checks, and the UI shows a clean or malicious verdict with supporting details.
- Computes the SHA-256 hash of the uploaded file.
- Runs YARA matching.
- Extracts PE metadata when the file is a Windows executable.
- Calculates entropy and extracts strings/URLs.
- Optionally queries VirusTotal when
VT_API_KEYis configured. - Caches scan results in Redis when Redis is available.
MalwareAnalysis/
├── app.py # Flask app and upload API
├── analysis.py # Static analysis helpers
├── requirements.txt # Python dependencies
├── frontend/ # Vite + React app
├── templates/ # Flask templates
└── uploads/ # Saved uploads during analysis
- Python 3.8+
- Node.js 18+ recommended
- npm
- Redis is optional, but recommended for caching
- VirusTotal API key is optional
pip install -r requirements.txtcd frontend
npm installCreate a .env file in the project root if you want VirusTotal enabled:
VT_API_KEY=your_virustotal_api_keyIf VT_API_KEY is not set, the app still works and skips the VirusTotal lookup.
Open two terminals in the project root.
python app.pyThe Flask API runs on http://127.0.0.1:5000.
cd frontend
npm run devThe React UI runs on http://localhost:5173.
The frontend is configured to proxy API requests to Flask, so the upload request goes to /api/upload during development.
- Open the frontend in your browser.
- Choose a file or drag one into the upload area.
- Wait for the scan to finish.
- Review the verdict and reasoning shown on screen.
Form field:
file: the file to analyze
Response:
- JSON containing the verdict, score, analysis data, and explanations.
- If Redis is not running, the app continues without cache.
- If VirusTotal is not configured, the scan still runs with local analysis only.
- The backend creates the
uploads/folder automatically if it does not exist.
- If the frontend says the scan failed, check that Flask is running on port 5000.
- If
npm run devcannot reach the backend, confirm the Flask server is running before uploading a file. - If the upload area does nothing, make sure the browser console does not show a network error.
- Abhinav Tiwari
- Pranay Srivastava
- Rajneesh Kumar Gupta
- Sakshi Gupta
No license file is currently included in this repository.