API Documentation

Malware Detection System

The system provides RESTful APIs for third-party applications to easily integrate automated malware scanning and detection features.

00

Getting Started

Welcome to the Malware Detection API. This documentation covers all available endpoints to help you integrate automated malware scanning into your applications. The API is RESTful, uses JSON responses, and is accessible via HTTP on 18.141.55.23:5001 by default.


01

File Analysis Endpoint

This endpoint allows uploading one or more executable files (.exe) to perform analysis.

info Required Parameters
  • Endpoint: POST /upload
  • Note: For safety and server stability, the total file size per request is limited to 200MB.

Send (Single File)

bash
curl -X POST -F "files=@C:\path\to\file.exe" https://fptmalwaredetection.duckdns.org/upload

Send (Multiple Files)

bash
curl -X POST -F "files=@file1.exe" -F "files=@file2.exe" https://fptmalwaredetection.duckdns.org/upload
Success Response (JSON)
{
  "data": {
    "session_id": "abc123",
    "status": "processing",
    "total_files": 1
  },
  "message": "Upload successful, processing started",
  "status_code": 200
}
02

Result Endpoint

Use the session_id from the Upload step to track scan progress and retrieve final results.

terminal Usage

Endpoint: GET /status/{session_id}

bash
curl https://fptmalwaredetection.duckdns.org/status/<session_id>
Error Response (JSON)
{
  "message": "Session not found",
  "status_code": 404
}
Success Response (JSON)
{
  "data": {
    "results": [
      {"filename": "file.exe", "is_malware": true},
      {"filename": "file2.exe", "is_malware": false}
    ],
    "summary": {
      "total_files": 2,
      "malware_detected": 1
    },
    "status": "completed"
  },
  "message": "Success"
}

03

Export CSV

Retrieve results and automatically convert JSON to a results.csv file using this command:

bash
curl https://fptmalwaredetection.duckdns.org/status/[session_id] | python -c "import sys,json,csv;d=json.load(sys.stdin)['data'];r=d['results'];w=csv.writer(sys.stdout);w.writerow(['filename','is_malware','malware_probability','status','error']);[w.writerow([x['filename'],x['is_malware'],x['malware_probability'],x['status'],x['error']]) for x in r];print('--- Summary ---');[print(k+':',v) for k,v in d['summary'].items()]" > results.csv

04

Rate Limits

Currently, no rate limits are enforced. Future updates may introduce limits for system stability and DDoS protection. The team is actively evaluating optimal thresholds to balance performance and security.


Integration Workflow

Step-by-Step Implementation

1

Send files to /upload (total size < 200MB) and get a session_id.

2

Call: GET /status/{session_id} to get result.

3

Completion: When status is 'completed', extract results or run the CSV Export command.

Important Notes

  • Rate Limit: Currently no Rate Limit applied. Team evaluating optimal thresholds for DDoS protection.
  • Coming Soon: Upload Folder (recursive scan), Export to CSV (server-side generation).
lock

Secure API Access

Encryption and safety are prioritized. Specialized Rate Limit configuration is currently out-of-scope but deep defense is active.