Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@

# Version 1.0.5
- Field 'report_url' added to analysis info (get_info())

# Version 1.0.6
- Added the ability to export the report to PDF
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python bindings for Group-IB THF REST API

**Latest Version: 1.0.5**
**Latest Version: 1.0.6**

## Description

Expand Down Expand Up @@ -74,6 +74,7 @@ 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.
```
Expand Down
6 changes: 6 additions & 0 deletions pythf/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ def export_report(self, analysis_id):
return self._export_artifact(Url.EXPORT_REPORT, analysis_id)
except ObjectNotFoundError:
raise ObjectNotFoundError("Report not found")

def export_pdf_report(self, analysis_id):
try:
return self._export_artifact(Url.EXPORT_PDF_REPORT, analysis_id)
except ObjectNotFoundError:
raise ObjectNotFoundError("Report not found")

def export_pcap(self, analysis_id):
try:
Expand Down
3 changes: 2 additions & 1 deletion pythf/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.5"
__version__ = "1.0.6"

THF_API_KEY = "THF_API_KEY"
THF_API_URL = "THF_API_URL"
Expand Down Expand Up @@ -60,6 +60,7 @@ class Url:
UI_REPORT = "reports/{commit}/{report_id}/attaches/{attach_id}/"

EXPORT_REPORT = ATTACHES + "{attach_id}/{commit}/{report_id}/polygon_report_export/"
EXPORT_PDF_REPORT = EXPORT_REPORT + '?report_export_format=pdf'
EXPORT_PCAP = ATTACHES + '{attach_id}/{commit}/{report_id}/dump.pcap/dump.pcap/polygon_report_file_download/'
EXPORT_VIDEO = ATTACHES + '{attach_id}/{commit}/{report_id}/shots/video.webm/video.webm/polygon_report_file_download/'

Expand Down
7 changes: 7 additions & 0 deletions pythf/pythf.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ def export_report(self):
If the report is not ready ObjectNotFoundError will be raised.
"""
return self.client.export_report(self.id)

def export_pdf_report(self):
"""
Export the detonation report as PDF
If the report is not ready ObjectNotFoundError will be raised.
"""
return self.client.export_pdf_report(self.id)

def export_pcap(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def run_tests(self):


setup(name='pythf',
version='1.0.5',
version='1.0.6',
author='Group-IB THF',
author_email='[email protected]',
license='MIT',
Expand Down