-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathbazaar_add_comment.py
More file actions
26 lines (21 loc) · 937 Bytes
/
bazaar_add_comment.py
File metadata and controls
26 lines (21 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
import requests
import json
import argparse
__author__ = "Corsin Camichel"
__copyright__ = "Copyright 2020, Corsin Camichel"
__license__ = "Creative Commons Attribution-ShareAlike 4.0 International License."
__version__ = "1.0"
__email__ = "cocaman@gmail.com"
parser = argparse.ArgumentParser(description='Add a comment to a sample on Malware Bazaar by abuse.ch')
parser.add_argument('-s', '--hash', help='Hash of the file (required)', type=str, metavar="HASH", required=True)
parser.add_argument('-c', '--comment', help='Comment to add (required)', type=str, metavar="COMMENT", required=True)
args = parser.parse_args()
headers = { 'API-KEY': '' }
data = {
'query': 'add_comment',
'sha256_hash': ''+args.hash+'',
'comment': u''+args.comment+''
}
response = requests.post('https://mb-api.abuse.ch/api/v1/', data=data, timeout=15, headers=headers)
print(response.content.decode("utf-8", "ignore"))