Skip to content

Commit 817e778

Browse files
authored
Merge pull request kevoreilly#2954 from tungmq/fix-malwarebazaar-header
Fix: Update MalwareBazaar downloader to use correct Auth-Key header
2 parents 5222726 + 3e810bb commit 817e778

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/downloaders/malwarebazaar.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
integrations_cfg = Config("integrations")
1010

11+
AUTH_HEADER_KEY = "Auth-Key"
12+
USER_AGENT_HEADER_KEY = "User-Agent"
13+
USER_AGENT_VALUE = "CAPE Sandbox"
14+
1115
log = logging.getLogger(__name__)
1216

1317
_bazaar_map = {
@@ -54,7 +58,7 @@ def download(hash: str, apikey: str = "") -> bytes:
5458
data = requests.post(
5559
"https://mb-api.abuse.ch/api/v1/",
5660
data={"query": "get_file", _bazaar_map[len(hash)]: hash},
57-
headers={"API-KEY": integrations_cfg.abusech.apikey or apikey, "User-Agent": "CAPE Sandbox"},
61+
headers={AUTH_HEADER_KEY: integrations_cfg.abusech.apikey or apikey, USER_AGENT_HEADER_KEY: USER_AGENT_VALUE},
5862
)
5963
if data.ok:
6064
try:

0 commit comments

Comments
 (0)