def get_pcap(task_id):
if not task_id.isdigit():
return HTTPError(code=404, output="The specified ID is invalid")
pcap_path = os.path.join(CUCKOO_ROOT, "storage", "analyses", task_id, "dump.pcap")
if not os.path.exists(pcap_path):
return HTTPError(code=404, output="PCAP not found")
response.content_type = "application/vnd.tcpdump.pcap"
response.set_header("Content-Disposition", "attachment; filename=cuckoo_task_{0}.pcap".format(task_id))
return open(pcap_path, "rb").read()
评论列表
文章目录