-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsubmit_url.py
More file actions
33 lines (30 loc) · 852 Bytes
/
submit_url.py
File metadata and controls
33 lines (30 loc) · 852 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
27
28
29
30
31
32
33
#!/usr/bin/env python3
import sys
import json
import requests
def report_urlhaus(auth_key, url):
jsonData = {
'anonymous' : '0',
'submission' : [
{
'url' : url,
'threat' : 'malware_download',
'tags' : [
'Emotet',
'doc'
]
}
]
}
headers = {
"Content-Type" : "application/json",
"Auth-Key" : auth_key
}
r = requests.post('https://urlhaus.abuse.ch/api/', json=jsonData, timeout=15, headers=headers)
print(r.content)
if len(sys.argv) > 2:
report_urlhaus(sys.argv[1], sys.argv[2])
else:
print("Report a malware URL to URLhaus")
print("Usage: python3 submit_url.py <YOUR-AUTH-KEY> <URL>")
print("Note: If you don't have an Auth-Key yet, you can obtain one at https://auth.abuse.ch/")