Skip to main content

Dr.Web vxCube API Client

Project description

Build Status Coverage Status PyPI - Python Version

vxcube-api package

vxcube-api is an API client for interacting with Dr.Web vxCube.

Installation

Python 2.7 or later is required to be installed in advance. Install vxcube-api either from the Python Package Index (PyPI):

$ pip install -U vxcube-api

or from source:

$ python setup.py install

Using command line

Dr.Web vxCube API Client supports command line. To get information about available commands, use --help:

$ vxcube_client --help

Command list:

Command Description
login Get an API key which must be specified in all other commands
config Save or delete base-url, version, or api-key parameter values
upload Upload sample to Dr.Web vxCube server
analyse Analyse uploaded file
delete Delete analysis results
download sample Download sample
download archive Download archive with analysis results
subscribe-analysis Get real-time data about analysis progress

Example:

$ vxcube_client config --api-key aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
$ vxcube_client upload /path/to/sample
Sample uploaded successful:
    sample_path [id: 2342]
        - format: exe
        - platforms: ['winxpx86', 'win7x86', 'win7x64', 'win10x64_1511']
$ vxcube_client analyse 2342 -p win7x86 -p win10x64_1511 --time 30
Analysis d4e22a38-6bdc-4902-881d-897687023c30 started
$ vxcube_client subscribe-analysis d4e22a38-6bdc-4902-881d-897687023c30
[win7x86      ] [8%] Restoring and starting the VM...
[win10x64_1511] [8%] Restoring and starting the VM...
[win10x64_1511] [10%] Copying the file...
[win10x64_1511] [10%] Preparing environment...
[win7x86      ] [10%] Copying the file...
[win7x86      ] [10%] Preparing environment...
[win7x86      ] [16%] Starting the file...
[win7x86      ] [16%] Taking a screenshot...
[win7x86      ] [16%] Waiting while the file is running (30 sec)...
...
[win10x64_1511] [100%] Saving results...
[win7x86      ] [100%] Saving results...
All tasks finished:
Task[578770]-win7x86 [successful] maliciousness: 44
Task[578771]-win10x64_1511 [successful] maliciousness: 50

VxCubeApi class

You can write your own script for processing files with VxCubeApi class.

from vxcube_api import VxCubeApi

API_KEY = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"


def main():
    # Create VxCubeApi
    vxcube = VxCubeApi(api_key=API_KEY)

    # Upload sample
    sample = vxcube.upload_sample("sample_path")
    msg = "Sample uploaded successfully: {sample.id}, {sample.format_name}, {sample.platforms}"
    print(msg.format(sample=sample))

    # Start analysis
    analysis = vxcube.start_analysis(
        sample_id=sample.id,
        platforms=sample.platforms[0:2],
        analysis_time=30
    )
    for msg_obj in analysis.subscribe_progress():
        print(msg_obj)

    # Print results
    print("Analysis finished")
    msg = "Task[{task.id}] is {task.status}. Maliciousness: {task.maliciousness}"
    for task in analysis.tasks:
        print(msg.format(task=task))


if __name__ == '__main__':
    main()

More examples

More usage examples are available here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vxcube-api-1.0.5.zip (41.8 kB view details)

Uploaded Source

File details

Details for the file vxcube-api-1.0.5.zip.

File metadata

  • Download URL: vxcube-api-1.0.5.zip
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.4 pkginfo/1.8.3 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13

File hashes

Hashes for vxcube-api-1.0.5.zip
Algorithm Hash digest
SHA256 4179e4b69e79a997bd87261c80282e950e121b76859c578c017ac1f3139f3752
MD5 f85dd834d8e904cbebc83404f845d4ef
BLAKE2b-256 791b0e0e73f01a95d0b95ce86e5f26e90219ea475ae71f30461da1ff7e941979

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page