From 59966589d6f5729b1b25ee018a94d8c06ea4d41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leonard?= Date: Sat, 29 Jun 2019 06:16:02 +0200 Subject: [PATCH] #506 upgrade to v 1.2. Use HEAD instead of GET request --- analyzers/UnshortenLink/UnshortenLink.json | 2 +- analyzers/UnshortenLink/unshortenlink.py | 2 +- .../{UnshortenLink_1_1 => UnshortenLink_1_2}/long.html | 0 .../{UnshortenLink_1_1 => UnshortenLink_1_2}/short.html | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename thehive-templates/{UnshortenLink_1_1 => UnshortenLink_1_2}/long.html (100%) rename thehive-templates/{UnshortenLink_1_1 => UnshortenLink_1_2}/short.html (100%) diff --git a/analyzers/UnshortenLink/UnshortenLink.json b/analyzers/UnshortenLink/UnshortenLink.json index 5ebc2e9..c368e9c 100644 --- a/analyzers/UnshortenLink/UnshortenLink.json +++ b/analyzers/UnshortenLink/UnshortenLink.json @@ -1,6 +1,6 @@ { "name": "UnshortenLink", - "version": "1.1", + "version": "1.2", "author": "Remi Pointel, CERT-BDF", "url": "https://github.com/TheHive-Project/Cortex-Analyzers", "license": "AGPL-V3", diff --git a/analyzers/UnshortenLink/unshortenlink.py b/analyzers/UnshortenLink/unshortenlink.py index ff24452..adaf6ee 100755 --- a/analyzers/UnshortenLink/unshortenlink.py +++ b/analyzers/UnshortenLink/unshortenlink.py @@ -67,7 +67,7 @@ class UnshortenlinkAnalyzer(Analyzer): result = {'found': False, 'url': None} try: - response = requests.get(url, proxies=proxies, + response = requests.head(url, proxies=proxies, allow_redirects=False) if (response.status_code == 301) or (response.status_code == 302): diff --git a/thehive-templates/UnshortenLink_1_1/long.html b/thehive-templates/UnshortenLink_1_2/long.html similarity index 100% rename from thehive-templates/UnshortenLink_1_1/long.html rename to thehive-templates/UnshortenLink_1_2/long.html diff --git a/thehive-templates/UnshortenLink_1_1/short.html b/thehive-templates/UnshortenLink_1_2/short.html similarity index 100% rename from thehive-templates/UnshortenLink_1_1/short.html rename to thehive-templates/UnshortenLink_1_2/short.html