def get_cp_vxstream_download(sha256, eid, ftype):
Sample.query.filter_by(sha256=sha256, user_id=g.user.id).first_or_404()
headers = {
'Accept': 'text/html',
'User-Agent': 'VxStream Sandbox API Client'}
params = {'type': ftype, 'environmentId': eid}
vx = vxstream.api.get('result/{}'.format(sha256),
params=params, headers=headers)
if ftype in ['xml', 'html', 'bin', 'pcap']:
ftype += '.gz'
return send_file(BytesIO(vx),
attachment_filename='{}.{}'.format(sha256, ftype),
as_attachment=True)
评论列表
文章目录