Skip to main content

F6 XDR REST API Python Bindings

Project description

Python bindings for F6 XDR REST API

Latest Version: 1.0.2

Description

The F6 XDR Python Client enables you to fully integrate F6 XDR MDP into your malware analysis framework. F6 XDR MDP is a Malware Detonation & Research platform designed for deep dynamic analysis and enhanced indicators extraction.

You can use this library with

License

The code is written in Python and licensed under MIT.

Requirements

  • python 3.6 or higher

Getting Started

Installation

pip install pyxdr

For upgrading pyxdr to a more recent version, use

pip install --upgrade pyxdr

API Key

In order to perform any queries via the API, you will need to get the API token for your F6 XDR user.

  1. Open F6 XDR web interface.
  2. Navigate to "Profile" and click "Generate Auth Token".
  3. Copy this token. This is your API Key.

Sample Code

  1. Let's start by sending some file ("sample.exe") for analysis:
from pyxdr import MDP

mdp = MDP("MY_API_KEY")
analysis = mdp.upload_file(open("sample.exe", "rb"))
  1. If you want to detonate some URL, use the next method:
analysis = mdp.upload_url("https://very-malicious-url.com")

Now we have the analysis object. To update analysis status and get info about it, use the next method:

info = analysis.get_info(extended=True)

Notice: parameter extended allows you to get full or short info about analysis process. The short version of the information is as follows:

{
    "status": "IN PROGRESS" | "FINISHED" | "FAILED",
    "verdict": None | True | False,
    "report_url": "https://...",
    "error": "Some error"  # optional field only for "FAILED" status
}

If the "verdict" is True then object is malicious. Notice: XDR need some time to generate the report url. Until it happens, the response will not contain this field.

  1. You can get full report as a dictionary:
report = analysis.get_report()
  1. There is a way to download some detonation artifacts and the report:
archived_report = analysis.export_report()  # Export report as .tar.
pdf_report = analysis.export_pdf_report()   # Export report as PDF
pcap = analysis.export_pcap()               # Export all network activity as .pcap file.
screen_video = analysis.export_video()      # Export the screen-video of the detonation process.

Notice: If there is no artifact, all this methods raise ObjectNotFoundError.

  1. You can check some hash reputation with this method:
reputation = mdp.get_hash_reputation("md5", "ac55cf33c4691f863bfb3af8c06a7244")

You can get reputation for md5, sha1, sha256 hash types. The method returns a dict object:

{
    "found": true | false,
    "verdict": true | false,
    "malware_families": [],
    "score": float in [0; 100]
}

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

pyxdr-1.0.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxdr-1.0.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file pyxdr-1.0.2.tar.gz.

File metadata

  • Download URL: pyxdr-1.0.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pyxdr-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3be653a90af22eed131bedcc1517542da5f684729f042217369c1a81a693dae9
MD5 d61fb2e91682390cb7bb060e14105ebc
BLAKE2b-256 4cb431f47c403eb95d54a6a52d60e06ad2459e3c3524e52f85abb43e92997d5c

See more details on using hashes here.

File details

Details for the file pyxdr-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyxdr-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pyxdr-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6007e3a6ff056f4f2a428d538da737eb671f66ad7f1199071cfc630a0cc1f27a
MD5 22f29b913549e1b1b4f3a4d7d122e9cb
BLAKE2b-256 cf7e722595f46165b7261c8c57ffe2e81c4788f63bd4b9b252a0e7f3596d3ac2

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