{ "info": { "author": "Sean Whalen", "author_email": "whalenster@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Security" ], "description": "pyldfire\n========\n\nA Python module for `Palo Alto Networks\\` WildFire API`_\n\n::\n\n Copyright 2016 Sean Whalen\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\nFeatures\n--------\n\n- Python 2 and 3 support\n- Returns native Python objects\n- Raises exceptions on API errors with error details\n- Supports HTTPS proxies and SSL/TLS validation\n- Supports WildFire cloud or appliance\n- Supports all WildFire 7.1 API calls\n\n - Uploading sample files and URLs\n - Getting verdicts\n - Getting full reports in PDF or dictionary formats\n - Getting samples\n - Getting PCAPs\n - Getting a malware test file\n\nExamples\n--------\n\n::\n\n from pprint import PrettyPrinter\n from io import BytesIO\n\n from pyldfire import WildFire\n\n printer = PrettyPrinter(indent=2)\n\n wildfire = WildFire(\"api-key-goes-here\")\n\n # Submit a local file\n with open(\"malware\", \"rb\") as sample_file:\n results = wildfire.submit_file(sample_file)\n printer.pprint(results)\n\n # File Hashes can be MD5,SHA1, or SHA256\n file_hash = \"419251150a2f77422efa1e016d605d69\"\n\n # Download a sample to a file\n with open(\"sample\", \"wb\") as sample_file:\n sample_file.write(wildfire.get_sample(file_hash))\n\n # Or keep it as a file-like object in memory instead\n sample = BytesIO(wildfire.get_sample(file_hash))\n\n # Same for PCAPs and PDF reports\n\n # Get a verdict\n verdict = wildfire.get_verdicts([file_hash])\n\n # Get analysis results\n results = wildfire.get_report(file_hash)\n\n # Test your firewall\n wildfire.get_malware_test_file()\n\npyldfire.WildFire methods\n-------------------------\n\n``__init__(self, api_key, host='wildfire.paloaltonetworks.com', proxies=None, verify=True)``\n\nInitializes the WildFire class\n\n::\n\n Args:\n api_key (str): A WildFire API Key\n host (str): The hostname of the WildFire service or appliance\n proxies (dict): An optional dictionary containing proxy data,\n with https as the key, and the proxy path as the value\n verify (bool): Verify the certificate\n verify (str): A path to a CA cert bundle\n\n``get_malware_test_file(self)``\n\nGets a unique, benign malware test file that will trigger an alert on\nPalo Alto Networks\u2019 firewalls\n\n::\n\n Returns:\n bytes: A malware test file\n\n``get_pcap(self, file_hash, platform=None)``\n\nGets a PCAP from a sample analysis\n\n::\n\n Args:\n file_hash (str): A hash of a sample\n platform (int): One of the following integers:\n\n 1: Windows XP, Adobe Reader 9.3.3, Office 2003\n 2: Windows XP, Adobe Reader 9.4.0, Flash 10, Office 2007\n 3: Windows XP, Adobe Reader 11, Flash 11, Office 2010\n 4: Windows 7 32-bit, Adobe Reader 11, Flash 11, Office 2010\n 5: Windows 7 64bit, Adobe Reader 11, Flash 11, Office 2010\n 50: Mac OS X Mountain Lion\n 201: Android 2.3, API 10, avd2.3.\n\n Returns:\n bytes: The PCAP\n\n Raises:\n WildFireException: If an API error occurs\n\n``get_pdf_report(self, file_hash)``\n\nGets analysis results as a PDF\n\n::\n\n Args:\n file_hash: A hash of a sample of a file\n\n Returns:\n bytes: The PDF\n\n Raises:\n WildFireException: If an API error occurs\n\n``get_report(self, file_hash)``\n\nGets analysis results as structured data\n\n::\n\n Args:\n file_hash (str): A hash of a sample\n\n Returns:\n dict: Analysis results\n\n Raises:\n WildFireException: If an API error occurs\n\n``get_sample(self, file_hash)``\n\nGets a sample file\n\n::\n\n Args:\n file_hash (str): A hash of a sample\n\n Returns:\n bytes: The sample\n\n Raises:\n WildFireException: If an API error occurs\n\n``get_verdicts(self, file_hashes)``\n\nGets the verdict for one or more samples\n\n::\n\n Args:\n file_hashes (list): A list of file hash strings\n file_hashes (str): A single file hash\n\n Returns:\n str: If a single file hash is passed, a string containing the verdict\n list: If multiple hashes a passed, a list of corresponding list of verdict strings\n\n Possible values:\n\n 'Benign'\n 'Malware'\n 'Greyware'\n 'Pending`\n 'Error'\n 'Not found`\n\n Raises:\n WildFireException: If an API error occurs\n\n\n``submit_file(self, file_obj, filename=\"sample\")``\n\nSubmits a file to WildFire for analysis\n\n::\n\n Args:\n file_obj (file): The file to send\n filename (str): An optional filename\n\n Returns:\n dict: Analysis results\n\n Raises:\n WildFireException: If an API error occurs\n\n\n``submit_remote_file(self, url)``\n\nSubmits a file from a remote URL for analysis\n\n::\n\n Args:\n url (str): The URL where the file is located\n\n Returns:\n dict: Analysis results\n\n Raises:\n WildFireException: If an API error occurs\n\n Notes:\n This is for submitting files located at remote URLs, not web pages.\n\n See Also:\n submit_urls(self, urls)\n\n``submit_urls(self, urls)``\n\nSubmits one or more URLs to a web page for analysis\n\n::\n\n Args:\n urls (str): A single URL\n urls (list): A list of URLs\n\n Returns:\n dict: If a single URL is passed, a dictionary of analysis results\n list: If multiple URLs are passed, a list of corresponding dictionaries containing analysis results\n\n Raises:\n WildFireException: If an API error occurs\n\n.. _Palo Alto Networks\\` WildFire API: https://www.paloaltonetworks.com/documentation/71/wildfire/wf_api", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/seanthegeek/pyldfire", "keywords": "PaloAltoNetworks WildFire API Malware Sandbox", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pyldfire", "package_url": "https://pypi.org/project/pyldfire/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyldfire/", "project_urls": { "Homepage": "https://github.com/seanthegeek/pyldfire" }, "release_url": "https://pypi.org/project/pyldfire/7.1.3/", "requires_dist": [ "requests", "xmltodict" ], "requires_python": "", "summary": "A Python module for Palo Alto Networks' WildFire API", "version": "7.1.3" }, "last_serial": 2217463, "releases": { "7.1.3": [ { "comment_text": "", "digests": { "md5": "50625a2164718d524041f2dc150ab892", "sha256": "4280205ed41cc3694c508b1948e4663498b823909203ea14fd3c095b12e608d1" }, "downloads": -1, "filename": "pyldfire-7.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "50625a2164718d524041f2dc150ab892", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9546, "upload_time": "2016-07-12T20:30:42", "url": "https://files.pythonhosted.org/packages/91/c2/a1c93b0edf324a96558055e69dcb25226cda941e35e4eeee077925e755e7/pyldfire-7.1.3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50625a2164718d524041f2dc150ab892", "sha256": "4280205ed41cc3694c508b1948e4663498b823909203ea14fd3c095b12e608d1" }, "downloads": -1, "filename": "pyldfire-7.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "50625a2164718d524041f2dc150ab892", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9546, "upload_time": "2016-07-12T20:30:42", "url": "https://files.pythonhosted.org/packages/91/c2/a1c93b0edf324a96558055e69dcb25226cda941e35e4eeee077925e755e7/pyldfire-7.1.3-py2.py3-none-any.whl" } ] }