All Projects → mindcollapse → Malwaremultiscan

mindcollapse / Malwaremultiscan

Licence: mit
Self-hosted VirusTotal / MetaDefender wannabe with API, demo UI and Scanners running in Docker.

Projects that are alternatives of or similar to Malwaremultiscan

VirusTotalScanner
Scan suspicious applications with over 60 different anti-viruses with a mere two clicks and five seconds!
Stars: ✭ 18 (-91.18%)
Mutual labels:  antivirus, virustotal
MalwareHashDB
Malware hashes for open source projects.
Stars: ✭ 31 (-84.8%)
Mutual labels:  antivirus, virustotal
Malice
VirusTotal Wanna Be - Now with 100% more Hipster
Stars: ✭ 1,253 (+514.22%)
Mutual labels:  antivirus, virustotal
Veil Evasion
Veil Evasion is no longer supported, use Veil 3.0!
Stars: ✭ 1,678 (+722.55%)
Mutual labels:  antivirus
Nativepayload reverse tcp
Meterpreter Encrypted Payload by C#
Stars: ✭ 130 (-36.27%)
Mutual labels:  antivirus
Flying Sandbox Monster
Sandboxed, Rust-based, Windows Defender Client
Stars: ✭ 158 (-22.55%)
Mutual labels:  antivirus
Armadito Av
Armadito antivirus main repository
Stars: ✭ 184 (-9.8%)
Mutual labels:  antivirus
Green Hat Suite
Green-hat-suite is a tool to generate meterpreter/shell which could evade antivirus.
Stars: ✭ 112 (-45.1%)
Mutual labels:  antivirus
Avpwn
List of real-world threats against endpoint protection software
Stars: ✭ 179 (-12.25%)
Mutual labels:  antivirus
Virustotalnet
A full implementation of the VirusTotal 2.0 API
Stars: ✭ 142 (-30.39%)
Mutual labels:  virustotal
Virustotal
💊 VirusTotal Public API 2.0 client for Python 2.x
Stars: ✭ 141 (-30.88%)
Mutual labels:  virustotal
Docker Clamav
Multi-arch dockerized open source antivirus for use with file sharing containers, REST API or TCP.
Stars: ✭ 133 (-34.8%)
Mutual labels:  antivirus
Loki
Loki - Simple IOC and Incident Response Scanner
Stars: ✭ 2,217 (+986.76%)
Mutual labels:  antivirus
Ergo Pe Av
🧠 🦠 An artificial neural network and API to detect Windows malware, based on Ergo and LIEF.
Stars: ✭ 130 (-36.27%)
Mutual labels:  antivirus
Securetea Project
The OWASP SecureTea Project provides a one-stop security solution for various devices (personal computers / servers / IoT devices)
Stars: ✭ 181 (-11.27%)
Mutual labels:  antivirus
Php Malware Detector
PHP malware detector
Stars: ✭ 121 (-40.69%)
Mutual labels:  antivirus
Dnxfirewall
dnxfirewall (dad's next-gen firewall), a pure Python next generation firewall built on top of Linux kernel/netfilter.
Stars: ✭ 174 (-14.71%)
Mutual labels:  antivirus
Illacceptanything
The project where literally anything* goes.
Stars: ✭ 1,756 (+760.78%)
Mutual labels:  antivirus
Vxsig
Automatically generate AV byte signatures from sets of similar binaries.
Stars: ✭ 139 (-31.86%)
Mutual labels:  antivirus
Dontclickshit
Як не стати кібер-жертвою
Stars: ✭ 149 (-26.96%)
Mutual labels:  antivirus

MalwareMultiScan

Tests API UI Scanners

Self-hosted VirusTotal / OPSWAT MetaDefender wannabe API for scanning URLs and files by multiple antivirus solutions.

MalwareMultiScan UI

IMPORTANT: version 1.5 introduces breaking changes in containers configuration and docker-compose.yaml layout. Please see releases page and changelog of docker-compose.yaml and README.md for the additional details.

Introduction

I faced a need to scan user-uploaded files in one of my work projects in an automated mode to ensure they don't contain any malware. Using VirusTotal was not an option because of a) legal restrictions and data residency limitations b) scanning by hash-sums would not be sufficient because the majority of files are generated / modified by users.

After googling, I stumbled upon a fantastic maliceio/malice project. Unfortunately, it looks abandoned, and most plugins do not work for the moment. In addition to that, I had an intention to use the .NET stack to align with the internal infrastructure.

In the end, it's nothing but the set of Docker containers running the agent. That agent downloads the remote file to the temp folder, then launches the vendor command-line scanning utility with proper arguments, and parses the output with a regular expression to extract a detected malware name.

Installation & Usage

IMPORTANT: MalwareMultiScan is not intended as a publicly-facing API / UI. It has (intentionally) no authorization, authentication, rate-limiting, or logging. Therefore, it should be used only as an internal / private API or behind the restrictive API gateway.

Whole solution can be started with docker-compose up executed in a root folder of repository.

It can be also deployed to the Docker Swarm cluster by using the command docker stack deploy malware-multi-scan --compose-file docker-compose.yaml.

After the start the Demo Web UI will become available under http://localhost:8888.

See components chapter below and the docker-compose.yaml file.

Configuration

Configuration of API and Scanners is performed by passing the environment variables. Descriptions and default values are provided below.

MalwareMultiScan.Api

  • MONGO_ADDRESS=mongodb://localhost:27017 - MongoDB connection string.

  • MONGO_DATABASE=MalwareMultiScan - MongoDB collection name.

  • REDIS_ADDRESS=localhost:6379 - Redis address for the distributed task queue.

  • CONSUL_ADDRESS=http://localhost:8500 - Consul address for the service registration.

  • FILE_SIZE_LIMIT=52428800 - Maximum size of a file that can be handled for the file scanning. The size of the URL content is not verified. Set to 0 to disable the validation.

MalwareMultiScan.Scanner

  • BACKEND_ID=dummy - Id of a backend.

  • REDIS_ADDRESS=localhost:6379 - Redis address for the distributed task queue.

  • CONSUL_ADDRESS=http://localhost:8500 - Consul address for the service registration.

  • MAX_SCANNING_TIME=60 - Scan time limit. It is used not just for actual scanning but also for getting the file.

  • WORKER_COUNT=4 - Number of workers for parallel scanning.

MalwareMultiScan.Ui

  • API_URL=http://localhost:5000 - Absolute URL incl. port number for the running instance of MalwareMultiScan.Api.

API Endpoints

  • POST /api/queue/url with a url parameter passed via the form data.. Returns 201 Accepted response with a ScanResult or 400 Bad Request error.

  • POST /api/queue/file with a file parameter passed via the form data. Returns 201 Accepted response with a ScanResult or 400 Bad Request error.

  • GET /api/results/{result-id} where {result-id} corresponds to the id value of a ScanResult. Returns 200 OK response with a ScanResult or 404 Not Found error.

Callback URL

Both /api/queue/url and /api/queue/file also accept an optional callbackUrl parameter with the http(s) URL in it. This URL will be requested by the POST method with JSON serialized ScanResultMessage in a body on every update from scan backends. Query string will contain id parameter that corresponds to the id of the scan result and backend parameter with the id of backend which completed the scan.

I.e. when you define callbackUrl=http://localhost:1234/scan-results, the POST request will be made to http://localhost:1234/scan-results?id=123&backend=dummy with a body

{
  "Status": 1,
  "Duration": 5,
  "Threats": ["Malware.Dummy.Result"]
}

Supported Scan Engines

Name Dockerfile Enabled Comments
ClamAV Clamav.Dockerfile
Comodo Comodo.Dockerfile ⬜️
DrWeb DrWeb.Dockerfile ⬜️ Pass license key to the DRWEB_KEY build arg.
Dummy Dockerfile Scan backend made for testing. Returns Malware.Dummy.Result threat for every scan after 5 seconds.
KES KES.Dockerfile ⬜️ Pass license key to the KES_KEY build arg. KES 11 does not work in Docker.
McAfee McAfee.Dockerfile ⬜️
Sophos Sophos.Dockerfile ⬜️
Defender WindowsDefender.Dockerfile

More scan backends can be added in the future. Some of the popular ones do not have command line scanning utility, Linux version, or don't start in Docker container. Feel free to raise an issue if you know any in addition to the list above.

Components

Workflow

  1. On startup all Scanners register themselves in Consul with a service name equal to scanner and the BackendId metadata field equal to the value of BACKEND_ID environment variable. They also register a TTL check and listen for Hangfire background job in a queue named under the BackendId metadata field.

  2. Third-party client triggers /api/queue/url or /api/queue/file of the MalwareMultiScan.Api.

  3. MalwareMultiScan.Api sends a query to Consul and receives the list of alive scan backends with the service name scanner.

  4. MalwareMultiScan.Api schedules a Hangfire background job in a queue named under the BackendId metadata field.

  5. Scanners picks up a job from queue, starts the scan and sends result back to the default queue of Hangfire.

  6. MalwareMultiScan.Api picks a job from the default` queue of Hangfire and updates the state of the scan.

  7. If callback URL was specified during the step #2, Callback URL for details.

Prerequisites

  • MongoDB of version 3.x or above. Used for storing scan results and files in GridFS. The communication is happening through the official C#/.NET driver.

  • Redis of version 5.x or above. Used for tasks queueing. The communication is happening through the Hangfire library.

  • Consul of version 1.8.x or above. Used for service registration of scan backends.

  • Docker and docker-compose running under Windows (in Linux containers mode), Linux, or OSX. Docker Compose is needed only for test / local deployments.

  • Optional: DockerSwarm / Kubernetes cluster for scaling up the scanning capacities.

Parts

Plans

See issues for the list of planned features, bug-fixes, and improvements.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].