pyxdr


Namepyxdr JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/F6-Security/pyxdr
SummaryF6 XDR REST API Python Bindings
upload_time2025-08-11 13:22:57
maintainerNone
docs_urlNone
authorF6 XDR
requires_pythonNone
licenseMIT
keywords security sandbox facct mdp
VCS
bugtrack_url
requirements attrs certifi chardet flake8 idna importlib-metadata iniconfig mccabe packaging pluggy py pycodestyle pyflakes pyparsing pytest requests toml typing-extensions urllib3 zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python bindings for F6 XDR REST API

**Latest Version: 1.0.1**

## 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

 * [F6 XDR Cloud](https://xdr.f6.security) — our Cloud hosted instance
 * [On-premise installations of F6 XDR](https://www.f6.ru/products/managed-xdr/) — for even more power and privacy

 ## 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"))
```
2. 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.

3. You can get full report as a dictionary:
```
report = analysis.get_report()
```
4. 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`.

5. 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]
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/F6-Security/pyxdr",
    "name": "pyxdr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "security sandbox facct mdp",
    "author": "F6 XDR",
    "author_email": "mxdr@f6.ru",
    "download_url": "https://files.pythonhosted.org/packages/27/0e/d7cfb8bd25a258ff0e9cc2d961272d60fdc38abfd37ab1e1925e11ce3fa0/pyxdr-1.0.1.tar.gz",
    "platform": null,
    "description": "# Python bindings for F6 XDR REST API\n\n**Latest Version: 1.0.1**\n\n## Description\n\nThe F6 XDR Python Client enables you to fully integrate F6 XDR MDP into your malware analysis framework.\nF6 XDR MDP is a Malware Detonation & Research platform designed for deep dynamic analysis and enhanced indicators extraction.\n\nYou can use this library with\n\n * [F6 XDR Cloud](https://xdr.f6.security) \u2014 our Cloud hosted instance\n * [On-premise installations of F6 XDR](https://www.f6.ru/products/managed-xdr/) \u2014 for even more power and privacy\n\n ## License\n\n The code is written in Python and licensed under MIT.\n\n ## Requirements\n\n * python 3.6 or higher\n\n## Getting Started\n\n### Installation\n\n    pip install pyxdr\n\nFor upgrading `pyxdr` to a more recent version, use\n    \n    pip install --upgrade pyxdr\n\n### API Key\n\nIn order to perform any queries via the API, you will need to get the API token for your F6 XDR user.\n1. Open F6 XDR web interface.\n2. Navigate to \"Profile\" and click \"Generate Auth Token\".\n3. Copy this token. This is your API Key.\n\n### Sample Code\n\n1. Let's start by sending some file (\"sample.exe\") for analysis:\n```\nfrom pyxdr import MDP\n\nmdp = MDP(\"MY_API_KEY\")\nanalysis = mdp.upload_file(open(\"sample.exe\", \"rb\"))\n```\n2. If you want to detonate some URL, use the next method:\n```\nanalysis = mdp.upload_url(\"https://very-malicious-url.com\")\n```\nNow we have the `analysis` object.\nTo update analysis status and get info about it, use the next method:\n```\ninfo = analysis.get_info(extended=True)\n```\n**Notice**: parameter `extended` allows you to get full or short info about analysis process. The short version of the information is as follows:\n```\n{\n    \"status\": \"IN PROGRESS\" | \"FINISHED\" | \"FAILED\",\n    \"verdict\": None | True | False,\n    \"report_url\": \"https://...\",\n    \"error\": \"Some error\"  # optional field only for \"FAILED\" status\n}\n```\nIf the \"verdict\" is `True` then object is malicious.\n**Notice**: XDR need some time to generate the report url. Until it happens, the response will not contain this field.\n\n3. You can get full report as a dictionary:\n```\nreport = analysis.get_report()\n```\n4. There is a way to download some detonation artifacts and the report:\n```\narchived_report = analysis.export_report()  # Export report as .tar.\npdf_report = analysis.export_pdf_report()   # Export report as PDF\npcap = analysis.export_pcap()               # Export all network activity as .pcap file.\nscreen_video = analysis.export_video()      # Export the screen-video of the detonation process.\n```\n\n**Notice**: If there is no artifact, all this methods raise `ObjectNotFoundError`.\n\n5. You can check some hash reputation with this method:\n```\nreputation = mdp.get_hash_reputation(\"md5\", \"ac55cf33c4691f863bfb3af8c06a7244\")\n```\nYou can get reputation for `md5`, `sha1`, `sha256` hash types.\nThe method returns a dict object:\n```\n{\n    \"found\": true | false,\n    \"verdict\": true | false,\n    \"malware_families\": [],\n    \"score\": float in [0; 100]\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "F6 XDR REST API Python Bindings",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/F6-Security/pyxdr"
    },
    "split_keywords": [
        "security",
        "sandbox",
        "facct",
        "mdp"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4757a7199850a383391f8100df856bb301a5e72eea62b7113adeb560c053d085",
                "md5": "9220e0bd6b66be25e3fd4ae77cbf7064",
                "sha256": "590cbf3ea87176fe7a940ead4f52a3a08f44927d312b49d6fb6a8cb777abcb49"
            },
            "downloads": -1,
            "filename": "pyxdr-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9220e0bd6b66be25e3fd4ae77cbf7064",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11413,
            "upload_time": "2025-08-11T13:22:56",
            "upload_time_iso_8601": "2025-08-11T13:22:56.333848Z",
            "url": "https://files.pythonhosted.org/packages/47/57/a7199850a383391f8100df856bb301a5e72eea62b7113adeb560c053d085/pyxdr-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "270ed7cfb8bd25a258ff0e9cc2d961272d60fdc38abfd37ab1e1925e11ce3fa0",
                "md5": "2c89ca6723f4e3abffd249b62b31cb45",
                "sha256": "f45ceadc7051a4d44ded5037a763f3a813bf127e492941302617d062266edbf8"
            },
            "downloads": -1,
            "filename": "pyxdr-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2c89ca6723f4e3abffd249b62b31cb45",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12546,
            "upload_time": "2025-08-11T13:22:57",
            "upload_time_iso_8601": "2025-08-11T13:22:57.219442Z",
            "url": "https://files.pythonhosted.org/packages/27/0e/d7cfb8bd25a258ff0e9cc2d961272d60fdc38abfd37ab1e1925e11ce3fa0/pyxdr-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-11 13:22:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "F6-Security",
    "github_project": "pyxdr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "21.2.0"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.7.4"
                ]
            ]
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    "==",
                    "3.9.2"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.7"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "4.4.0"
                ]
            ]
        },
        {
            "name": "iniconfig",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "mccabe",
            "specs": [
                [
                    "==",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "20.9"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "0.13.1"
                ]
            ]
        },
        {
            "name": "py",
            "specs": [
                [
                    "==",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "pycodestyle",
            "specs": [
                [
                    "==",
                    "2.7.0"
                ]
            ]
        },
        {
            "name": "pyflakes",
            "specs": [
                [
                    "==",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "2.4.7"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.2.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.0"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": [
                [
                    "==",
                    "0.10.2"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "3.10.0.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.19"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.19.1"
                ]
            ]
        }
    ],
    "lcname": "pyxdr"
}
        
Elapsed time: 2.04149s