This project exposes a small FastAPI service that submits files or URLs to a CAPE sandbox, polls the analysis task until the report is ready, stores the result in SQLite, and optionally asks a local Ollama endpoint for a short verdict.
- Accepts a file upload or URL through
POST /submit - Submits the sample to CAPE
- Polls the CAPE task until the report is generated
- Fetches the final CAPE report and screenshots
- Stores the analysis result in
analysis_results.db - Returns stored results through
GET /results/{identifier} - Sends a compact report summary to Ollama for a JSON verdict
Official CAPE documentation: https://capev2.readthedocs.io/
- Create and edit the
.envfile if needed:
CAPE_URL=http://localhost:8000
DB_NAME=analysis_results.db
OLLAMA_URL=http://localhost:11434/api/generate- Install dependencies:
pip install -r requriments.txt- Run the API:
uvicorn CAPE_analysis:app --reload- The code expects a running CAPE instance and, if you want AI verdicts, a running Ollama server.
- The SQLite database and other local runtime files are ignored by git so the repository stays clean.